# prajjwal5655-coder/omni-ai-2 architecture

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

- Interactive diagram: https://gitdiagram.com/prajjwal5655-coder/omni-ai-2
- Repository: https://github.com/prajjwal5655-coder/omni-ai-2

## Overview

Nova is a browser-based real-time voice assistant. A user opens the web client, requests a LiveKit room token from the aiohttp server, and connects to LiveKit; the agent joins that room to handle speech, conversation, and spoken responses. The client also supports text chat, captions, transcript display, microphone controls, and audio visualization. The tree lists static assets as root files, while the README documents them under static/; paths below follow the supplied tree. External AI providers are documented but their runtime internals are not shown.

Main entry points: [`app.js`](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/app.js) (Voice client), [`agent.py`](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py) (Voice session), [`server.py`](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/server.py) (HTTP server), [`index.html`](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/index.html) (Assistant interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_client["Voice client<br/>[app.js]"]
  node_frontend["Assistant interface<br/>[index.html]"]
  node_styles["Visual design<br/>[style.css]"]
  node_visualizer["Audio visualizer<br/>[app.js]"]
  node_captions["Captions and transcript<br/>[app.js]"]
end

subgraph group_backend["Web backend"]
  node_webserver["HTTP server<br/>[server.py]"]
  node_token["Token generation<br/>[server.py]"]
end

subgraph group_voice["Voice agent"]
  node_worker["Agent worker<br/>[agent.py]"]
  node_session["Voice session<br/>[agent.py]"]
  node_nova["Nova assistant<br/>[agent.py]"]
  node_speech["Speech recognition<br/>[agent.py]"]
  node_language["Language model<br/>[agent.py]"]
  node_synthesis["Speech synthesis<br/>[agent.py]"]
end

node_user(("User"))
node_livekit["LiveKit service"]
node_deepgram["Deepgram"]
node_openai["OpenAI"]
node_cartesia["Cartesia"]

node_user -->|"uses"| node_client
node_client -.->|"renders"| node_frontend
node_frontend -.->|"uses styles"| node_styles
node_client -.->|"requests status"| node_webserver
node_client -->|"requests token"| node_token
node_webserver -->|"routes to"| node_token
node_webserver -->|"serves"| node_frontend
node_token -->|"signs room grant"| node_livekit
node_client -->|"connects and publishes"| node_livekit
node_livekit -->|"dispatches room job"| node_worker
node_worker -->|"starts"| node_session
node_session -->|"runs"| node_nova
node_session -->|"configures"| node_speech
node_session -->|"configures"| node_language
node_session -->|"configures"| node_synthesis
node_speech -->|"uses"| node_deepgram
node_language -->|"uses"| node_openai
node_synthesis -->|"uses"| node_cartesia
node_client -->|"updates"| node_captions
node_client -->|"sets up"| node_visualizer
node_livekit -->|"delivers transcription and audio"| node_client
node_client -->|"publishes chat data"| node_livekit
node_livekit -->|"delivers chat data"| node_session

click node_client "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/app.js"
click node_frontend "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/index.html"
click node_styles "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/style.css"
click node_visualizer "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/app.js"
click node_captions "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/app.js"
click node_webserver "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/server.py"
click node_token "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/server.py"
click node_worker "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py"
click node_session "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py"
click node_nova "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py"
click node_speech "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py"
click node_language "https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py"
click node_synthesis "https://github.com/prajjwal5655-coder/omni-ai-2/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_client,node_frontend,node_styles,node_visualizer,node_captions,node_user toneBlue
class node_webserver,node_token toneAmber
class node_worker,node_session,node_nova,node_speech,node_language,node_synthesis toneMint
class node_livekit,node_deepgram,node_openai,node_cartesia toneIndigo
```

## Components

### Web client

- [Voice client](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/app.js): `app.js`
- [Assistant interface](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/index.html): `index.html`
- [Visual design](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/style.css): `style.css`
- [Audio visualizer](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/app.js): `app.js`
- [Captions and transcript](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/app.js): `app.js`

### Web backend

- [HTTP server](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/server.py): `server.py`
- [Token generation](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/server.py): `server.py`

### Voice agent

- [Agent worker](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py): `agent.py`
- [Voice session](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py): `agent.py`
- [Nova assistant](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py): `agent.py`
- [Speech recognition](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py): `agent.py`
- [Language model](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py): `agent.py`
- [Speech synthesis](https://github.com/prajjwal5655-coder/omni-ai-2/blob/main/agent.py): `agent.py`

### Other components

- **User**
- **LiveKit service**
- **Deepgram**
- **OpenAI**
- **Cartesia**

## Connections

- User → Voice client: uses (evidence: `README.md`)
- Voice client → Assistant interface: renders
- Assistant interface → Visual design: uses styles
- Voice client → HTTP server: requests status
- Voice client → Token generation: requests token (evidence: `app.js`)
- HTTP server → Token generation: routes to (evidence: `server.py`)
- HTTP server → Assistant interface: serves (evidence: `server.py`)
- Token generation → LiveKit service: signs room grant (evidence: `server.py`)
- Voice client → LiveKit service: connects and publishes (evidence: `app.js`)
- LiveKit service → Agent worker: dispatches room job (evidence: `README.md`)
- Agent worker → Voice session: starts (evidence: `agent.py`)
- Voice session → Nova assistant: runs (evidence: `agent.py`)
- Voice session → Speech recognition: configures (evidence: `agent.py`)
- Voice session → Language model: configures (evidence: `agent.py`)
- Voice session → Speech synthesis: configures (evidence: `agent.py`)
- Speech recognition → Deepgram: uses (evidence: `agent.py`)
- Language model → OpenAI: uses (evidence: `agent.py`)
- Speech synthesis → Cartesia: uses (evidence: `agent.py`)
- Voice client → Captions and transcript: updates (evidence: `app.js`)
- Voice client → Audio visualizer: sets up (evidence: `app.js`)
- LiveKit service → Voice client: delivers transcription and audio (evidence: `app.js`)
- Voice client → LiveKit service: publishes chat data (evidence: `app.js`)
- LiveKit service → Voice session: delivers chat data (evidence: `agent.py`)
