# ajsike2310/project-ikru-the-intelligent-kinematic-robot- architecture

> Architecture diagram of the GitHub repository ajsike2310/project-ikru-the-intelligent-kinematic-robot-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-
- Repository: https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-

## Overview

IKRU turns spoken or typed natural-language input into conversational responses and robot actions, with optional camera context, synthesized speech, and expressive face rendering. The main workflow is coordinated by `software/ikru/main.py`; the dashboard provides a separate HTTP interface for robot, vision, and audio features. Firmware excerpts cover the face engine, while the README documents WebSocket motor control and offline LLM/vision capabilities. Some subsystem wiring is documented but its implementation was not sampled, so those links are omitted or marked unverified.

Main entry points: [`software/ikru/main.py`](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/main.py) (Application Orchestrator), [`firmware/controller/Face.cpp`](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/Face.cpp) (Face Coordinator), [`software/ikru/chat/engine.py`](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/chat/engine.py) (Chat Engine), [`dump/ui/server.py`](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/dump/ui/server.py) (Dashboard API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User Interaction"]
  node_entry["Application Orchestrator<br/>[main.py]"]
  node_microphone["Speech Input<br/>[controller.py]"]
end

subgraph group_intelligence["Conversation and Vision"]
  node_chat["Chat Engine<br/>[engine.py]"]
  node_parser["Response Parser<br/>[parser.py]"]
  node_prompts["System Prompts<br/>[prompts.py]"]
  node_vision_receiver["Camera Receiver<br/>[receiver.py]"]
  node_frame_buffer["Latest Frame Buffer<br/>[frame_buffer.py]"]
  node_vlm["Vision Model<br/>[vlm.py]"]
end

subgraph group_robot_io["Robot I/O and Audio"]
  node_robot_controller["Robot Controller<br/>[controller.py]"]
  node_protocol["Robot Protocol<br/>[protocol.py]"]
  node_audio["Speech Audio Service<br/>[service.py]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_server["Dashboard API<br/>[server.py]"]
  node_dashboard_ui["Dashboard UI<br/>[app.js]"]
end

subgraph group_firmware_face["Firmware Face"]
  node_face["Face Coordinator<br/>[Face.cpp]"]
  node_eye["Eye Engine<br/>[Eye.cpp]"]
  node_eye_drawer["Eye Drawing<br/>[EyeDrawer.h]"]
  node_face_behavior["Face Behavior<br/>[FaceBehavior.cpp]"]
  node_face_expression["Face Expressions<br/>[FaceExpression.cpp]"]
  node_look_assistant["Look Assistant<br/>[LookAssistant.cpp]"]
  node_animations["Animation Primitives<br/>[Animations.h]"]
end

node_user(("User"))
node_ollama{{"Ollama LLM"}}
node_camera{{"ESP32-CAM"}}
node_esp32{{"ESP32 Robot"}}

node_user -->|"provides input"| node_entry
node_entry -->|"captures speech"| node_microphone
node_entry -->|"sends prompt"| node_chat
node_chat -->|"queries model"| node_ollama
node_chat -->|"parses response"| node_parser
node_chat -->|"uses prompt"| node_prompts
node_entry -->|"starts receiver"| node_vision_receiver
node_vision_receiver -->|"stores frames"| node_frame_buffer
node_entry -->|"requests visual reasoning"| node_vlm
node_camera -.->|"streams frames"| node_vision_receiver
node_entry -->|"dispatches actions"| node_robot_controller
node_robot_controller -->|"uses protocol helpers"| node_protocol
node_robot_controller -->|"sends WebSocket commands"| node_esp32
node_entry -.->|"coordinates speech"| node_audio
node_dashboard_ui -.->|"uses dashboard API"| node_dashboard_server
node_dashboard_server -->|"dispatches robot actions"| node_robot_controller
node_dashboard_server -->|"requests synthesis"| node_audio
node_dashboard_server -->|"reads camera status"| node_vision_receiver
node_face -.->|"coordinates eyes"| node_eye
node_eye -.->|"draws geometry"| node_eye_drawer
node_face -.->|"coordinates behavior"| node_face_behavior
node_face -.->|"coordinates expressions"| node_face_expression
node_face -.->|"coordinates gaze"| node_look_assistant
node_face -.->|"uses animations"| node_animations

click node_entry "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/main.py"
click node_microphone "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/mic/controller.py"
click node_chat "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/chat/engine.py"
click node_parser "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/chat/parser.py"
click node_prompts "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/chat/prompts.py"
click node_vision_receiver "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/vision/receiver.py"
click node_frame_buffer "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/vision/frame_buffer.py"
click node_vlm "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/vision/vlm.py"
click node_robot_controller "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/robot/controller.py"
click node_protocol "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/robot/protocol.py"
click node_audio "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/audio/service.py"
click node_dashboard_server "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/dump/ui/server.py"
click node_dashboard_ui "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/dump/ui/static/app.js"
click node_face "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/Face.cpp"
click node_eye "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/Eye.cpp"
click node_eye_drawer "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/EyeDrawer.h"
click node_face_behavior "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/FaceBehavior.cpp"
click node_face_expression "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/FaceExpression.cpp"
click node_look_assistant "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/LookAssistant.cpp"
click node_animations "https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/Animations.h"

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_entry,node_microphone,node_user toneBlue
class node_chat,node_parser,node_prompts,node_vision_receiver,node_frame_buffer,node_vlm toneAmber
class node_robot_controller,node_protocol,node_audio toneMint
class node_dashboard_server,node_dashboard_ui toneRose
class node_face,node_eye,node_eye_drawer,node_face_behavior,node_face_expression,node_look_assistant,node_animations,node_ollama,node_camera,node_esp32 toneIndigo
```

## Components

### User Interaction

- [Application Orchestrator](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/main.py): `software/ikru/main.py`
- [Speech Input](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/mic/controller.py): `software/ikru/mic/controller.py`

### Conversation and Vision

- [Chat Engine](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/chat/engine.py): `software/ikru/chat/engine.py`
- [Response Parser](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/chat/parser.py): `software/ikru/chat/parser.py`
- [System Prompts](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/chat/prompts.py): `software/ikru/chat/prompts.py`
- [Camera Receiver](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/vision/receiver.py): `software/ikru/vision/receiver.py`
- [Latest Frame Buffer](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/vision/frame_buffer.py): `software/ikru/vision/frame_buffer.py`
- [Vision Model](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/vision/vlm.py): `software/ikru/vision/vlm.py`

### Robot I/O and Audio

- [Robot Controller](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/robot/controller.py): `software/ikru/robot/controller.py`
- [Robot Protocol](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/robot/protocol.py): `software/ikru/robot/protocol.py`
- [Speech Audio Service](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/software/ikru/audio/service.py): `software/ikru/audio/service.py`

### Dashboard

- [Dashboard API](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/dump/ui/server.py): `dump/ui/server.py`
- [Dashboard UI](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/dump/ui/static/app.js): `dump/ui/static/app.js`

### Firmware Face

- [Face Coordinator](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/Face.cpp): `firmware/controller/Face.cpp`
- [Eye Engine](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/Eye.cpp): `firmware/controller/Eye.cpp`
- [Eye Drawing](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/EyeDrawer.h): `firmware/controller/EyeDrawer.h`
- [Face Behavior](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/FaceBehavior.cpp): `firmware/controller/FaceBehavior.cpp`
- [Face Expressions](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/FaceExpression.cpp): `firmware/controller/FaceExpression.cpp`
- [Look Assistant](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/LookAssistant.cpp): `firmware/controller/LookAssistant.cpp`
- [Animation Primitives](https://github.com/ajsike2310/project-ikru-the-intelligent-kinematic-robot-/blob/main/firmware/controller/Animations.h): `firmware/controller/Animations.h`

### Other components

- **User**
- **Ollama LLM**
- **ESP32-CAM**
- **ESP32 Robot**

## Connections

- User → Application Orchestrator: provides input (evidence: `README.md`)
- Application Orchestrator → Speech Input: captures speech (evidence: `software/ikru/main.py`)
- Application Orchestrator → Chat Engine: sends prompt (evidence: `software/ikru/main.py`)
- Chat Engine → Ollama LLM: queries model (evidence: `software/ikru/chat/engine.py`)
- Chat Engine → Response Parser: parses response (evidence: `software/ikru/chat/engine.py`)
- Chat Engine → System Prompts: uses prompt (evidence: `software/ikru/chat/engine.py`)
- Application Orchestrator → Camera Receiver: starts receiver (evidence: `software/ikru/main.py`)
- Camera Receiver → Latest Frame Buffer: stores frames (evidence: `software/ikru/vision/receiver.py`)
- Application Orchestrator → Vision Model: requests visual reasoning (evidence: `software/ikru/main.py`)
- ESP32-CAM → Camera Receiver: streams frames (evidence: `README.md`)
- Application Orchestrator → Robot Controller: dispatches actions (evidence: `software/ikru/main.py`)
- Robot Controller → Robot Protocol: uses protocol helpers (evidence: `software/ikru/robot/controller.py`)
- Robot Controller → ESP32 Robot: sends WebSocket commands (evidence: `software/ikru/robot/controller.py`)
- Application Orchestrator → Speech Audio Service: coordinates speech
- Dashboard UI → Dashboard API: uses dashboard API
- Dashboard API → Robot Controller: dispatches robot actions (evidence: `dump/ui/server.py`)
- Dashboard API → Speech Audio Service: requests synthesis (evidence: `dump/ui/server.py`)
- Dashboard API → Camera Receiver: reads camera status (evidence: `dump/ui/server.py`)
- Face Coordinator → Eye Engine: coordinates eyes
- Eye Engine → Eye Drawing: draws geometry
- Face Coordinator → Face Behavior: coordinates behavior
- Face Coordinator → Face Expressions: coordinates expressions
- Face Coordinator → Look Assistant: coordinates gaze
- Face Coordinator → Animation Primitives: uses animations
