# bach-dt/2026_ausculpatch architecture

> Architecture diagram of the GitHub repository bach-dt/2026_ausculpatch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bach-dt/2026_ausculpatch
- Repository: https://github.com/bach-dt/2026_ausculpatch

## Overview

The product described by the README is a voice-operated Universal Robot interface. Users submit text, browser-recognized speech, or AusculPatch Bluetooth audio; the backend obtains a command, passes it to the tool-using agent, and returns a response for display and optional speech. The principal path and the documented robot, camera, drawing, and calculation capabilities are represented below. Source excerpts establish the main calls; uninspected runtime internals and hardware behavior are not inferred.

Main entry points: [`ur-voice-control-final/backend/ur_agent.py`](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/ur_agent.py) (UR command agent), [`ur-voice-control-final/frontend/src/App.tsx`](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/frontend/src/App.tsx) (Voice control UI), [`ur-voice-control-final/backend/server.py`](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/server.py) (HTTP routes), [`ur-voice-control-final/backend/tools/drawing_tool.py`](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/tools/drawing_tool.py) (Image-to-drawing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_webapp["Voice control UI<br/>[App.tsx]"]
  node_speech["Browser speech input<br/>[App.tsx]"]
end

subgraph group_backend["Command backend"]
  node_server["HTTP routes<br/>[server.py]"]
  node_chatbot["Placeholder chatbot<br/>[chatbot.py]"]
end

subgraph group_voice["Voice input"]
  node_bluetooth["Patch audio classifier<br/>[detectV2.py]"]
end

subgraph group_agent["Agent capabilities"]
  node_agent["UR command agent<br/>[ur_agent.py]"]
  node_prompt["Robot instructions<br/>[prompts.py]"]
  node_math["Math tools<br/>[calculation.py]"]
end

subgraph group_hardware["Robot and perception"]
  node_robottools["Robot control tools<br/>[ur_tools.py]"]
  node_camera["Camera perception<br/>[camera_tool.py]"]
  node_drawing["Image-to-drawing<br/>[drawing_tool.py]"]
end

node_user(("Operator"))
node_robot{{"Universal Robot arm"}}
node_patch{{"AusculPatch"}}
node_llm{{"OpenAI model"}}
node_google{{"Google image search"}}
node_camera_device{{"Camera"}}
node_browser_tts{{"Browser speech output"}}

node_user -->|"enters command"| node_webapp
node_webapp -->|"posts text"| node_server
node_webapp -->|"captures speech"| node_speech
node_speech -->|"posts transcript"| node_server
node_webapp -->|"requests patch"| node_server
node_patch -.->|"sends audio"| node_bluetooth
node_server -->|"predicts command"| node_bluetooth
node_bluetooth -.->|"reads audio"| node_patch
node_server -->|"invokes command"| node_agent
node_agent -->|"uses instructions"| node_prompt
node_agent -->|"registers tools"| node_math
node_agent -->|"registers tools"| node_robottools
node_agent -->|"registers tools"| node_camera
node_agent -->|"registers tools"| node_drawing
node_agent -->|"queries model"| node_llm
node_robottools -->|"controls arm"| node_robot
node_drawing -->|"executes drawing"| node_robot
node_camera -->|"captures frames"| node_camera_device
node_drawing -->|"searches images"| node_google
node_server -->|"returns response"| node_webapp
node_webapp -->|"speaks response"| node_browser_tts

click node_webapp "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/frontend/src/App.tsx"
click node_server "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/server.py"
click node_agent "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/ur_agent.py"
click node_prompt "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/prompts.py"
click node_math "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/tools/calculation.py"
click node_robottools "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/tools/ur_tools.py"
click node_camera "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/tools/camera_tool.py"
click node_drawing "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/tools/drawing_tool.py"
click node_speech "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/frontend/src/App.tsx"
click node_bluetooth "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/voice_model/detectV2.py"
click node_chatbot "https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/chatbot.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_speech,node_browser_tts toneBlue
class node_server,node_chatbot toneAmber
class node_bluetooth toneMint
class node_agent,node_prompt,node_math toneRose
class node_robottools,node_camera,node_drawing,node_user,node_robot,node_patch,node_llm,node_google,node_camera_device toneIndigo
```

## Components

### User interface

- [Voice control UI](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/frontend/src/App.tsx): `ur-voice-control-final/frontend/src/App.tsx`
- [Browser speech input](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/frontend/src/App.tsx): `ur-voice-control-final/frontend/src/App.tsx`

### Command backend

- [HTTP routes](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/server.py): `ur-voice-control-final/backend/server.py`
- [Placeholder chatbot](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/chatbot.py): `ur-voice-control-final/backend/chatbot.py`

### Voice input

- [Patch audio classifier](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/voice_model/detectV2.py): `ur-voice-control-final/backend/voice_model/detectV2.py`

### Agent capabilities

- [UR command agent](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/ur_agent.py): `ur-voice-control-final/backend/ur_agent.py`
- [Robot instructions](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/prompts.py): `ur-voice-control-final/backend/prompts.py`
- [Math tools](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/tools/calculation.py): `ur-voice-control-final/backend/tools/calculation.py`

### Robot and perception

- [Robot control tools](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/tools/ur_tools.py): `ur-voice-control-final/backend/tools/ur_tools.py`
- [Camera perception](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/tools/camera_tool.py): `ur-voice-control-final/backend/tools/camera_tool.py`
- [Image-to-drawing](https://github.com/bach-dt/2026_ausculpatch/blob/main/ur-voice-control-final/backend/tools/drawing_tool.py): `ur-voice-control-final/backend/tools/drawing_tool.py`

### Other components

- **Operator**
- **Universal Robot arm**
- **AusculPatch**
- **OpenAI model**
- **Google image search**
- **Camera**
- **Browser speech output**

## Connections

- Operator → Voice control UI: enters command (evidence: `ur-voice-control-final/frontend/src/App.tsx`)
- Voice control UI → HTTP routes: posts text (evidence: `ur-voice-control-final/frontend/src/App.tsx`)
- Voice control UI → Browser speech input: captures speech (evidence: `ur-voice-control-final/frontend/src/App.tsx`)
- Browser speech input → HTTP routes: posts transcript (evidence: `ur-voice-control-final/frontend/src/App.tsx`)
- Voice control UI → HTTP routes: requests patch (evidence: `ur-voice-control-final/frontend/src/App.tsx`)
- AusculPatch → Patch audio classifier: sends audio (evidence: `README.md`)
- HTTP routes → Patch audio classifier: predicts command (evidence: `ur-voice-control-final/backend/server.py`)
- Patch audio classifier → AusculPatch: reads audio (evidence: `ur-voice-control-final/backend/voice_model/detectV2.py`)
- HTTP routes → UR command agent: invokes command (evidence: `ur-voice-control-final/backend/server.py`)
- UR command agent → Robot instructions: uses instructions (evidence: `ur-voice-control-final/backend/ur_agent.py`)
- UR command agent → Math tools: registers tools (evidence: `ur-voice-control-final/backend/ur_agent.py`)
- UR command agent → Robot control tools: registers tools (evidence: `ur-voice-control-final/backend/ur_agent.py`)
- UR command agent → Camera perception: registers tools (evidence: `ur-voice-control-final/backend/ur_agent.py`)
- UR command agent → Image-to-drawing: registers tools (evidence: `ur-voice-control-final/backend/ur_agent.py`)
- UR command agent → OpenAI model: queries model (evidence: `ur-voice-control-final/backend/ur_agent.py`)
- Robot control tools → Universal Robot arm: controls arm (evidence: `ur-voice-control-final/backend/tools/ur_tools.py`)
- Image-to-drawing → Universal Robot arm: executes drawing (evidence: `ur-voice-control-final/backend/tools/drawing_tool.py`)
- Camera perception → Camera: captures frames (evidence: `ur-voice-control-final/backend/tools/camera_tool.py`)
- Image-to-drawing → Google image search: searches images (evidence: `ur-voice-control-final/backend/tools/drawing_tool.py`)
- HTTP routes → Voice control UI: returns response (evidence: `ur-voice-control-final/backend/server.py`)
- Voice control UI → Browser speech output: speaks response (evidence: `ur-voice-control-final/frontend/src/App.tsx`)
