# vjalaj/voxmind architecture

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

- Interactive diagram: https://gitdiagram.com/vjalaj/voxmind
- Repository: https://github.com/vjalaj/voxmind

## Overview

#### Purpose and Entry Points
VoxMind is a Python desktop voice assistant for Windows-oriented voice, keyboard, application, window, and screen-context control. The primary runtime is `main.py`, with voice and simulated-input modes. Alternate operational entry points expose daemon, interface, blackboard, and math workflows: `run_daemon.py`, `run_interface.py`, `run_blackboard.py`, and `run_math_app.py`.

#### Session Orchestration
The top-level assistant coordinates activation, continuous command handling, shutdown, and user-facing responses. Core runtime abstractions appear to separate the application-facing loop from extensible assistant services:
- `main.py`
- `core/voxmind.py`
- `core/voxmind_core.py`
- `core/voxmind_daemon.py`
- `config.py`

Control moves from wake activation to repeated transcription/command processing, until a shutdown intent ends the session. Daemon support is a boundary for long-running/background operation.

#### Voice Input and Wake Detection
Speech capture/transcription and wake-word recognition are independently implemented, allowing keyboard simulation to bypass microphone dependencies. Voice input ultimately produces text commands for downstream interpretation.
- `core/speech_services.py`
- `core/speech_to_text.py`
- `core/wake_word.py`
- `Jalaj/speech_recognition_service.py`
- `Tejas/wake_word_detector.py`

Material external services/dependencies include microphone/PyAudio-style capture, Google Web Speech recognition, and optional local speech components.

#### Language Understanding and Dispatch
Natural-language processing converts recognized text into intents and targets, then routes recognized commands toward system, input, visual, knowledge, or response functionality. Multiple parser implementations indicate an evolving/alternative parser layer rather than one isolated package.
- `core/natural_language_engine.py`
- `core/nl_target_resolver.py`
- `Priyapal/command_parser.py`
- `Sumant/advanced_command_parser.py`
- `Tejas/nlp_command_parser.py`

Unknown or informational input can cross the boundary into knowledge and response generation instead of OS command execution.

#### Desktop Automation and Platform Boundary
Desktop actions are concentrated in control modules and mediated by OS-specific platform adapters. This is the principal privileged boundary: parsed intents become application launches, window actions, mouse/keyboard input, and system controls.
- `core/app_control.py`
- `core/app_discovery.py`
- `core/input_control.py`
- `core/platform/base.py`
- `core/platform/windows.py`

The repository also includes Linux and macOS adapters (`core/platform/linux.py`, `core/platform/macos.py`), but README-described capabilities depend materially on Windows APIs, `pywin32`, and `psutil`.

#### Visual Context and Overlay Workflow
Screen-aware requests capture/analyze desktop state, perform OCR and spatial/semantic interpretation, and may feed resulting coordinates back into input control. Monitoring and overlays support continuous observation and precise visual interaction.
- `core/screen_context.py`
- `core/ocr_engine.py`
- `core/screen_monitor.py`
- `core/spatial_analyzer.py`
- `core/overlay_manager.py`

This layer depends on screen-capture facilities plus Tesseract or EasyOCR; it forms a safety-sensitive bridge from visible text/context to clicks.

#### Knowledge, Memory, Responses, and Observability
Non-action queries flow through knowledge adapters/engine and response logic. Memory, caches, performance analytics, and persistence retain context and improve repeated command handling.
- `core/knowledge_engine.py`
- `core/knowledge_adapters.py`
- `core/intelligent_response.py`
- `core/unified_memory.py`
- `core/command_cache.py`
- `core/performance_analytics.py`

Persisted local state is present in `data/jarvis_memory.db` and `data/learned_patterns.json`. TTS output is handled by speech services and contributor implementations such as `minakshi/text_to_speech.py`.

#### Optional Service/API Surface
A separate backend layer supplies HTTP-style application infrastructure—routing, health checks, rate limits, queueing, telemetry, timeouts, and circuit breaking—rather than being required for the local CLI loop.
- `backend/app.py`
- `backend/router.py`
- `backend/command_queue.py`
- `backend/health.py`
- `backend/telemetry.py`

Container deployment artifacts (`Dockerfile`, `docker-compose.yml`) support this broader service surface, while `interface/server.py` and `interface/blackboard/blackboard_server.py` provide optional interactive/UI endpoints.

