# blogminhquy/javis-os architecture

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

- Interactive diagram: https://gitdiagram.com/blogminhquy/javis-os
- Repository: https://github.com/blogminhquy/javis-os

## Overview

Javis OS is a self-hosted, multi-provider AI agent with a persistent Second Brain, dashboard, tools, and background automation. The main user path is dashboard request → server runtime → selected model and available tools → response; the same runtime also supports voice, messaging channels, and queued work. The README documents these capabilities, while sampled source confirms several engine, MCP, conversation, and channel responsibilities. Many feature implementations were not sampled, so their links are limited to documented relationships rather than inferred call chains.

Main entry points: [`server/chat_runtime.py`](https://github.com/blogminhquy/javis-os/blob/main/server/chat_runtime.py) (Chat orchestration), [`server/main.py`](https://github.com/blogminhquy/javis-os/blob/main/server/main.py) (Server entry), [`server/routes/channels.py`](https://github.com/blogminhquy/javis-os/blob/main/server/routes/channels.py) (Channel API), [`server/claude_sdk_engine.py`](https://github.com/blogminhquy/javis-os/blob/main/server/claude_sdk_engine.py) (Claude engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboard["Dashboard<br/>[app.js]"]
  node_voice["Voice interface<br/>[voice_call.py]"]
  node_cli["Command-line client<br/>[commands.py]"]
end

subgraph group_runtime["Agent runtime"]
  node_server["Server entry<br/>[main.py]"]
  node_chat["Chat orchestration<br/>[chat_runtime.py]"]
  node_api_engine["Provider engines<br/>[engine.py]"]
  node_claude_engine["Claude engine"]
  node_engine_adapter["Engine adapter<br/>[claude_cli.py]"]
  node_config["Settings<br/>[config.py]"]
end

subgraph group_brain["Memory and work"]
  node_brain_files["Brain files"]
  node_conversations[("Conversation history<br/>[conversations.py]")]
  node_background["Background work<br/>[tien_trinh_nen.py]"]
  node_tasks[("Task queue<br/>[tasks.py]")]
  node_learning["Learning<br/>[limit_learner.py]"]
end

subgraph group_connections["Tools and channels"]
  node_mcp["MCP client<br/>[mcp_client.py]"]
  node_mcp_store[("MCP connections<br/>[mcp_store.py]")]
  node_oauth["MCP OAuth<br/>[oauth_mcp.py]"]
  node_channel_routes["Channel API<br/>[channels.py]"]
  node_channel_accounts[("Channel accounts")]
  node_customer_conversations[("Customer conversations<br/>[conversations.py]")]
  node_chatbot_store[("Bot configuration<br/>[chatbot_store.py]")]
  node_reply_policy["Reply policy"]
  node_reply_policy_store[("Policy storage")]
  node_zalo["Personal Zalo"]
end

node_user(("User"))
node_provider(("AI providers"))
node_mcp_servers(("MCP servers"))
node_messaging(("Messaging platforms"))

node_user -->|"uses"| node_dashboard
node_user -->|"uses"| node_cli
node_dashboard -.->|"sends requests"| node_server
node_cli -.->|"sends requests"| node_server
node_user -->|"speaks to"| node_voice
node_voice -.->|"submits turns"| node_server
node_server -.->|"routes chat"| node_chat
node_chat -->|"invokes"| node_api_engine
node_chat -.->|"invokes"| node_claude_engine
node_claude_engine -->|"uses factory"| node_engine_adapter
node_api_engine -->|"calls model"| node_provider
node_claude_engine -.->|"calls model"| node_provider
node_server -.->|"reads settings"| node_config
node_chat -->|"uses memory"| node_brain_files
node_chat -.->|"stores history"| node_conversations
node_background -.->|"dispatches work"| node_tasks
node_tasks -->|"runs jobs"| node_background
node_background -->|"works on"| node_brain_files
node_learning -->|"learns into"| node_brain_files
node_chat -->|"uses tools"| node_mcp
node_mcp -->|"loads connections"| node_mcp_store
node_oauth -->|"stores credentials"| node_mcp_store
node_mcp -->|"calls tools"| node_mcp_servers
node_channel_routes -->|"lists accounts"| node_channel_accounts
node_channel_routes -->|"reads bots"| node_chatbot_store
node_channel_routes -->|"uses history"| node_customer_conversations
node_chatbot_store -->|"normalizes policy"| node_reply_policy
node_chatbot_store -->|"uses policy store"| node_reply_policy_store
node_zalo -->|"records messages"| node_customer_conversations
node_zalo -->|"sends and receives"| node_messaging

click node_dashboard "https://github.com/blogminhquy/javis-os/blob/main/dashboard/app.js"
click node_voice "https://github.com/blogminhquy/javis-os/blob/main/server/voice_call.py"
click node_cli "https://github.com/blogminhquy/javis-os/blob/main/cli/javis_cli/commands.py"
click node_server "https://github.com/blogminhquy/javis-os/blob/main/server/main.py"
click node_chat "https://github.com/blogminhquy/javis-os/blob/main/server/chat_runtime.py"
click node_api_engine "https://github.com/blogminhquy/javis-os/blob/main/server/engine.py"
click node_claude_engine "https://github.com/blogminhquy/javis-os/blob/main/server/claude_sdk_engine.py"
click node_engine_adapter "https://github.com/blogminhquy/javis-os/blob/main/server/claude_cli.py"
click node_config "https://github.com/blogminhquy/javis-os/blob/main/server/config.py"
click node_conversations "https://github.com/blogminhquy/javis-os/blob/main/server/conversations.py"
click node_background "https://github.com/blogminhquy/javis-os/blob/main/server/tien_trinh_nen.py"
click node_tasks "https://github.com/blogminhquy/javis-os/blob/main/server/tasks.py"
click node_learning "https://github.com/blogminhquy/javis-os/blob/main/server/limit_learner.py"
click node_mcp "https://github.com/blogminhquy/javis-os/blob/main/server/mcp_client.py"
click node_mcp_store "https://github.com/blogminhquy/javis-os/blob/main/server/mcp_store.py"
click node_oauth "https://github.com/blogminhquy/javis-os/blob/main/server/oauth_mcp.py"
click node_channel_routes "https://github.com/blogminhquy/javis-os/blob/main/server/routes/channels.py"
click node_channel_accounts "https://github.com/blogminhquy/javis-os/blob/main/server/channel_accounts.py"
click node_customer_conversations "https://github.com/blogminhquy/javis-os/blob/main/server/conversations.py"
click node_chatbot_store "https://github.com/blogminhquy/javis-os/blob/main/server/chatbot_store.py"
click node_reply_policy "https://github.com/blogminhquy/javis-os/blob/main/server/chatbot_reply_policy.py"
click node_reply_policy_store "https://github.com/blogminhquy/javis-os/blob/main/server/chatbot_reply_policy_store.py"
click node_zalo "https://github.com/blogminhquy/javis-os/blob/main/server/zalo_personal_channel.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_voice,node_cli,node_user toneBlue
class node_server,node_chat,node_api_engine,node_claude_engine,node_engine_adapter,node_config toneAmber
class node_brain_files,node_conversations,node_background,node_tasks,node_learning,node_mcp_servers toneMint
class node_mcp,node_mcp_store,node_oauth,node_channel_routes,node_channel_accounts,node_customer_conversations,node_chatbot_store,node_reply_policy,node_reply_policy_store,node_zalo toneRose
class node_provider,node_messaging toneIndigo
```

## Components

### User experience

- [Dashboard](https://github.com/blogminhquy/javis-os/blob/main/dashboard/app.js): `dashboard/app.js`
- [Voice interface](https://github.com/blogminhquy/javis-os/blob/main/server/voice_call.py): `server/voice_call.py`
- [Command-line client](https://github.com/blogminhquy/javis-os/blob/main/cli/javis_cli/commands.py): `cli/javis_cli/commands.py`

### Agent runtime

- [Server entry](https://github.com/blogminhquy/javis-os/blob/main/server/main.py): `server/main.py`
- [Chat orchestration](https://github.com/blogminhquy/javis-os/blob/main/server/chat_runtime.py): `server/chat_runtime.py`
- [Provider engines](https://github.com/blogminhquy/javis-os/blob/main/server/engine.py): `server/engine.py`
- [Claude engine](https://github.com/blogminhquy/javis-os/blob/main/server/claude_sdk_engine.py): `server/claude_sdk_engine.py`
- [Engine adapter](https://github.com/blogminhquy/javis-os/blob/main/server/claude_cli.py): `server/claude_cli.py`
- [Settings](https://github.com/blogminhquy/javis-os/blob/main/server/config.py): `server/config.py`

### Memory and work

- **Brain files**
- [Conversation history](https://github.com/blogminhquy/javis-os/blob/main/server/conversations.py): `server/conversations.py`
- [Background work](https://github.com/blogminhquy/javis-os/blob/main/server/tien_trinh_nen.py): `server/tien_trinh_nen.py`
- [Task queue](https://github.com/blogminhquy/javis-os/blob/main/server/tasks.py): `server/tasks.py`
- [Learning](https://github.com/blogminhquy/javis-os/blob/main/server/limit_learner.py): `server/limit_learner.py`

### Tools and channels

- [MCP client](https://github.com/blogminhquy/javis-os/blob/main/server/mcp_client.py): `server/mcp_client.py`
- [MCP connections](https://github.com/blogminhquy/javis-os/blob/main/server/mcp_store.py): `server/mcp_store.py`
- [MCP OAuth](https://github.com/blogminhquy/javis-os/blob/main/server/oauth_mcp.py): `server/oauth_mcp.py`
- [Channel API](https://github.com/blogminhquy/javis-os/blob/main/server/routes/channels.py): `server/routes/channels.py`
- [Channel accounts](https://github.com/blogminhquy/javis-os/blob/main/server/channel_accounts.py): `server/channel_accounts.py`
- [Customer conversations](https://github.com/blogminhquy/javis-os/blob/main/server/conversations.py): `server/conversations.py`
- [Bot configuration](https://github.com/blogminhquy/javis-os/blob/main/server/chatbot_store.py): `server/chatbot_store.py`
- [Reply policy](https://github.com/blogminhquy/javis-os/blob/main/server/chatbot_reply_policy.py): `server/chatbot_reply_policy.py`
- [Policy storage](https://github.com/blogminhquy/javis-os/blob/main/server/chatbot_reply_policy_store.py): `server/chatbot_reply_policy_store.py`
- [Personal Zalo](https://github.com/blogminhquy/javis-os/blob/main/server/zalo_personal_channel.py): `server/zalo_personal_channel.py`

### Other components

- **User**
- **AI providers**
- **MCP servers**
- **Messaging platforms**

## Connections

- User → Dashboard: uses (evidence: `README.md`)
- User → Command-line client: uses (evidence: `README.md`)
- Dashboard → Server entry: sends requests
- Command-line client → Server entry: sends requests
- User → Voice interface: speaks to (evidence: `README.md`)
- Voice interface → Server entry: submits turns
- Server entry → Chat orchestration: routes chat
- Chat orchestration → Provider engines: invokes (evidence: `server/engine.py`)
- Chat orchestration → Claude engine: invokes
- Claude engine → Engine adapter: uses factory (evidence: `server/claude_cli.py`)
- Provider engines → AI providers: calls model (evidence: `server/engine.py`)
- Claude engine → AI providers: calls model
- Server entry → Settings: reads settings
- Chat orchestration → Brain files: uses memory (evidence: `README.md`)
- Chat orchestration → Conversation history: stores history
- Background work → Task queue: dispatches work
- Task queue → Background work: runs jobs (evidence: `server/tasks.py`)
- Background work → Brain files: works on (evidence: `README.md`)
- Learning → Brain files: learns into (evidence: `README.md`)
- Chat orchestration → MCP client: uses tools
- MCP client → MCP connections: loads connections
- MCP OAuth → MCP connections: stores credentials (evidence: `server/oauth_mcp.py`)
- MCP client → MCP servers: calls tools (evidence: `README.md`)
- Channel API → Channel accounts: lists accounts (evidence: `server/routes/channels.py`)
- Channel API → Bot configuration: reads bots (evidence: `server/routes/channels.py`)
- Channel API → Customer conversations: uses history (evidence: `server/routes/channels.py`)
- Bot configuration → Reply policy: normalizes policy (evidence: `server/chatbot_store.py`)
- Bot configuration → Policy storage: uses policy store (evidence: `server/chatbot_store.py`)
- Personal Zalo → Customer conversations: records messages (evidence: `server/channels/zalo_personal.py`)
- Personal Zalo → Messaging platforms: sends and receives (evidence: `README.md`)
