# tarigopullasathwik/anju_ai architecture

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

- Interactive diagram: https://gitdiagram.com/tarigopullasathwik/anju_ai
- Repository: https://github.com/tarigopullasathwik/anju_ai

## Overview

Anju AI is a desktop-oriented conversational assistant with a Flask/WebSocket dashboard, voice and file capabilities, persistent memory, and actionable tools. The main workflow is user input through the dashboard to the assistant brain, which can answer or plan multi-step work and dispatch actions. Memory supports personalized context; tools cover search, file/document, image, camera, code, phone, and system tasks. The excerpts establish the main entry point, workflow routing, plugin fallback, memory persistence, and model client; links among unsampled subsystems are intentionally limited.

Main entry points: [`brain/workflow_engine.py`](https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/workflow_engine.py) (Workflow Engine), [`brain/brain.py`](https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/brain.py) (Conversation Brain), [`tools/plugin_manager.py`](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/plugin_manager.py) (Plugin Manager), [`main.py`](https://github.com/tarigopullasathwik/anju_ai/blob/master/main.py) (Assistant Runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User Interaction"]
  node_dashboard["Web Dashboard<br/>[ui_dashboard.py]"]
  node_assistant["Assistant Runtime<br/>[main.py]"]
  node_voice_input["Voice Input<br/>[listen.py]"]
  node_voice_wake["Wake Word<br/>[wake_word.py]"]
  node_voice_output["Speech Output<br/>[tts.py]"]
  node_free_tts["Neural TTS<br/>[free_tts.py]"]
end

subgraph group_intelligence["Assistant Intelligence"]
  node_brain["Conversation Brain<br/>[brain.py]"]
  node_planner["Task Planner<br/>[task_planner.py]"]
  node_workflow["Workflow Engine<br/>[workflow_engine.py]"]
  node_sentiment["Sentiment Analysis"]
  node_api_handler["Model and API Routing<br/>[api_handler.py]"]
end

subgraph group_memory["Memory"]
  node_memory_manager["Memory Context<br/>[memory_manager.py]"]
  node_memory_api["Memory Operations<br/>[memory.py]"]
  node_database[("SQLite Memory Store<br/>[database.py]")]
end

subgraph group_capabilities["Tools and Actions"]
  node_plugin_manager["Plugin Manager<br/>[plugin_manager.py]"]
  node_web_search["Web Search<br/>[web_search.py]"]
  node_file_tools["File Operations<br/>[file_ops.py]"]
  node_document_tools["Document Tools<br/>[file_processor.py]"]
  node_pdf_tool["PDF Generation<br/>[pdf_generator.py]"]
  node_image_tool["Image Generation<br/>[image_generator.py]"]
  node_camera_tool["Camera<br/>[camera.py]"]
  node_code_tool["Code Execution<br/>[code_execution.py]"]
  node_phone_tool["Phone Control<br/>[phone_control.py]"]
  node_automation["Desktop Automation<br/>[app_control.py]"]
  node_system_tasks["System Tasks<br/>[system_tasks.py]"]
end

subgraph group_services["External Services"]
  node_token_client["TokenRouter Client"]
  node_llm_service(("LLM Provider"))
end

node_user(("User"))
node_external_web(("Web Search Service"))
node_tts_service(("Edge TTS Service"))

node_user -->|"sends input"| node_dashboard
node_dashboard -->|"delivers command"| node_assistant
node_assistant -->|"processes query"| node_brain
node_assistant -->|"updates status"| node_dashboard
node_assistant -->|"handles uploads"| node_brain
node_voice_input -.->|"provides speech"| node_brain
node_voice_wake -.->|"activates listening"| node_voice_input
node_brain -.->|"produces speech"| node_voice_output
node_brain -.->|"requests synthesis"| node_free_tts
node_free_tts -->|"requests audio"| node_tts_service
node_brain -->|"plans task"| node_planner
node_workflow -->|"plans command"| node_planner
node_brain -->|"requests model"| node_api_handler
node_api_handler -->|"sends completion"| node_token_client
node_token_client -->|"calls API"| node_llm_service
node_brain -->|"builds context"| node_memory_manager
node_memory_manager -->|"reads and updates"| node_database
node_memory_api -->|"reads and writes"| node_database
node_api_handler -->|"searches memory"| node_memory_api
node_workflow -->|"dispatches action"| node_web_search
node_web_search -->|"searches web"| node_external_web
node_workflow -->|"dispatches action"| node_pdf_tool
node_workflow -->|"dispatches action"| node_image_tool
node_workflow -->|"dispatches action"| node_camera_tool
node_workflow -->|"dispatches action"| node_code_tool
node_workflow -->|"dispatches action"| node_file_tools
node_workflow -->|"dispatches action"| node_phone_tool
node_workflow -->|"dispatches action"| node_automation
node_plugin_manager -->|"falls back to"| node_workflow
node_plugin_manager -->|"registers builtin"| node_web_search
node_plugin_manager -->|"registers builtin"| node_image_tool
node_plugin_manager -->|"registers builtin"| node_pdf_tool
node_sentiment -.->|"informs response"| node_brain
node_workflow -.->|"dispatches action"| node_system_tasks

click node_dashboard "https://github.com/tarigopullasathwik/anju_ai/blob/master/utils/ui_dashboard.py"
click node_assistant "https://github.com/tarigopullasathwik/anju_ai/blob/master/main.py"
click node_voice_input "https://github.com/tarigopullasathwik/anju_ai/blob/master/voice/listen.py"
click node_voice_wake "https://github.com/tarigopullasathwik/anju_ai/blob/master/voice/wake_word.py"
click node_voice_output "https://github.com/tarigopullasathwik/anju_ai/blob/master/voice/tts.py"
click node_free_tts "https://github.com/tarigopullasathwik/anju_ai/blob/master/voice/free_tts.py"
click node_brain "https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/brain.py"
click node_planner "https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/task_planner.py"
click node_workflow "https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/workflow_engine.py"
click node_sentiment "https://github.com/tarigopullasathwik/anju_ai/blob/master/emotion/sentiment_analysis.py"
click node_api_handler "https://github.com/tarigopullasathwik/anju_ai/blob/master/utils/api_handler.py"
click node_token_client "https://github.com/tarigopullasathwik/anju_ai/blob/master/utils/tokenrouter_client.py"
click node_memory_manager "https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/memory_manager.py"
click node_memory_api "https://github.com/tarigopullasathwik/anju_ai/blob/master/memory/memory.py"
click node_database "https://github.com/tarigopullasathwik/anju_ai/blob/master/memory/database.py"
click node_plugin_manager "https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/plugin_manager.py"
click node_web_search "https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/web_search.py"
click node_file_tools "https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/file_ops.py"
click node_document_tools "https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/file_processor.py"
click node_pdf_tool "https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/pdf_generator.py"
click node_image_tool "https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/image_generator.py"
click node_camera_tool "https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/camera.py"
click node_code_tool "https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/code_execution.py"
click node_phone_tool "https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/phone_control.py"
click node_automation "https://github.com/tarigopullasathwik/anju_ai/blob/master/automation/app_control.py"
click node_system_tasks "https://github.com/tarigopullasathwik/anju_ai/blob/master/automation/system_tasks.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_dashboard,node_assistant,node_voice_input,node_voice_wake,node_voice_output,node_free_tts,node_user toneBlue
class node_brain,node_planner,node_workflow,node_sentiment,node_api_handler toneAmber
class node_memory_manager,node_memory_api,node_database toneMint
class node_plugin_manager,node_web_search,node_file_tools,node_document_tools,node_pdf_tool,node_image_tool,node_camera_tool,node_code_tool,node_phone_tool,node_automation,node_system_tasks toneRose
class node_token_client,node_llm_service,node_external_web,node_tts_service toneIndigo
```

## Components

### User Interaction

- [Web Dashboard](https://github.com/tarigopullasathwik/anju_ai/blob/master/utils/ui_dashboard.py): `utils/ui_dashboard.py`
- [Assistant Runtime](https://github.com/tarigopullasathwik/anju_ai/blob/master/main.py): `main.py`
- [Voice Input](https://github.com/tarigopullasathwik/anju_ai/blob/master/voice/listen.py): `voice/listen.py`
- [Wake Word](https://github.com/tarigopullasathwik/anju_ai/blob/master/voice/wake_word.py): `voice/wake_word.py`
- [Speech Output](https://github.com/tarigopullasathwik/anju_ai/blob/master/voice/tts.py): `voice/tts.py`
- [Neural TTS](https://github.com/tarigopullasathwik/anju_ai/blob/master/voice/free_tts.py): `voice/free_tts.py`

### Assistant Intelligence

- [Conversation Brain](https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/brain.py): `brain/brain.py`
- [Task Planner](https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/task_planner.py): `brain/task_planner.py`
- [Workflow Engine](https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/workflow_engine.py): `brain/workflow_engine.py`
- [Sentiment Analysis](https://github.com/tarigopullasathwik/anju_ai/blob/master/emotion/sentiment_analysis.py): `emotion/sentiment_analysis.py`
- [Model and API Routing](https://github.com/tarigopullasathwik/anju_ai/blob/master/utils/api_handler.py): `utils/api_handler.py`

### Memory

- [Memory Context](https://github.com/tarigopullasathwik/anju_ai/blob/master/brain/memory_manager.py): `brain/memory_manager.py`
- [Memory Operations](https://github.com/tarigopullasathwik/anju_ai/blob/master/memory/memory.py): `memory/memory.py`
- [SQLite Memory Store](https://github.com/tarigopullasathwik/anju_ai/blob/master/memory/database.py): `memory/database.py`

### Tools and Actions

- [Plugin Manager](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/plugin_manager.py): `tools/plugin_manager.py`
- [Web Search](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/web_search.py): `tools/web_search.py`
- [File Operations](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/file_ops.py): `tools/file_ops.py`
- [Document Tools](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/file_processor.py): `tools/file_processor.py`
- [PDF Generation](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/pdf_generator.py): `tools/pdf_generator.py`
- [Image Generation](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/image_generator.py): `tools/image_generator.py`
- [Camera](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/camera.py): `tools/camera.py`
- [Code Execution](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/code_execution.py): `tools/code_execution.py`
- [Phone Control](https://github.com/tarigopullasathwik/anju_ai/blob/master/tools/phone_control.py): `tools/phone_control.py`
- [Desktop Automation](https://github.com/tarigopullasathwik/anju_ai/blob/master/automation/app_control.py): `automation/app_control.py`
- [System Tasks](https://github.com/tarigopullasathwik/anju_ai/blob/master/automation/system_tasks.py): `automation/system_tasks.py`

### External Services

- [TokenRouter Client](https://github.com/tarigopullasathwik/anju_ai/blob/master/utils/tokenrouter_client.py): `utils/tokenrouter_client.py`
- **LLM Provider**

### Other components

- **User**
- **Web Search Service**
- **Edge TTS Service**

## Connections

- User → Web Dashboard: sends input
- Web Dashboard → Assistant Runtime: delivers command
- Assistant Runtime → Conversation Brain: processes query
- Assistant Runtime → Web Dashboard: updates status
- Assistant Runtime → Conversation Brain: handles uploads
- Voice Input → Conversation Brain: provides speech
- Wake Word → Voice Input: activates listening
- Conversation Brain → Speech Output: produces speech
- Conversation Brain → Neural TTS: requests synthesis
- Neural TTS → Edge TTS Service: requests audio
- Conversation Brain → Task Planner: plans task
- Workflow Engine → Task Planner: plans command
- Conversation Brain → Model and API Routing: requests model
- Model and API Routing → TokenRouter Client: sends completion
- TokenRouter Client → LLM Provider: calls API
- Conversation Brain → Memory Context: builds context
- Memory Context → SQLite Memory Store: reads and updates
- Memory Operations → SQLite Memory Store: reads and writes
- Model and API Routing → Memory Operations: searches memory
- Workflow Engine → Web Search: dispatches action
- Web Search → Web Search Service: searches web
- Workflow Engine → PDF Generation: dispatches action
- Workflow Engine → Image Generation: dispatches action
- Workflow Engine → Camera: dispatches action
- Workflow Engine → Code Execution: dispatches action
- Workflow Engine → File Operations: dispatches action
- Workflow Engine → Phone Control: dispatches action
- Workflow Engine → Desktop Automation: dispatches action
- Plugin Manager → Workflow Engine: falls back to
- Plugin Manager → Web Search: registers builtin
- Plugin Manager → Image Generation: registers builtin
- Plugin Manager → PDF Generation: registers builtin
- Sentiment Analysis → Conversation Brain: informs response
- Workflow Engine → System Tasks: dispatches action
