# liyituo/venus architecture

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

## Overview

Venus’s main workflow is a user request from a frontend to the llm_server harness, which uses an LLM and local/MCP tools to perform work; longer requests can become tracked background jobs. The README also documents team collaboration, a separate RAG service, and a Windows quota widget, so these appear as distinct branches. Some backend and integration wiring is based on README documentation because the corresponding source was not sampled; uncertain links are omitted.

Main entry points: [`src/llm_server.py`](https://github.com/liyituo/venus/blob/main/src/llm_server.py) (LLM Server), [`RAG/rag_server.py`](https://github.com/liyituo/venus/blob/main/RAG/rag_server.py) (RAG HTTP Service), [`local-quota-widget/app.py`](https://github.com/liyituo/venus/blob/main/local-quota-widget/app.py) (Quota Widget), [`src/worker_hub.py`](https://github.com/liyituo/venus/blob/main/src/worker_hub.py) (Worker Hub)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_cli["CLI<br/>[cli.py]"]
  node_chat["VenusChat<br/>[app.py]"]
  node_telegram["Telegram Bot<br/>[telegram_bot.py]"]
end

subgraph group_agent["Agent Runtime"]
  node_server["LLM Server<br/>[llm_server.py]"]
  node_memory["Agent Memory<br/>[agent_memory.py]"]
  node_tools["Browser and Tools<br/>[browser_tools.py]"]
  node_mcp["MCP Manager<br/>[mcp_manager.py]"]
end

subgraph group_tasks["Tasks and Teams"]
  node_dispatch["Dispatch Router<br/>[dispatch_router.py]"]
  node_jobs[("Async Jobs<br/>[agent_jobs.py]")]
  node_schedules[("Schedules<br/>[schedule_store.py]")]
  node_team["Team Projects<br/>[team_collab.py]"]
  node_versions[("Project Versions<br/>[team_versions.py]")]
  node_workerhub["Worker Hub<br/>[worker_hub.py]"]
  node_worker["Remote Worker<br/>[remote_worker.py]"]
end

subgraph group_services["Local Services"]
  node_daemon["Screen Daemon<br/>[app.py]"]
end

subgraph group_extras["Knowledge and Utilities"]
  node_ragapi["RAG HTTP Service<br/>[rag_server.py]"]
  node_ragcore["Chunking, Embedding, Retrieval"]
  node_ragstore[("RAG Collections<br/>[store.py]")]
  node_quota["Quota Widget<br/>[app.py]"]
  node_providers["Codex and Cursor"]
  node_widgetstore[("Widget Settings and Secrets<br/>[storage.py]")]
end

node_user(("User"))
node_model(("OpenAI-compatible LLM"))
node_mcpservers{{"MCP Services"}}
node_ollama{{"Ollama Embeddings"}}

node_user -->|"sends request"| node_cli
node_user -->|"sends request"| node_chat
node_user -->|"sends request"| node_telegram
node_cli -->|"HTTP requests"| node_server
node_chat -->|"HTTP requests"| node_server
node_telegram -->|"HTTP requests"| node_server
node_server -->|"requests completion"| node_model
node_server -->|"reads and updates"| node_memory
node_server -->|"dispatches tools"| node_tools
node_server -->|"loads MCP tools"| node_mcp
node_mcp -.->|"connects to"| node_mcpservers
node_server -->|"routes work"| node_dispatch
node_dispatch -->|"creates async jobs"| node_jobs
node_server -->|"manages schedules"| node_schedules
node_schedules -->|"creates due jobs"| node_jobs
node_server -->|"serves team APIs"| node_team
node_team -->|"manages project changes"| node_versions
node_server -->|"includes worker routes"| node_workerhub
node_workerhub -->|"creates worker jobs"| node_jobs
node_worker -->|"polls and submits"| node_workerhub
node_tools -->|"controls screen"| node_daemon
node_user -->|"submits documents or queries"| node_ragapi
node_ragapi -->|"chunks and searches"| node_ragcore
node_ragapi -->|"reads and writes"| node_ragstore
node_ragcore -.->|"requests embeddings"| node_ollama
node_user -->|"views usage"| node_quota
node_quota -->|"fetches quotas"| node_providers
node_quota -->|"loads and saves settings"| node_widgetstore

click node_cli "https://github.com/liyituo/venus/blob/main/src/cli.py"
click node_chat "https://github.com/liyituo/venus/blob/main/src/venuschat_v1/app.py"
click node_telegram "https://github.com/liyituo/venus/blob/main/src/telegram_bot.py"
click node_server "https://github.com/liyituo/venus/blob/main/src/llm_server.py"
click node_memory "https://github.com/liyituo/venus/blob/main/src/agent_memory.py"
click node_tools "https://github.com/liyituo/venus/blob/main/src/browser_tools.py"
click node_mcp "https://github.com/liyituo/venus/blob/main/src/mcp_manager.py"
click node_dispatch "https://github.com/liyituo/venus/blob/main/src/dispatch_router.py"
click node_jobs "https://github.com/liyituo/venus/blob/main/src/agent_jobs.py"
click node_schedules "https://github.com/liyituo/venus/blob/main/src/schedule_store.py"
click node_team "https://github.com/liyituo/venus/blob/main/src/team_collab.py"
click node_versions "https://github.com/liyituo/venus/blob/main/src/team_versions.py"
click node_workerhub "https://github.com/liyituo/venus/blob/main/src/worker_hub.py"
click node_worker "https://github.com/liyituo/venus/blob/main/src/remote_worker.py"
click node_daemon "https://github.com/liyituo/venus/blob/main/src/app.py"
click node_ragapi "https://github.com/liyituo/venus/blob/main/RAG/rag_server.py"
click node_ragcore "https://github.com/liyituo/venus/tree/main/RAG/rag_core"
click node_ragstore "https://github.com/liyituo/venus/blob/main/RAG/rag_core/store.py"
click node_quota "https://github.com/liyituo/venus/blob/main/local-quota-widget/app.py"
click node_providers "https://github.com/liyituo/venus/tree/main/local-quota-widget/providers"
click node_widgetstore "https://github.com/liyituo/venus/blob/main/local-quota-widget/storage.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_chat,node_telegram,node_user toneBlue
class node_server,node_memory,node_tools,node_mcp toneAmber
class node_dispatch,node_jobs,node_schedules,node_team,node_versions,node_workerhub,node_worker toneMint
class node_daemon toneRose
class node_ragapi,node_ragcore,node_ragstore,node_quota,node_providers,node_widgetstore,node_model,node_mcpservers,node_ollama toneIndigo
```

## Components

### User Interfaces

- [CLI](https://github.com/liyituo/venus/blob/main/src/cli.py): `src/cli.py`
- [VenusChat](https://github.com/liyituo/venus/blob/main/src/venuschat_v1/app.py): `src/venuschat_v1/app.py`
- [Telegram Bot](https://github.com/liyituo/venus/blob/main/src/telegram_bot.py): `src/telegram_bot.py`

### Agent Runtime

- [LLM Server](https://github.com/liyituo/venus/blob/main/src/llm_server.py): `src/llm_server.py`
- [Agent Memory](https://github.com/liyituo/venus/blob/main/src/agent_memory.py): `src/agent_memory.py`
- [Browser and Tools](https://github.com/liyituo/venus/blob/main/src/browser_tools.py): `src/browser_tools.py`
- [MCP Manager](https://github.com/liyituo/venus/blob/main/src/mcp_manager.py): `src/mcp_manager.py`

### Tasks and Teams

- [Dispatch Router](https://github.com/liyituo/venus/blob/main/src/dispatch_router.py): `src/dispatch_router.py`
- [Async Jobs](https://github.com/liyituo/venus/blob/main/src/agent_jobs.py): `src/agent_jobs.py`
- [Schedules](https://github.com/liyituo/venus/blob/main/src/schedule_store.py): `src/schedule_store.py`
- [Team Projects](https://github.com/liyituo/venus/blob/main/src/team_collab.py): `src/team_collab.py`
- [Project Versions](https://github.com/liyituo/venus/blob/main/src/team_versions.py): `src/team_versions.py`
- [Worker Hub](https://github.com/liyituo/venus/blob/main/src/worker_hub.py): `src/worker_hub.py`
- [Remote Worker](https://github.com/liyituo/venus/blob/main/src/remote_worker.py): `src/remote_worker.py`

### Local Services

- [Screen Daemon](https://github.com/liyituo/venus/blob/main/src/app.py): `src/app.py`

### Knowledge and Utilities

- [RAG HTTP Service](https://github.com/liyituo/venus/blob/main/RAG/rag_server.py): `RAG/rag_server.py`
- [Chunking, Embedding, Retrieval](https://github.com/liyituo/venus/tree/main/RAG/rag_core): `RAG/rag_core`
- [RAG Collections](https://github.com/liyituo/venus/blob/main/RAG/rag_core/store.py): `RAG/rag_core/store.py`
- [Quota Widget](https://github.com/liyituo/venus/blob/main/local-quota-widget/app.py): `local-quota-widget/app.py`
- [Codex and Cursor](https://github.com/liyituo/venus/tree/main/local-quota-widget/providers): `local-quota-widget/providers`
- [Widget Settings and Secrets](https://github.com/liyituo/venus/blob/main/local-quota-widget/storage.py): `local-quota-widget/storage.py`

### Other components

- **User**
- **OpenAI-compatible LLM**
- **MCP Services**
- **Ollama Embeddings**

## Connections

- User → CLI: sends request
- User → VenusChat: sends request
- User → Telegram Bot: sends request
- CLI → LLM Server: HTTP requests
- VenusChat → LLM Server: HTTP requests
- Telegram Bot → LLM Server: HTTP requests
- LLM Server → OpenAI-compatible LLM: requests completion
- LLM Server → Agent Memory: reads and updates
- LLM Server → Browser and Tools: dispatches tools
- LLM Server → MCP Manager: loads MCP tools
- MCP Manager → MCP Services: connects to
- LLM Server → Dispatch Router: routes work
- Dispatch Router → Async Jobs: creates async jobs
- LLM Server → Schedules: manages schedules
- Schedules → Async Jobs: creates due jobs
- LLM Server → Team Projects: serves team APIs
- Team Projects → Project Versions: manages project changes
- LLM Server → Worker Hub: includes worker routes
- Worker Hub → Async Jobs: creates worker jobs
- Remote Worker → Worker Hub: polls and submits
- Browser and Tools → Screen Daemon: controls screen
- User → RAG HTTP Service: submits documents or queries
- RAG HTTP Service → Chunking, Embedding, Retrieval: chunks and searches
- RAG HTTP Service → RAG Collections: reads and writes
- Chunking, Embedding, Retrieval → Ollama Embeddings: requests embeddings
- User → Quota Widget: views usage
- Quota Widget → Codex and Cursor: fetches quotas
- Quota Widget → Widget Settings and Secrets: loads and saves settings
