# keranbyge/rosa-turtlesim architecture

> Architecture diagram of the GitHub repository keranbyge/rosa-turtlesim, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/keranbyge/rosa-turtlesim
- Repository: https://github.com/keranbyge/rosa-turtlesim

## Overview

ROSA is a natural-language agent for ROS1/ROS2: a user supplies a query, the agent reasons with an injected language model, and selected tools inspect or operate the robot system. Its TurtleSim demo specializes ROSA with demo prompts, model configuration, turtle-control tools, an interactive terminal, and optional microphone transcription. The README documents ROS1/ROS2 support and TurtleSim control; implementation excerpts establish the agent/tool assembly and several tool behaviors. Some demo wiring is shown only by the source index, so those links are limited to documented or indexed references.

Main entry points: [`src/turtle_agent/scripts/turtle_agent.py`](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/turtle_agent.py) (TurtleAgent), [`src/rosa/tools/__init__.py`](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/__init__.py) (Tool Registry), [`src/rosa/rosa.py`](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/rosa.py) (ROSA Agent), [`src/rosa/tools/ros1.py`](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/ros1.py) (ROS1 Tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent Core"]
  node_rosa["ROSA Agent<br/>[rosa.py]"]
  node_prompts["Robot Prompts<br/>[prompts.py]"]
end

subgraph group_ros["ROS Capabilities"]
  node_ros1["ROS1 Tools<br/>[ros1.py]"]
  node_ros2["ROS2 Tools<br/>[ros2.py]"]
  node_log["Log Tools<br/>[log.py]"]
end

subgraph group_demo["TurtleSim Demo"]
  node_turtle_agent["TurtleAgent<br/>[turtle_agent.py]"]
  node_demo_llm["Model Setup<br/>[llm.py]"]
  node_demo_prompts["Demo Prompts<br/>[prompts.py]"]
  node_turtle_tools["Turtle Controls<br/>[turtle.py]"]
  node_help["Interactive Help<br/>[help.py]"]
  node_voice["Voice Input<br/>[voice_input.py]"]
end

subgraph group_internal["Agent Internals"]
  node_tool_registry["Tool Registry<br/>[__init__.py]"]
  node_calculation["Calculation Tools<br/>[calculation.py]"]
  node_system["System Tools<br/>[system.py]"]
end

node_user(("User"))
node_model{{"Language Model"}}
node_ros_system{{"ROS System"}}
node_turtlesim{{"TurtleSim"}}

node_user -->|"submits query"| node_rosa
node_rosa -.->|"reasons with"| node_model
node_rosa -->|"uses prompts"| node_prompts
node_rosa -->|"assembles tools"| node_tool_registry
node_tool_registry -->|"registers ROS1"| node_ros1
node_tool_registry -->|"registers ROS2"| node_ros2
node_tool_registry -->|"registers tools"| node_calculation
node_tool_registry -->|"registers tools"| node_log
node_tool_registry -->|"registers tools"| node_system
node_ros1 -.->|"queries or controls"| node_ros_system
node_ros2 -.->|"queries or controls"| node_ros_system
node_turtle_agent -->|"extends agent"| node_rosa
node_turtle_agent -->|"gets model"| node_demo_llm
node_demo_llm -.->|"configures provider"| node_model
node_turtle_agent -->|"loads prompts"| node_demo_prompts
node_turtle_agent -->|"uses controls"| node_turtle_tools
node_turtle_agent -->|"displays help"| node_help
node_turtle_agent -->|"accepts transcription"| node_voice
node_user -->|"interacts with demo"| node_turtle_agent
node_turtle_tools -.->|"controls simulation"| node_turtlesim

click node_rosa "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/rosa.py"
click node_prompts "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/prompts.py"
click node_tool_registry "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/__init__.py"
click node_ros1 "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/ros1.py"
click node_ros2 "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/ros2.py"
click node_calculation "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/calculation.py"
click node_log "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/log.py"
click node_system "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/system.py"
click node_turtle_agent "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/turtle_agent.py"
click node_demo_llm "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/llm.py"
click node_demo_prompts "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/prompts.py"
click node_turtle_tools "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/tools/turtle.py"
click node_help "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/help.py"
click node_voice "https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/voice_input.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_rosa,node_prompts,node_user toneBlue
class node_ros1,node_ros2,node_log toneAmber
class node_turtle_agent,node_demo_llm,node_demo_prompts,node_turtle_tools,node_help,node_voice toneMint
class node_tool_registry,node_calculation,node_system toneRose
class node_model,node_ros_system,node_turtlesim toneIndigo
```

## Components

### Agent Core

- [ROSA Agent](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/rosa.py): `src/rosa/rosa.py`
- [Robot Prompts](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/prompts.py): `src/rosa/prompts.py`

### ROS Capabilities

- [ROS1 Tools](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/ros1.py): `src/rosa/tools/ros1.py`
- [ROS2 Tools](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/ros2.py): `src/rosa/tools/ros2.py`
- [Log Tools](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/log.py): `src/rosa/tools/log.py`

### TurtleSim Demo

- [TurtleAgent](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/turtle_agent.py): `src/turtle_agent/scripts/turtle_agent.py`
- [Model Setup](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/llm.py): `src/turtle_agent/scripts/llm.py`
- [Demo Prompts](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/prompts.py): `src/turtle_agent/scripts/prompts.py`
- [Turtle Controls](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/tools/turtle.py): `src/turtle_agent/scripts/tools/turtle.py`
- [Interactive Help](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/help.py): `src/turtle_agent/scripts/help.py`
- [Voice Input](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/turtle_agent/scripts/voice_input.py): `src/turtle_agent/scripts/voice_input.py`

### Agent Internals

- [Tool Registry](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/__init__.py): `src/rosa/tools/__init__.py`
- [Calculation Tools](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/calculation.py): `src/rosa/tools/calculation.py`
- [System Tools](https://github.com/keranbyge/rosa-turtlesim/blob/main/src/rosa/tools/system.py): `src/rosa/tools/system.py`

### Other components

- **User**
- **Language Model**
- **ROS System**
- **TurtleSim**

## Connections

- User → ROSA Agent: submits query (evidence: `README.md`)
- ROSA Agent → Language Model: reasons with
- ROSA Agent → Robot Prompts: uses prompts (evidence: `src/rosa/rosa.py`)
- ROSA Agent → Tool Registry: assembles tools (evidence: `src/rosa/rosa.py`)
- Tool Registry → ROS1 Tools: registers ROS1 (evidence: `src/rosa/tools/__init__.py`)
- Tool Registry → ROS2 Tools: registers ROS2 (evidence: `src/rosa/tools/__init__.py`)
- Tool Registry → Calculation Tools: registers tools (evidence: `src/rosa/tools/__init__.py`)
- Tool Registry → Log Tools: registers tools (evidence: `src/rosa/tools/__init__.py`)
- Tool Registry → System Tools: registers tools (evidence: `src/rosa/tools/__init__.py`)
- ROS1 Tools → ROS System: queries or controls
- ROS2 Tools → ROS System: queries or controls
- TurtleAgent → ROSA Agent: extends agent (evidence: `src/turtle_agent/scripts/turtle_agent.py`)
- TurtleAgent → Model Setup: gets model (evidence: `src/turtle_agent/scripts/turtle_agent.py`)
- Model Setup → Language Model: configures provider
- TurtleAgent → Demo Prompts: loads prompts (evidence: `src/turtle_agent/scripts/turtle_agent.py`)
- TurtleAgent → Turtle Controls: uses controls (evidence: `src/turtle_agent/scripts/turtle_agent.py`)
- TurtleAgent → Interactive Help: displays help (evidence: `src/turtle_agent/scripts/turtle_agent.py`)
- TurtleAgent → Voice Input: accepts transcription (evidence: `src/turtle_agent/scripts/turtle_agent.py`)
- User → TurtleAgent: interacts with demo (evidence: `README.md`)
- Turtle Controls → TurtleSim: controls simulation
