# mohit-pjcts/assistant architecture

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

- Interactive diagram: https://gitdiagram.com/mohit-pjcts/assistant
- Repository: https://github.com/mohit-pjcts/assistant

## Overview

This is a personal AI assistant with CLI and Tauri dashboard clients. Both feed a persistent, supervisor-routed conversation: specialist agents handle coding, research, life-admin, and Mac control; gated writes pause for user confirmation; results and conversation state persist across turns. The dashboard also exposes memory, threads, costs, activity, workflows, and a kanban board, while voice uses local transcription and the ordinary chat path. Relationships for unsampled capabilities follow explicit README documentation; sampled source confirms key orchestration and memory links.

Main entry points: [`assistant/sub_agents.py`](https://github.com/mohit-pjcts/assistant/blob/main/assistant/sub_agents.py) (Specialist Agents), [`assistant/supervisor.py`](https://github.com/mohit-pjcts/assistant/blob/main/assistant/supervisor.py) (Supervisor Graph), [`assistant/server.py`](https://github.com/mohit-pjcts/assistant/blob/main/assistant/server.py) (HTTP API), [`assistant/main.py`](https://github.com/mohit-pjcts/assistant/blob/main/assistant/main.py) (CLI Chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User Clients"]
  node_cli["CLI Chat<br/>[main.py]"]
  node_dashboard["Desktop Dashboard<br/>[App.tsx]"]
end

subgraph group_runtime["Conversation Runtime"]
  node_api["HTTP API<br/>[server.py]"]
  node_supervisor["Supervisor Graph<br/>[supervisor.py]"]
  node_compaction["History Compaction<br/>[compaction.py]"]
end

subgraph group_agents["Specialist Agents"]
  node_subagents["Specialist Agents<br/>[sub_agents.py]"]
end

subgraph group_capabilities["Assistant Capabilities"]
  node_coding["Coding Tools<br/>[tools.py]"]
  node_research["Web Research<br/>[sub_agents.py]"]
  node_lifeadmin["Email Calendar<br/>[mcp_tools.py]"]
  node_gatedwrites["Confirmed Writes<br/>[write_tools.py]"]
  node_mac["Mac Control<br/>[mac_tools.py]"]
  node_voice["Local Speech<br/>[voice_io.py]"]
  node_board["Kanban Board<br/>[board_tools.py]"]
  node_memoryflow["Memory Review"]
  node_attachments["Media Attachments<br/>[media_tools.py]"]
end

subgraph group_state["Persistence"]
  node_memorydata[("Durable Facts<br/>[memory_store.py]")]
  node_threads[("Thread Registry<br/>[thread_store.py]")]
  node_checkpointer[("Conversation Checkpoint<br/>[memory.py]")]
  node_workflow[("Workflow Tracking<br/>[workflow_store.py]")]
end

node_user(("User"))
node_claude(("Claude API"))
node_tavily(("Tavily Search"))
node_google(("Google Services"))

node_user -->|"chats through"| node_cli
node_user -->|"chats through"| node_dashboard
node_cli -->|"invokes graph"| node_supervisor
node_dashboard -->|"sends chat"| node_api
node_api -->|"invokes graph"| node_supervisor
node_supervisor -->|"dispatches to"| node_subagents
node_subagents -->|"uses tools"| node_coding
node_subagents -->|"handles research"| node_research
node_subagents -->|"uses integration"| node_lifeadmin
node_subagents -->|"requests writes"| node_gatedwrites
node_subagents -->|"handles Mac tasks"| node_mac
node_gatedwrites -->|"requests confirmation"| node_user
node_subagents -->|"reads and writes"| node_board
node_api -->|"transcribes audio"| node_voice
node_dashboard -->|"attaches media"| node_attachments
node_api -->|"resolves threads"| node_threads
node_cli -->|"manages threads"| node_threads
node_supervisor -->|"persists turns"| node_checkpointer
node_supervisor -->|"compacts history"| node_compaction
node_memoryflow -->|"proposes facts"| node_memorydata
node_memoryflow -->|"scans threads"| node_threads
node_supervisor -->|"tracks workflow"| node_workflow
node_subagents -->|"generates responses"| node_claude
node_subagents -->|"searches web"| node_tavily
node_lifeadmin -->|"uses Gmail Calendar"| node_google

click node_cli "https://github.com/mohit-pjcts/assistant/blob/main/assistant/main.py"
click node_dashboard "https://github.com/mohit-pjcts/assistant/blob/main/dashboard/src/App.tsx"
click node_api "https://github.com/mohit-pjcts/assistant/blob/main/assistant/server.py"
click node_supervisor "https://github.com/mohit-pjcts/assistant/blob/main/assistant/supervisor.py"
click node_subagents "https://github.com/mohit-pjcts/assistant/blob/main/assistant/sub_agents.py"
click node_coding "https://github.com/mohit-pjcts/assistant/blob/main/assistant/tools.py"
click node_research "https://github.com/mohit-pjcts/assistant/blob/main/assistant/sub_agents.py"
click node_lifeadmin "https://github.com/mohit-pjcts/assistant/blob/main/assistant/mcp_tools.py"
click node_gatedwrites "https://github.com/mohit-pjcts/assistant/blob/main/assistant/write_tools.py"
click node_mac "https://github.com/mohit-pjcts/assistant/blob/main/assistant/mac_tools.py"
click node_voice "https://github.com/mohit-pjcts/assistant/blob/main/assistant/voice_io.py"
click node_board "https://github.com/mohit-pjcts/assistant/blob/main/assistant/board_tools.py"
click node_memoryflow "https://github.com/mohit-pjcts/assistant/blob/main/assistant/memory_review_agent.py"
click node_memorydata "https://github.com/mohit-pjcts/assistant/blob/main/assistant/memory_store.py"
click node_threads "https://github.com/mohit-pjcts/assistant/blob/main/assistant/thread_store.py"
click node_checkpointer "https://github.com/mohit-pjcts/assistant/blob/main/assistant/memory.py"
click node_compaction "https://github.com/mohit-pjcts/assistant/blob/main/assistant/compaction.py"
click node_workflow "https://github.com/mohit-pjcts/assistant/blob/main/assistant/workflow_store.py"
click node_attachments "https://github.com/mohit-pjcts/assistant/blob/main/assistant/media_tools.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_cli,node_dashboard,node_user toneBlue
class node_api,node_supervisor,node_compaction toneAmber
class node_subagents,node_claude toneMint
class node_coding,node_research,node_lifeadmin,node_gatedwrites,node_mac,node_voice,node_board,node_memoryflow,node_attachments toneRose
class node_memorydata,node_threads,node_checkpointer,node_workflow,node_tavily,node_google toneIndigo
```

## Components

### User Clients

- [CLI Chat](https://github.com/mohit-pjcts/assistant/blob/main/assistant/main.py): `assistant/main.py`
- [Desktop Dashboard](https://github.com/mohit-pjcts/assistant/blob/main/dashboard/src/App.tsx): `dashboard/src/App.tsx`

### Conversation Runtime

- [HTTP API](https://github.com/mohit-pjcts/assistant/blob/main/assistant/server.py): `assistant/server.py`
- [Supervisor Graph](https://github.com/mohit-pjcts/assistant/blob/main/assistant/supervisor.py): `assistant/supervisor.py`
- [History Compaction](https://github.com/mohit-pjcts/assistant/blob/main/assistant/compaction.py): `assistant/compaction.py`

### Specialist Agents

- [Specialist Agents](https://github.com/mohit-pjcts/assistant/blob/main/assistant/sub_agents.py): `assistant/sub_agents.py`

### Assistant Capabilities

- [Coding Tools](https://github.com/mohit-pjcts/assistant/blob/main/assistant/tools.py): `assistant/tools.py`
- [Web Research](https://github.com/mohit-pjcts/assistant/blob/main/assistant/sub_agents.py): `assistant/sub_agents.py`
- [Email Calendar](https://github.com/mohit-pjcts/assistant/blob/main/assistant/mcp_tools.py): `assistant/mcp_tools.py`
- [Confirmed Writes](https://github.com/mohit-pjcts/assistant/blob/main/assistant/write_tools.py): `assistant/write_tools.py`
- [Mac Control](https://github.com/mohit-pjcts/assistant/blob/main/assistant/mac_tools.py): `assistant/mac_tools.py`
- [Local Speech](https://github.com/mohit-pjcts/assistant/blob/main/assistant/voice_io.py): `assistant/voice_io.py`
- [Kanban Board](https://github.com/mohit-pjcts/assistant/blob/main/assistant/board_tools.py): `assistant/board_tools.py`
- [Memory Review](https://github.com/mohit-pjcts/assistant/blob/main/assistant/memory_review_agent.py): `assistant/memory_review_agent.py`
- [Media Attachments](https://github.com/mohit-pjcts/assistant/blob/main/assistant/media_tools.py): `assistant/media_tools.py`

### Persistence

- [Durable Facts](https://github.com/mohit-pjcts/assistant/blob/main/assistant/memory_store.py): `assistant/memory_store.py`
- [Thread Registry](https://github.com/mohit-pjcts/assistant/blob/main/assistant/thread_store.py): `assistant/thread_store.py`
- [Conversation Checkpoint](https://github.com/mohit-pjcts/assistant/blob/main/assistant/memory.py): `assistant/memory.py`
- [Workflow Tracking](https://github.com/mohit-pjcts/assistant/blob/main/assistant/workflow_store.py): `assistant/workflow_store.py`

### Other components

- **User**
- **Claude API**
- **Tavily Search**
- **Google Services**

## Connections

- User → CLI Chat: chats through (evidence: `README.md`)
- User → Desktop Dashboard: chats through (evidence: `README.md`)
- CLI Chat → Supervisor Graph: invokes graph (evidence: `assistant/main.py`)
- Desktop Dashboard → HTTP API: sends chat (evidence: `README.md`)
- HTTP API → Supervisor Graph: invokes graph (evidence: `assistant/server.py`)
- Supervisor Graph → Specialist Agents: dispatches to (evidence: `assistant/supervisor.py`)
- Specialist Agents → Coding Tools: uses tools (evidence: `assistant/sub_agents.py`)
- Specialist Agents → Web Research: handles research (evidence: `README.md`)
- Specialist Agents → Email Calendar: uses integration (evidence: `assistant/sub_agents.py`)
- Specialist Agents → Confirmed Writes: requests writes (evidence: `README.md`)
- Specialist Agents → Mac Control: handles Mac tasks (evidence: `assistant/sub_agents.py`)
- Confirmed Writes → User: requests confirmation (evidence: `README.md`)
- Specialist Agents → Kanban Board: reads and writes (evidence: `README.md`)
- HTTP API → Local Speech: transcribes audio (evidence: `README.md`)
- Desktop Dashboard → Media Attachments: attaches media (evidence: `README.md`)
- HTTP API → Thread Registry: resolves threads (evidence: `assistant/server.py`)
- CLI Chat → Thread Registry: manages threads (evidence: `assistant/main.py`)
- Supervisor Graph → Conversation Checkpoint: persists turns (evidence: `README.md`)
- Supervisor Graph → History Compaction: compacts history (evidence: `assistant/supervisor.py`)
- Memory Review → Durable Facts: proposes facts (evidence: `assistant/memory_review_agent.py`)
- Memory Review → Thread Registry: scans threads (evidence: `assistant/memory_review_agent.py`)
- Supervisor Graph → Workflow Tracking: tracks workflow (evidence: `assistant/supervisor.py`)
- Specialist Agents → Claude API: generates responses (evidence: `README.md`)
- Specialist Agents → Tavily Search: searches web (evidence: `README.md`)
- Email Calendar → Google Services: uses Gmail Calendar (evidence: `README.md`)
