# prajjwal5655-coder/omnimain architecture

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

- Interactive diagram: https://gitdiagram.com/prajjwal5655-coder/omnimain
- Repository: https://github.com/prajjwal5655-coder/omnimain

## Overview

OmniLearn AI is a browser-based STEM tutoring and accessibility workspace. A student opens the workspace, obtains LiveKit room credentials through the token API, and connects over WebRTC; the AI agent provides conversational tutoring while the browser presents voice/chat, whiteboard, code, and notes experiences. The README identifies OpenAI, Deepgram, and Cartesia as the agent’s AI services. Agent internals and the detailed wiring of several features were not sampled, so those relationships are shown only where documented, without inferring implementation details.

Main entry points: [`agent.py`](https://github.com/prajjwal5655-coder/omnimain/blob/main/agent.py) (Voice Agent Worker), [`static/app.js`](https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js) (OmniLearn Workspace), [`api/index.py`](https://github.com/prajjwal5655-coder/omnimain/blob/main/api/index.py) (Room Token API), [`server.py`](https://github.com/prajjwal5655-coder/omnimain/blob/main/server.py) (Web Server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Student Workspace"]
  node_browser["OmniLearn Workspace<br/>[app.js]"]
  node_voicechat["Voice and Chat<br/>[app.js]"]
  node_whiteboard["AI Whiteboard<br/>[app.js]"]
  node_codestudio["Code Studio<br/>[app.js]"]
  node_notes["Lecture Notes<br/>[app.js]"]
end

subgraph group_connection["Session Connection"]
  node_tokenapi["Room Token API<br/>[index.py]"]
  node_server["Web Server<br/>[server.py]"]
  node_livekit{{"LiveKit Cloud"}}
end

subgraph group_tutoring["AI Tutoring"]
  node_agent["Voice Agent Worker<br/>[agent.py]"]
  node_openai{{"OpenAI GPT-4.1-mini"}}
  node_deepgram{{"Deepgram Nova-3"}}
  node_cartesia{{"Cartesia Sonic-3"}}
end

node_student(("Student"))

node_student -->|"uses"| node_browser
node_browser -.->|"requests workspace"| node_server
node_server -.->|"serves token API"| node_tokenapi
node_browser -.->|"requests room token"| node_tokenapi
node_tokenapi -->|"signs room access"| node_livekit
node_browser -->|"joins WebRTC room"| node_livekit
node_agent -->|"connects worker"| node_livekit
node_student -->|"speaks or types"| node_voicechat
node_voicechat -.->|"sends interaction"| node_livekit
node_livekit -.->|"routes session"| node_agent
node_agent -->|"requests tutoring"| node_openai
node_agent -->|"transcribes speech"| node_deepgram
node_agent -->|"synthesizes speech"| node_cartesia
node_livekit -.->|"returns live audio"| node_voicechat
node_student -->|"draws problems"| node_whiteboard
node_whiteboard -.->|"submits drawing"| node_agent
node_agent -->|"draws solutions"| node_whiteboard
node_student -->|"edits code"| node_codestudio
node_student -->|"reviews lecture notes"| node_notes
node_agent -->|"extracts key points"| node_notes

click node_browser "https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js"
click node_voicechat "https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js"
click node_whiteboard "https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js"
click node_codestudio "https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js"
click node_notes "https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js"
click node_tokenapi "https://github.com/prajjwal5655-coder/omnimain/blob/main/api/index.py"
click node_server "https://github.com/prajjwal5655-coder/omnimain/blob/main/server.py"
click node_agent "https://github.com/prajjwal5655-coder/omnimain/blob/main/agent.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_browser,node_voicechat,node_whiteboard,node_codestudio,node_notes toneBlue
class node_tokenapi,node_server,node_livekit toneAmber
class node_agent,node_openai,node_deepgram,node_cartesia toneMint
class node_student toneIndigo
```

## Components

### Student Workspace

- [OmniLearn Workspace](https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js): `static/app.js`
- [Voice and Chat](https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js): `static/app.js`
- [AI Whiteboard](https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js): `static/app.js`
- [Code Studio](https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js): `static/app.js`
- [Lecture Notes](https://github.com/prajjwal5655-coder/omnimain/blob/main/static/app.js): `static/app.js`

### Session Connection

- [Room Token API](https://github.com/prajjwal5655-coder/omnimain/blob/main/api/index.py): `api/index.py`
- [Web Server](https://github.com/prajjwal5655-coder/omnimain/blob/main/server.py): `server.py`
- **LiveKit Cloud**

### AI Tutoring

- [Voice Agent Worker](https://github.com/prajjwal5655-coder/omnimain/blob/main/agent.py): `agent.py`
- **OpenAI GPT-4.1-mini**
- **Deepgram Nova-3**
- **Cartesia Sonic-3**

### Other components

- **Student**

## Connections

- Student → OmniLearn Workspace: uses (evidence: `README.md`)
- OmniLearn Workspace → Web Server: requests workspace
- Web Server → Room Token API: serves token API
- OmniLearn Workspace → Room Token API: requests room token
- Room Token API → LiveKit Cloud: signs room access (evidence: `api/index.py`)
- OmniLearn Workspace → LiveKit Cloud: joins WebRTC room (evidence: `README.md`)
- Voice Agent Worker → LiveKit Cloud: connects worker (evidence: `README.md`)
- Student → Voice and Chat: speaks or types (evidence: `README.md`)
- Voice and Chat → LiveKit Cloud: sends interaction
- LiveKit Cloud → Voice Agent Worker: routes session
- Voice Agent Worker → OpenAI GPT-4.1-mini: requests tutoring (evidence: `README.md`)
- Voice Agent Worker → Deepgram Nova-3: transcribes speech (evidence: `README.md`)
- Voice Agent Worker → Cartesia Sonic-3: synthesizes speech (evidence: `README.md`)
- LiveKit Cloud → Voice and Chat: returns live audio
- Student → AI Whiteboard: draws problems (evidence: `README.md`)
- AI Whiteboard → Voice Agent Worker: submits drawing
- Voice Agent Worker → AI Whiteboard: draws solutions (evidence: `README.md`)
- Student → Code Studio: edits code (evidence: `README.md`)
- Student → Lecture Notes: reviews lecture notes (evidence: `README.md`)
- Voice Agent Worker → Lecture Notes: extracts key points (evidence: `README.md`)
