# guntrutirupathamma/kitty-voiceagent architecture

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

- Interactive diagram: https://gitdiagram.com/guntrutirupathamma/kitty-voiceagent
- Repository: https://github.com/guntrutirupathamma/kitty-voiceagent

## Overview

Kitty-VoiceAgent is a voice-enabled companion web app. Its server supports account identification, conversational AI with memory, speech generation, and bedtime stories; the service worker adds offline shell caching. The provided README gives only the product name, and the HTML client was not sampled, so client-to-endpoint wiring and some server internals are not represented. Dashed edges mark optional integrations documented in the server source.

Main entry points: [`sw.js`](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/sw.js) (Offline shell), [`voice_server.py`](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py) (AI replies), [`neko_chan_companion.html`](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/neko_chan_companion.html) (Companion app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web_app["Companion app"]
  node_offline["Offline shell<br/>[sw.js]"]
end

subgraph group_conversation["Conversation and memory"]
  node_ai_endpoint["AI replies<br/>[voice_server.py]"]
  node_memory_extractor["Memory extraction<br/>[voice_server.py]"]
end

subgraph group_media["Voice and stories"]
  node_speech["Speech generation<br/>[voice_server.py]"]
  node_bedtime["Bedtime stories<br/>[voice_server.py]"]
end

subgraph group_state["User state"]
  node_login["Account login<br/>[voice_server.py]"]
  node_memory_db[("SQLite memory<br/>[voice_server.py]")]
end

node_browser(("User"))
node_groq["Groq API"]
node_elevenlabs["ElevenLabs API"]

node_ai_endpoint -->|"requests replies"| node_groq
node_memory_extractor -->|"extracts memories"| node_groq
node_bedtime -->|"generates stories"| node_groq
node_login -->|"reads and writes"| node_memory_db
node_speech -.->|"proxies speech"| node_elevenlabs
node_offline -->|"caches shell"| node_web_app

click node_web_app "https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/neko_chan_companion.html"
click node_offline "https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/sw.js"
click node_ai_endpoint "https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py"
click node_memory_extractor "https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py"
click node_login "https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py"
click node_memory_db "https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py"
click node_speech "https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py"
click node_bedtime "https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.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_web_app,node_offline,node_browser toneBlue
class node_ai_endpoint,node_memory_extractor toneAmber
class node_speech,node_bedtime,node_groq,node_elevenlabs toneMint
class node_login,node_memory_db toneRose
```

## Components

### Web client

- [Companion app](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/neko_chan_companion.html): `neko_chan_companion.html`
- [Offline shell](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/sw.js): `sw.js`

### Conversation and memory

- [AI replies](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py): `voice_server.py`
- [Memory extraction](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py): `voice_server.py`

### Voice and stories

- [Speech generation](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py): `voice_server.py`
- [Bedtime stories](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py): `voice_server.py`

### User state

- [Account login](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py): `voice_server.py`
- [SQLite memory](https://github.com/guntrutirupathamma/kitty-voiceagent/blob/main/voice_server.py): `voice_server.py`

### Other components

- **User**
- **Groq API**
- **ElevenLabs API**

## Connections

- AI replies → Groq API: requests replies (evidence: `voice_server.py`)
- Memory extraction → Groq API: extracts memories (evidence: `voice_server.py`)
- Bedtime stories → Groq API: generates stories (evidence: `voice_server.py`)
- Account login → SQLite memory: reads and writes (evidence: `voice_server.py`)
- Speech generation → ElevenLabs API: proxies speech (evidence: `voice_server.py`)
- Offline shell → Companion app: caches shell (evidence: `sw.js`)
