# ashishkumar4738/ps4 architecture

> Architecture diagram of the GitHub repository ashishkumar4738/ps4, 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/ashishkumar4738/ps4
- Repository: https://github.com/ashishkumar4738/ps4

## Overview

Nova is a local voice-and-terminal AI assistant. Its principal voice workflow captures speech, transcribes it, sends recognized commands through the Nova agent for model reasoning and tool execution, then displays or speaks a response; meeting transcripts are persisted along the way. Separate capabilities include searchable meeting history, document ingestion and summaries, web/news search, date/time lookup, and conversation logging. Edges rely on the README and SOURCE INDEX references; unsampled implementations are represented only where those sources establish the subsystem or relationship.

Main entry points: [`agent/nova_agent.py`](https://github.com/ashishkumar4738/ps4/blob/main/agent/nova_agent.py) (Nova agent), [`main.py`](https://github.com/ashishkumar4738/ps4/blob/main/main.py) (Application entry), [`transcription/worker.py`](https://github.com/ashishkumar4738/ps4/blob/main/transcription/worker.py) (Transcription workers), [`database/connection.py`](https://github.com/ashishkumar4738/ps4/blob/main/database/connection.py) (SQLite connection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_voice["Voice Input"]
  node_recorder["Audio recorder<br/>[recorder.py]"]
  node_wake["Wake detection<br/>[wake_word.py]"]
  node_transcription["Transcription workers<br/>[worker.py]"]
  node_whisper["Whisper transcription<br/>[whisper.py]"]
  node_tts["Voice output<br/>[tts.py]"]
  node_audio_control["Audio controls<br/>[control.py]"]
end

subgraph group_assistant["Assistant Runtime"]
  node_main["Application entry<br/>[main.py]"]
  node_listener["Nova listener<br/>[nova_listener.py]"]
  node_agent["Nova agent<br/>[nova_agent.py]"]
  node_registry["Tool registry<br/>[tools.py]"]
end

subgraph group_capabilities["Assistant Capabilities"]
  node_meeting_tools["Meeting tools<br/>[nova_tools.py]"]
  node_web_search["Web search<br/>[search.py]"]
  node_web_agent["Web agent<br/>[agent.py]"]
  node_time["Date and time<br/>[time_tools.py]"]
  node_meeting["Meeting manager<br/>[manager.py]"]
  node_doc_watcher["Document watcher<br/>[watcher.py]"]
  node_doc_parser["Document parser<br/>[parser.py]"]
  node_doc_summary["Document summarizer<br/>[summarizer.py]"]
  node_internet["Internet control"]
end

subgraph group_state["Persistence and Operations"]
  node_doc_store["Document store<br/>[document_store.py]"]
  node_conversation_store["Conversation store"]
  node_schema["Database schema<br/>[schema.py]"]
  node_connection["SQLite connection<br/>[connection.py]"]
  node_database[("Nova database<br/>[nova.db]")]
  node_logging["Logging<br/>[logger_config.py]"]
end

node_user(("User"))
node_microphone(("Microphone"))
node_ollama["Ollama model"]

node_user -->|"speaks to"| node_microphone
node_microphone -->|"captures audio"| node_recorder
node_main -->|"starts"| node_recorder
node_main -->|"starts"| node_transcription
node_main -->|"creates"| node_meeting
node_main -->|"launches"| node_doc_watcher
node_recorder -->|"checks wake phrase"| node_wake
node_recorder -->|"queues segments"| node_transcription
node_transcription -->|"transcribes"| node_whisper
node_transcription -->|"dispatches commands"| node_listener
node_transcription -->|"adds segments"| node_meeting
node_transcription -->|"speaks response"| node_tts
node_listener -->|"submits command"| node_agent
node_agent -->|"requests reasoning"| node_ollama
node_agent -->|"uses tool definitions"| node_registry
node_agent -->|"dispatches meeting tools"| node_meeting_tools
node_agent -->|"calls search"| node_web_search
node_agent -->|"calls time tool"| node_time
node_agent -->|"logs events"| node_conversation_store
node_agent -.->|"returns for speech"| node_tts
node_web_agent -->|"uses search"| node_web_search
node_web_search -->|"checks access"| node_internet
node_meeting_tools -->|"queries transcripts"| node_connection
node_meeting -->|"initializes schema"| node_schema
node_meeting -->|"writes meeting data"| node_connection
node_doc_watcher -->|"parses files"| node_doc_parser
node_doc_watcher -->|"summarizes files"| node_doc_summary
node_doc_watcher -->|"saves documents"| node_doc_store
node_doc_store -->|"reads and writes"| node_connection
node_schema -->|"creates tables"| node_connection
node_conversation_store -->|"stores events"| node_connection
node_connection -->|"connects to"| node_database
node_tts -->|"controls output"| node_audio_control
node_main -->|"starts toggle"| node_internet
node_main -->|"records activity"| node_logging

click node_main "https://github.com/ashishkumar4738/ps4/blob/main/main.py"
click node_recorder "https://github.com/ashishkumar4738/ps4/blob/main/audio/recorder.py"
click node_wake "https://github.com/ashishkumar4738/ps4/blob/main/agent/wake_word.py"
click node_transcription "https://github.com/ashishkumar4738/ps4/blob/main/transcription/worker.py"
click node_whisper "https://github.com/ashishkumar4738/ps4/blob/main/transcription/whisper.py"
click node_listener "https://github.com/ashishkumar4738/ps4/blob/main/agent/nova_listener.py"
click node_agent "https://github.com/ashishkumar4738/ps4/blob/main/agent/nova_agent.py"
click node_registry "https://github.com/ashishkumar4738/ps4/blob/main/agent/tools.py"
click node_meeting_tools "https://github.com/ashishkumar4738/ps4/blob/main/agent/nova_tools.py"
click node_web_search "https://github.com/ashishkumar4738/ps4/blob/main/web/search.py"
click node_web_agent "https://github.com/ashishkumar4738/ps4/blob/main/web/agent.py"
click node_time "https://github.com/ashishkumar4738/ps4/blob/main/time_tools.py"
click node_meeting "https://github.com/ashishkumar4738/ps4/blob/main/meeting/manager.py"
click node_doc_watcher "https://github.com/ashishkumar4738/ps4/blob/main/documents/watcher.py"
click node_doc_parser "https://github.com/ashishkumar4738/ps4/blob/main/documents/parser.py"
click node_doc_summary "https://github.com/ashishkumar4738/ps4/blob/main/documents/summarizer.py"
click node_doc_store "https://github.com/ashishkumar4738/ps4/blob/main/documents/document_store.py"
click node_conversation_store "https://github.com/ashishkumar4738/ps4/blob/main/database/conversation_store.py"
click node_schema "https://github.com/ashishkumar4738/ps4/blob/main/database/schema.py"
click node_connection "https://github.com/ashishkumar4738/ps4/blob/main/database/connection.py"
click node_database "https://github.com/ashishkumar4738/ps4/blob/main/data/nova.db"
click node_tts "https://github.com/ashishkumar4738/ps4/blob/main/tts.py"
click node_audio_control "https://github.com/ashishkumar4738/ps4/blob/main/audio/control.py"
click node_logging "https://github.com/ashishkumar4738/ps4/blob/main/logger_config.py"
click node_internet "https://github.com/ashishkumar4738/ps4/blob/main/internet_control.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_recorder,node_wake,node_transcription,node_whisper,node_tts,node_audio_control,node_user toneBlue
class node_main,node_listener,node_agent,node_registry toneAmber
class node_meeting_tools,node_web_search,node_web_agent,node_time,node_meeting,node_doc_watcher,node_doc_parser,node_doc_summary,node_internet toneMint
class node_doc_store,node_conversation_store,node_schema,node_connection,node_database,node_logging toneRose
class node_microphone,node_ollama toneIndigo
```

## Components

### Voice Input

- [Audio recorder](https://github.com/ashishkumar4738/ps4/blob/main/audio/recorder.py): `audio/recorder.py`
- [Wake detection](https://github.com/ashishkumar4738/ps4/blob/main/agent/wake_word.py): `agent/wake_word.py`
- [Transcription workers](https://github.com/ashishkumar4738/ps4/blob/main/transcription/worker.py): `transcription/worker.py`
- [Whisper transcription](https://github.com/ashishkumar4738/ps4/blob/main/transcription/whisper.py): `transcription/whisper.py`
- [Voice output](https://github.com/ashishkumar4738/ps4/blob/main/tts.py): `tts.py`
- [Audio controls](https://github.com/ashishkumar4738/ps4/blob/main/audio/control.py): `audio/control.py`

### Assistant Runtime

- [Application entry](https://github.com/ashishkumar4738/ps4/blob/main/main.py): `main.py`
- [Nova listener](https://github.com/ashishkumar4738/ps4/blob/main/agent/nova_listener.py): `agent/nova_listener.py`
- [Nova agent](https://github.com/ashishkumar4738/ps4/blob/main/agent/nova_agent.py): `agent/nova_agent.py`
- [Tool registry](https://github.com/ashishkumar4738/ps4/blob/main/agent/tools.py): `agent/tools.py`

### Assistant Capabilities

- [Meeting tools](https://github.com/ashishkumar4738/ps4/blob/main/agent/nova_tools.py): `agent/nova_tools.py`
- [Web search](https://github.com/ashishkumar4738/ps4/blob/main/web/search.py): `web/search.py`
- [Web agent](https://github.com/ashishkumar4738/ps4/blob/main/web/agent.py): `web/agent.py`
- [Date and time](https://github.com/ashishkumar4738/ps4/blob/main/time_tools.py): `time_tools.py`
- [Meeting manager](https://github.com/ashishkumar4738/ps4/blob/main/meeting/manager.py): `meeting/manager.py`
- [Document watcher](https://github.com/ashishkumar4738/ps4/blob/main/documents/watcher.py): `documents/watcher.py`
- [Document parser](https://github.com/ashishkumar4738/ps4/blob/main/documents/parser.py): `documents/parser.py`
- [Document summarizer](https://github.com/ashishkumar4738/ps4/blob/main/documents/summarizer.py): `documents/summarizer.py`
- [Internet control](https://github.com/ashishkumar4738/ps4/blob/main/internet_control.py): `internet_control.py`

### Persistence and Operations

- [Document store](https://github.com/ashishkumar4738/ps4/blob/main/documents/document_store.py): `documents/document_store.py`
- [Conversation store](https://github.com/ashishkumar4738/ps4/blob/main/database/conversation_store.py): `database/conversation_store.py`
- [Database schema](https://github.com/ashishkumar4738/ps4/blob/main/database/schema.py): `database/schema.py`
- [SQLite connection](https://github.com/ashishkumar4738/ps4/blob/main/database/connection.py): `database/connection.py`
- [Nova database](https://github.com/ashishkumar4738/ps4/blob/main/data/nova.db): `data/nova.db`
- [Logging](https://github.com/ashishkumar4738/ps4/blob/main/logger_config.py): `logger_config.py`

### Other components

- **User**
- **Microphone**
- **Ollama model**

## Connections

- User → Microphone: speaks to (evidence: `README.md`)
- Microphone → Audio recorder: captures audio (evidence: `README.md`)
- Application entry → Audio recorder: starts (evidence: `main.py`)
- Application entry → Transcription workers: starts (evidence: `main.py`)
- Application entry → Meeting manager: creates (evidence: `main.py`)
- Application entry → Document watcher: launches (evidence: `main.py`)
- Audio recorder → Wake detection: checks wake phrase (evidence: `audio/recorder.py`)
- Audio recorder → Transcription workers: queues segments (evidence: `main.py`)
- Transcription workers → Whisper transcription: transcribes (evidence: `transcription/worker.py`)
- Transcription workers → Nova listener: dispatches commands (evidence: `transcription/worker.py`)
- Transcription workers → Meeting manager: adds segments (evidence: `transcription/worker.py`)
- Transcription workers → Voice output: speaks response (evidence: `transcription/worker.py`)
- Nova listener → Nova agent: submits command (evidence: `agent/nova_listener.py`)
- Nova agent → Ollama model: requests reasoning (evidence: `README.md`)
- Nova agent → Tool registry: uses tool definitions (evidence: `agent/nova_agent.py`)
- Nova agent → Meeting tools: dispatches meeting tools (evidence: `agent/nova_agent.py`)
- Nova agent → Web search: calls search (evidence: `agent/nova_agent.py`)
- Nova agent → Date and time: calls time tool (evidence: `agent/nova_agent.py`)
- Nova agent → Conversation store: logs events (evidence: `agent/nova_agent.py`)
- Nova agent → Voice output: returns for speech
- Web agent → Web search: uses search (evidence: `web/agent.py`)
- Web search → Internet control: checks access (evidence: `web/search.py`)
- Meeting tools → SQLite connection: queries transcripts (evidence: `agent/nova_tools.py`)
- Meeting manager → Database schema: initializes schema (evidence: `meeting/manager.py`)
- Meeting manager → SQLite connection: writes meeting data (evidence: `meeting/manager.py`)
- Document watcher → Document parser: parses files (evidence: `documents/watcher.py`)
- Document watcher → Document summarizer: summarizes files (evidence: `documents/watcher.py`)
- Document watcher → Document store: saves documents (evidence: `documents/watcher.py`)
- Document store → SQLite connection: reads and writes (evidence: `documents/document_store.py`)
- Database schema → SQLite connection: creates tables (evidence: `database/schema.py`)
- Conversation store → SQLite connection: stores events (evidence: `database/conversation_store.py`)
- SQLite connection → Nova database: connects to (evidence: `database/connection.py`)
- Voice output → Audio controls: controls output (evidence: `tts.py`)
- Application entry → Internet control: starts toggle (evidence: `main.py`)
- Application entry → Logging: records activity (evidence: `main.py`)
