# ravindra-y/athena-live architecture

> Architecture diagram of the GitHub repository ravindra-y/athena-live, 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/ravindra-y/athena-live
- Repository: https://github.com/ravindra-y/athena-live

## Overview

Athena is a browser-based, full-duplex voice assistant. A user starts a session in the frontend, which streams microphone audio over WebSocket to the FastAPI bridge; the bridge runs the ADK agent against Gemini Live and relays audio, transcripts, tool actions, and results back to the UI. The agent supports Google Cloud help, Socratic learning, resource links, browser control, and generated visuals. The GCP and learning tools shown are placeholder responses, not live integrations. Edges reflect README statements and the supplied source/index; unsampled implementation details are omitted.

Main entry points: [`athena/server.py`](https://github.com/ravindra-y/athena-live/blob/main/athena/server.py) (WebSocket bridge), [`athena/agent.py`](https://github.com/ravindra-y/athena-live/blob/main/athena/agent.py) (ADK agent), [`athena/tools.py`](https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py) (Assistant tools), [`athena/visuals.py`](https://github.com/ravindra-y/athena-live/blob/main/athena/visuals.py) (Visual generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_frontend["Voice and UI client<br/>[main.js]"]
  node_pcm["PCM worklet<br/>[pcm-processor.js]"]
end

subgraph group_bridge["Live session bridge"]
  node_server["WebSocket bridge<br/>[server.py]"]
end

subgraph group_assistant["Assistant capabilities"]
  node_agent["ADK agent<br/>[agent.py]"]
  node_persona["Assistant persona<br/>[persona.py]"]
  node_tools["Assistant tools<br/>[tools.py]"]
  node_gcp["GCP assistance<br/>[tools.py]"]
  node_learning["Learning tutor<br/>[tools.py]"]
  node_links["Resource links<br/>[tools.py]"]
end

subgraph group_visuals["Visual generation"]
  node_visual_tool["Visual tool<br/>[tools.py]"]
  node_visual_gen["Visual generation<br/>[visuals.py]"]
  node_generated[("Generated assets<br/>[visuals.py]")]
end

subgraph group_browser["Browser control"]
  node_browser_tools["Browser actions<br/>[browser_tools.py]"]
end

node_user(("User"))
node_gemini{{"Gemini Live API"}}
node_image_models{{"Gemini image models"}}
node_pollinations{{"Pollinations image service"}}
node_web(("Websites and search"))

node_user -->|"speaks to"| node_frontend
node_frontend -->|"loads worklet"| node_pcm
node_frontend -->|"streams audio"| node_server
node_server -->|"relays events"| node_frontend
node_server -->|"runs agent"| node_agent
node_agent -->|"streams requests"| node_gemini
node_agent -->|"uses instructions"| node_persona
node_agent -->|"registers tools"| node_tools
node_agent -->|"registers actions"| node_browser_tools
node_tools -->|"provides"| node_gcp
node_tools -->|"provides"| node_learning
node_tools -->|"provides"| node_links
node_tools -->|"provides"| node_visual_tool
node_visual_tool -->|"generates"| node_visual_gen
node_server -->|"delivers results"| node_visual_gen
node_visual_gen -->|"saves assets"| node_generated
node_visual_gen -->|"tries image models"| node_image_models
node_visual_gen -->|"tries fallback"| node_pollinations
node_browser_tools -->|"browses pages"| node_web
node_server -->|"closes browser"| node_browser_tools

click node_frontend "https://github.com/ravindra-y/athena-live/blob/main/frontend/main.js"
click node_pcm "https://github.com/ravindra-y/athena-live/blob/main/frontend/pcm-processor.js"
click node_server "https://github.com/ravindra-y/athena-live/blob/main/athena/server.py"
click node_agent "https://github.com/ravindra-y/athena-live/blob/main/athena/agent.py"
click node_persona "https://github.com/ravindra-y/athena-live/blob/main/athena/persona.py"
click node_tools "https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py"
click node_gcp "https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py"
click node_learning "https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py"
click node_links "https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py"
click node_browser_tools "https://github.com/ravindra-y/athena-live/blob/main/athena/browser_tools.py"
click node_visual_tool "https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py"
click node_visual_gen "https://github.com/ravindra-y/athena-live/blob/main/athena/visuals.py"
click node_generated "https://github.com/ravindra-y/athena-live/blob/main/athena/visuals.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_frontend,node_pcm,node_user toneBlue
class node_server toneAmber
class node_agent,node_persona,node_tools,node_gcp,node_learning,node_links,node_gemini toneMint
class node_visual_tool,node_visual_gen,node_generated toneRose
class node_browser_tools,node_image_models,node_pollinations,node_web toneIndigo
```

## Components

### Browser client

- [Voice and UI client](https://github.com/ravindra-y/athena-live/blob/main/frontend/main.js): `frontend/main.js`
- [PCM worklet](https://github.com/ravindra-y/athena-live/blob/main/frontend/pcm-processor.js): `frontend/pcm-processor.js`

### Live session bridge

- [WebSocket bridge](https://github.com/ravindra-y/athena-live/blob/main/athena/server.py): `athena/server.py`

### Assistant capabilities

- [ADK agent](https://github.com/ravindra-y/athena-live/blob/main/athena/agent.py): `athena/agent.py`
- [Assistant persona](https://github.com/ravindra-y/athena-live/blob/main/athena/persona.py): `athena/persona.py`
- [Assistant tools](https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py): `athena/tools.py`
- [GCP assistance](https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py): `athena/tools.py`
- [Learning tutor](https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py): `athena/tools.py`
- [Resource links](https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py): `athena/tools.py`

### Visual generation

- [Visual tool](https://github.com/ravindra-y/athena-live/blob/main/athena/tools.py): `athena/tools.py`
- [Visual generation](https://github.com/ravindra-y/athena-live/blob/main/athena/visuals.py): `athena/visuals.py`
- [Generated assets](https://github.com/ravindra-y/athena-live/blob/main/athena/visuals.py): `athena/visuals.py`

### Browser control

- [Browser actions](https://github.com/ravindra-y/athena-live/blob/main/athena/browser_tools.py): `athena/browser_tools.py`

### Other components

- **User**
- **Gemini Live API**
- **Gemini image models**
- **Pollinations image service**
- **Websites and search**

## Connections

- User → Voice and UI client: speaks to (evidence: `README.md`)
- Voice and UI client → PCM worklet: loads worklet (evidence: `frontend/main.js`)
- Voice and UI client → WebSocket bridge: streams audio (evidence: `README.md`)
- WebSocket bridge → Voice and UI client: relays events (evidence: `athena/server.py`)
- WebSocket bridge → ADK agent: runs agent (evidence: `athena/server.py`)
- ADK agent → Gemini Live API: streams requests (evidence: `README.md`)
- ADK agent → Assistant persona: uses instructions (evidence: `athena/agent.py`)
- ADK agent → Assistant tools: registers tools (evidence: `athena/agent.py`)
- ADK agent → Browser actions: registers actions (evidence: `athena/agent.py`)
- Assistant tools → GCP assistance: provides (evidence: `athena/tools.py`)
- Assistant tools → Learning tutor: provides (evidence: `athena/tools.py`)
- Assistant tools → Resource links: provides (evidence: `athena/tools.py`)
- Assistant tools → Visual tool: provides (evidence: `athena/tools.py`)
- Visual tool → Visual generation: generates (evidence: `athena/tools.py`)
- WebSocket bridge → Visual generation: delivers results (evidence: `athena/server.py`)
- Visual generation → Generated assets: saves assets (evidence: `athena/visuals.py`)
- Visual generation → Gemini image models: tries image models (evidence: `athena/visuals.py`)
- Visual generation → Pollinations image service: tries fallback (evidence: `athena/visuals.py`)
- Browser actions → Websites and search: browses pages (evidence: `athena/browser_tools.py`)
- WebSocket bridge → Browser actions: closes browser (evidence: `athena/server.py`)