Main entry points: [`core/voxmind.py`](https://github.com/vjalaj/voxmind/blob/main/core/voxmind.py) (Assistant coordinator), [`core/nl_target_resolver.py`](https://github.com/vjalaj/voxmind/blob/main/core/nl_target_resolver.py) (Target resolver), [`core/voxmind_core.py`](https://github.com/vjalaj/voxmind/blob/main/core/voxmind_core.py) (Core services), [`core/screen_context.py`](https://github.com/vjalaj/voxmind/blob/main/core/screen_context.py) (Screen context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Assistant Runtime"]
  node_entry["CLI entry point<br/>Python entry<br/>[main.py]"]
  node_alternate_entries["Alternate entry points<br/>Python entry<br/>[run_daemon.py]"]
  node_assistant["Assistant coordinator<br/>orchestrator<br/>[voxmind.py]"]
  node_assistant_core["Core services<br/>runtime core<br/>[voxmind_core.py]"]
  node_daemon["Background daemon<br/>daemon runtime<br/>[voxmind_daemon.py]"]
end

subgraph group_voice["Voice &amp; Language"]
  node_speech["Speech services<br/>voice I/O<br/>[speech_services.py]"]
  node_wake_word["Wake detection<br/>wake recognizer<br/>[wake_word.py]"]
  node_transcription["Speech-to-text<br/>transcriber<br/>[speech_to_text.py]"]
  node_nlu["Intent parsing<br/>NLU engine"]
  node_target_resolver["Target resolver<br/>NLU resolver"]
end

subgraph group_desktop["Desktop Control"]
  node_app_control["Application control<br/>desktop actions<br/>[app_control.py]"]
  node_input_control["Input control<br/>desktop actions<br/>[input_control.py]"]
  node_platform{{"Windows platform adapter<br/>OS adapter<br/>[windows.py]"}}
end

subgraph group_context["Visual Context"]
  node_screen_context["Screen context<br/>visual coordinator<br/>[screen_context.py]"]
  node_ocr["OCR engine<br/>screen text extraction<br/>[ocr_engine.py]"]
  node_spatial["Spatial analyzer<br/>visual interpreter"]
end

subgraph group_services["Knowledge &amp; Optional Services"]
  node_knowledge["Knowledge engine<br/>query engine"]
  node_memory[("Unified memory<br/>state store<br/>[unified_memory.py]")]
  node_backend["Optional backend API<br/>HTTP service<br/>[app.py]"]
  node_interface["Optional interface server<br/>interactive endpoint<br/>[server.py]"]
end

node_entry -->|"starts"| node_assistant
node_alternate_entries -.->|"runs workflows"| node_assistant
node_alternate_entries -->|"starts daemon"| node_daemon
node_daemon -->|"hosts"| node_assistant_core
node_assistant -->|"coordinates"| node_assistant_core
node_assistant -->|"waits for activation"| node_wake_word
node_wake_word -->|"activates capture"| node_speech
node_speech -->|"audio"| node_transcription
node_transcription -->|"command text"| node_nlu
node_nlu -->|"intent targets"| node_target_resolver
node_target_resolver -->|"app intents"| node_app_control
node_target_resolver -->|"input intents"| node_input_control
node_app_control -->|"OS operations"| node_platform
node_input_control -->|"system input"| node_platform
node_target_resolver -->|"screen-aware requests"| node_screen_context
node_screen_context -->|"extracts text"| node_ocr
node_screen_context -->|"analyzes layout"| node_spatial
node_spatial -->|"action coordinates"| node_input_control
node_target_resolver -->|"informational queries"| node_knowledge
node_knowledge -->|"response content"| node_assistant
node_assistant_core -->|"reads and records context"| node_memory
node_assistant -->|"spoken response"| node_speech
node_backend -.->|"optional service surface"| node_assistant_core
node_interface -.->|"interactive access"| node_backend

click node_entry "https://github.com/vjalaj/voxmind/blob/main/main.py"
click node_alternate_entries "https://github.com/vjalaj/voxmind/blob/main/run_daemon.py"
click node_assistant "https://github.com/vjalaj/voxmind/blob/main/core/voxmind.py"
click node_assistant_core "https://github.com/vjalaj/voxmind/blob/main/core/voxmind_core.py"
click node_daemon "https://github.com/vjalaj/voxmind/blob/main/core/voxmind_daemon.py"
click node_speech "https://github.com/vjalaj/voxmind/blob/main/core/speech_services.py"
click node_wake_word "https://github.com/vjalaj/voxmind/blob/main/core/wake_word.py"
click node_transcription "https://github.com/vjalaj/voxmind/blob/main/core/speech_to_text.py"
click node_nlu "https://github.com/vjalaj/voxmind/blob/main/core/natural_language_engine.py"
click node_target_resolver "https://github.com/vjalaj/voxmind/blob/main/core/nl_target_resolver.py"
click node_app_control "https://github.com/vjalaj/voxmind/blob/main/core/app_control.py"
click node_input_control "https://github.com/vjalaj/voxmind/blob/main/core/input_control.py"
click node_platform "https://github.com/vjalaj/voxmind/blob/main/core/platform/windows.py"
click node_screen_context "https://github.com/vjalaj/voxmind/blob/main/core/screen_context.py"
click node_ocr "https://github.com/vjalaj/voxmind/blob/main/core/ocr_engine.py"
click node_spatial "https://github.com/vjalaj/voxmind/blob/main/core/spatial_analyzer.py"
click node_knowledge "https://github.com/vjalaj/voxmind/blob/main/core/knowledge_engine.py"
click node_memory "https://github.com/vjalaj/voxmind/blob/main/core/unified_memory.py"
click node_backend "https://github.com/vjalaj/voxmind/blob/main/backend/app.py"
click node_interface "https://github.com/vjalaj/voxmind/blob/main/interface/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_entry,node_alternate_entries,node_assistant,node_assistant_core,node_daemon toneBlue
class node_speech,node_wake_word,node_transcription,node_nlu,node_target_resolver toneAmber
class node_app_control,node_input_control,node_platform toneMint
class node_screen_context,node_ocr,node_spatial toneRose
class node_knowledge,node_memory,node_backend,node_interface toneIndigo
```

## Components

### Assistant Runtime

- [CLI entry point](https://github.com/vjalaj/voxmind/blob/main/main.py): Python entry · Runs voice or simulated-input sessions. · `main.py`
- [Alternate entry points](https://github.com/vjalaj/voxmind/blob/main/run_daemon.py): Python entry · Daemon, interface, blackboard, and math workflows. · `run_daemon.py`
- [Assistant coordinator](https://github.com/vjalaj/voxmind/blob/main/core/voxmind.py): orchestrator · Owns activation, command loop, shutdown, and user responses. · `core/voxmind.py`
- [Core services](https://github.com/vjalaj/voxmind/blob/main/core/voxmind_core.py): runtime core · `core/voxmind_core.py`
- [Background daemon](https://github.com/vjalaj/voxmind/blob/main/core/voxmind_daemon.py): daemon runtime · `core/voxmind_daemon.py`

### Voice & Language

- [Speech services](https://github.com/vjalaj/voxmind/blob/main/core/speech_services.py): voice I/O · Captures speech and produces spoken output. · `core/speech_services.py`
- [Wake detection](https://github.com/vjalaj/voxmind/blob/main/core/wake_word.py): wake recognizer · `core/wake_word.py`
- [Speech-to-text](https://github.com/vjalaj/voxmind/blob/main/core/speech_to_text.py): transcriber · Turns microphone audio into command text. · `core/speech_to_text.py`
- [Intent parsing](https://github.com/vjalaj/voxmind/blob/main/core/natural_language_engine.py): NLU engine · Converts command text into intents and targets. · `core/natural_language_engine.py`
- [Target resolver](https://github.com/vjalaj/voxmind/blob/main/core/nl_target_resolver.py): NLU resolver · `core/nl_target_resolver.py`

### Desktop Control

- [Application control](https://github.com/vjalaj/voxmind/blob/main/core/app_control.py): desktop actions · Launches and manages desktop applications. · `core/app_control.py`
- [Input control](https://github.com/vjalaj/voxmind/blob/main/core/input_control.py): desktop actions · Executes mouse and keyboard actions. · `core/input_control.py`
- [Windows platform adapter](https://github.com/vjalaj/voxmind/blob/main/core/platform/windows.py): OS adapter · Privileged Windows API boundary for system and window control. · `core/platform/windows.py`

### Visual Context

- [Screen context](https://github.com/vjalaj/voxmind/blob/main/core/screen_context.py): visual coordinator · Builds actionable context from the desktop display. · `core/screen_context.py`
- [OCR engine](https://github.com/vjalaj/voxmind/blob/main/core/ocr_engine.py): screen text extraction · `core/ocr_engine.py`
- [Spatial analyzer](https://github.com/vjalaj/voxmind/blob/main/core/spatial_analyzer.py): visual interpreter · Derives locations and semantics for visual interaction. · `core/spatial_analyzer.py`

### Knowledge & Optional Services

- [Knowledge engine](https://github.com/vjalaj/voxmind/blob/main/core/knowledge_engine.py): query engine · Handles non-action and informational requests. · `core/knowledge_engine.py`
- [Unified memory](https://github.com/vjalaj/voxmind/blob/main/core/unified_memory.py): state store · Retains context and learned local state. · `core/unified_memory.py`
- [Optional backend API](https://github.com/vjalaj/voxmind/blob/main/backend/app.py): HTTP service · Provides routing, health, queueing, telemetry, and resilience infrastructure. · `backend/app.py`
- [Optional interface server](https://github.com/vjalaj/voxmind/blob/main/interface/server.py): interactive endpoint · `interface/server.py`

## Connections

- CLI entry point → Assistant coordinator: starts
- Alternate entry points → Assistant coordinator: runs workflows
- Alternate entry points → Background daemon: starts daemon
- Background daemon → Core services: hosts
- Assistant coordinator → Core services: coordinates
- Assistant coordinator → Wake detection: waits for activation
- Wake detection → Speech services: activates capture
- Speech services → Speech-to-text: audio
- Speech-to-text → Intent parsing: command text
- Intent parsing → Target resolver: intent targets
- Target resolver → Application control: app intents
- Target resolver → Input control: input intents
- Application control → Windows platform adapter: OS operations
- Input control → Windows platform adapter: system input
- Target resolver → Screen context: screen-aware requests
- Screen context → OCR engine: extracts text
- Screen context → Spatial analyzer: analyzes layout
- Spatial analyzer → Input control: action coordinates · Visual interpretation can drive precise input.
- Target resolver → Knowledge engine: informational queries
- Knowledge engine → Assistant coordinator: response content
- Core services → Unified memory: reads and records context
- Assistant coordinator → Speech services: spoken response
- Optional backend API → Core services: optional service surface
- Optional interface server → Optional backend API: interactive access
