# simpleyyt/ai-manus architecture

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

- Interactive diagram: https://gitdiagram.com/simpleyyt/ai-manus
- Repository: https://github.com/simpleyyt/ai-manus

## Overview

AI Manus is a web-based general-purpose agent that runs tool-using tasks in isolated sandboxes. The primary workflow starts in the chat UI, creates or selects a session, submits a message, and runs a plan-and-execute agent that can use browser, shell, file, search, messaging, and MCP tools; events stream back to the web client. Other major product areas include authentication, skill packages, session/project history, and a cross-session file library. Relationships shown here follow the README workflow and the sampled backend/frontend references; unsampled subsystem details are represented at directory level.

Main entry points: [`backend/app/infrastructure/repositories/mongo_session_repository.py`](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/infrastructure/repositories/mongo_session_repository.py) (Session history), [`backend/app/application/services/agent_service.py`](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/application/services/agent_service.py) (Agent service), [`backend/app/domain/services/tools`](https://github.com/simpleyyt/ai-manus/tree/main/backend/app/domain/services/tools) (Agent tools), [`frontend/src/pages/ChatPage.vue`](https://github.com/simpleyyt/ai-manus/blob/main/frontend/src/pages/ChatPage.vue) (Chat and panels)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_chat_ui["Chat and panels<br/>[ChatPage.vue]"]
  node_web_api["Web API clients<br/>[chatWs.ts]"]
  node_preview["File preview<br/>[FilePreviewer.vue]"]
end

subgraph group_api["Server API"]
  node_api_routes["HTTP API routes<br/>[routes.py]"]
  node_session_routes["Session endpoints<br/>[session_routes.py]"]
  node_ws_routes["WebSocket events<br/>[ws_routes.py]"]
  node_dependencies["Service wiring<br/>[dependencies.py]"]
  node_auth_routes["Authentication<br/>[auth_routes.py]"]
end

subgraph group_agent["Agent runtime"]
  node_agent_service["Agent service<br/>[agent_service.py]"]
  node_domain_service["Session orchestration"]
  node_task_runner["Task runner"]
  node_agent_flows["Plan-act execution<br/>[plan_act.py]"]
  node_agent_tools["Agent tools"]
  node_skill_runtime["Skill runtime"]
end

subgraph group_integrations["Tools and sandbox"]
  node_sandbox["Sandbox service<br/>[docker_sandbox.py]"]
  node_sandbox_api["Sandbox tools API<br/>[router.py]"]
  node_llm["Language model"]
  node_search["Web search"]
end

subgraph group_state["Identity and state"]
  node_auth_service["Auth service<br/>[auth_service.py]"]
  node_session_store[("Session history")]
  node_project_skill_library["Projects, skills, library"]
end

node_user(("User"))
node_mongo[("MongoDB")]
node_redis[("Redis")]
node_browser["Browser service"]
node_external_search["Search providers"]

node_user -->|"starts task"| node_chat_ui
node_chat_ui -->|"submits messages"| node_web_api
node_web_api -->|"creates session"| node_session_routes
node_session_routes -->|"delegates requests"| node_agent_service
node_agent_service -->|"orchestrates task"| node_domain_service
node_domain_service -->|"runs task"| node_task_runner
node_task_runner -->|"executes plan"| node_agent_flows
node_agent_flows -->|"requests decisions"| node_llm
node_agent_flows -->|"invokes tools"| node_agent_tools
node_agent_tools -->|"uses sandbox"| node_sandbox
node_sandbox -->|"controls tools"| node_sandbox_api
node_agent_tools -->|"runs searches"| node_search
node_search -->|"queries provider"| node_external_search
node_agent_tools -->|"uses browser"| node_browser
node_agent_service -->|"persists sessions"| node_session_store
node_session_store -->|"stores history"| node_mongo
node_ws_routes -->|"streams events"| node_web_api
node_ws_routes -->|"catches up history"| node_session_store
node_user -->|"authenticates"| node_auth_routes
node_auth_routes -->|"resolves credentials"| node_auth_service
node_auth_service -->|"reads users"| node_session_store
node_auth_service -->|"stores auth sessions"| node_redis
node_chat_ui -->|"previews artifacts"| node_preview
node_agent_service -.->|"loads skills"| node_skill_runtime
node_user -->|"manages resources"| node_project_skill_library
node_project_skill_library -.->|"organizes sessions"| node_session_store

click node_chat_ui "https://github.com/simpleyyt/ai-manus/blob/main/frontend/src/pages/ChatPage.vue"
click node_web_api "https://github.com/simpleyyt/ai-manus/blob/main/frontend/src/api/chatWs.ts"
click node_preview "https://github.com/simpleyyt/ai-manus/blob/main/frontend/src/components/FilePreviewer.vue"
click node_api_routes "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/api/routes.py"
click node_session_routes "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/api/session_routes.py"
click node_ws_routes "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/api/ws_routes.py"
click node_dependencies "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/dependencies.py"
click node_agent_service "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/application/services/agent_service.py"
click node_domain_service "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/domain/services/agent_domain_service.py"
click node_task_runner "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/domain/services/agent_task_runner.py"
click node_agent_flows "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/domain/services/flows/plan_act.py"
click node_agent_tools "https://github.com/simpleyyt/ai-manus/tree/main/backend/app/domain/services/tools"
click node_skill_runtime "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/application/services/skill_runtime_service.py"
click node_sandbox "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/infrastructure/external/sandbox/docker_sandbox.py"
click node_sandbox_api "https://github.com/simpleyyt/ai-manus/blob/main/sandbox/app/api/router.py"
click node_llm "https://github.com/simpleyyt/ai-manus/tree/main/backend/app/infrastructure/external/llm"
click node_search "https://github.com/simpleyyt/ai-manus/tree/main/backend/app/infrastructure/external/search"
click node_auth_routes "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/api/auth_routes.py"
click node_auth_service "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/application/services/auth_service.py"
click node_session_store "https://github.com/simpleyyt/ai-manus/blob/main/backend/app/infrastructure/repositories/mongo_session_repository.py"
click node_project_skill_library "https://github.com/simpleyyt/ai-manus/tree/main/backend/app/application/services"

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_chat_ui,node_web_api,node_preview,node_user,node_browser toneBlue
class node_api_routes,node_session_routes,node_ws_routes,node_dependencies,node_auth_routes,node_mongo,node_redis toneAmber
class node_agent_service,node_domain_service,node_task_runner,node_agent_flows,node_agent_tools,node_skill_runtime toneMint
class node_sandbox,node_sandbox_api,node_llm,node_search toneRose
class node_auth_service,node_session_store,node_project_skill_library,node_external_search toneIndigo
```

## Components

### Web experience

- [Chat and panels](https://github.com/simpleyyt/ai-manus/blob/main/frontend/src/pages/ChatPage.vue): `frontend/src/pages/ChatPage.vue`
- [Web API clients](https://github.com/simpleyyt/ai-manus/blob/main/frontend/src/api/chatWs.ts): `frontend/src/api/chatWs.ts`
- [File preview](https://github.com/simpleyyt/ai-manus/blob/main/frontend/src/components/FilePreviewer.vue): `frontend/src/components/FilePreviewer.vue`

### Server API

- [HTTP API routes](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/api/routes.py): `backend/app/interfaces/api/routes.py`
- [Session endpoints](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/api/session_routes.py): `backend/app/interfaces/api/session_routes.py`
- [WebSocket events](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/api/ws_routes.py): `backend/app/interfaces/api/ws_routes.py`
- [Service wiring](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/dependencies.py): `backend/app/interfaces/dependencies.py`
- [Authentication](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/interfaces/api/auth_routes.py): `backend/app/interfaces/api/auth_routes.py`

### Agent runtime

- [Agent service](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/application/services/agent_service.py): `backend/app/application/services/agent_service.py`
- [Session orchestration](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/domain/services/agent_domain_service.py): `backend/app/domain/services/agent_domain_service.py`
- [Task runner](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/domain/services/agent_task_runner.py): `backend/app/domain/services/agent_task_runner.py`
- [Plan-act execution](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/domain/services/flows/plan_act.py): `backend/app/domain/services/flows/plan_act.py`
- [Agent tools](https://github.com/simpleyyt/ai-manus/tree/main/backend/app/domain/services/tools): `backend/app/domain/services/tools`
- [Skill runtime](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/application/services/skill_runtime_service.py): `backend/app/application/services/skill_runtime_service.py`

### Tools and sandbox

- [Sandbox service](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/infrastructure/external/sandbox/docker_sandbox.py): `backend/app/infrastructure/external/sandbox/docker_sandbox.py`
- [Sandbox tools API](https://github.com/simpleyyt/ai-manus/blob/main/sandbox/app/api/router.py): `sandbox/app/api/router.py`
- [Language model](https://github.com/simpleyyt/ai-manus/tree/main/backend/app/infrastructure/external/llm): `backend/app/infrastructure/external/llm`
- [Web search](https://github.com/simpleyyt/ai-manus/tree/main/backend/app/infrastructure/external/search): `backend/app/infrastructure/external/search`

### Identity and state

- [Auth service](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/application/services/auth_service.py): `backend/app/application/services/auth_service.py`
- [Session history](https://github.com/simpleyyt/ai-manus/blob/main/backend/app/infrastructure/repositories/mongo_session_repository.py): `backend/app/infrastructure/repositories/mongo_session_repository.py`
- [Projects, skills, library](https://github.com/simpleyyt/ai-manus/tree/main/backend/app/application/services): `backend/app/application/services`

### Other components

- **User**
- **MongoDB**
- **Redis**
- **Browser service**
- **Search providers**

## Connections

- User → Chat and panels: starts task (evidence: `README.md`)
- Chat and panels → Web API clients: submits messages (evidence: `README.md`)
- Web API clients → Session endpoints: creates session (evidence: `README.md`)
- Session endpoints → Agent service: delegates requests (evidence: `backend/app/interfaces/api/session_routes.py`)
- Agent service → Session orchestration: orchestrates task (evidence: `backend/app/domain/services/agent_domain_service.py`)
- Session orchestration → Task runner: runs task (evidence: `backend/app/domain/services/agent_domain_service.py`)
- Task runner → Plan-act execution: executes plan (evidence: `README.md`)
- Plan-act execution → Language model: requests decisions (evidence: `README.md`)
- Plan-act execution → Agent tools: invokes tools (evidence: `README.md`)
- Agent tools → Sandbox service: uses sandbox (evidence: `README.md`)
- Sandbox service → Sandbox tools API: controls tools (evidence: `README.md`)
- Agent tools → Web search: runs searches (evidence: `README.md`)
- Web search → Search providers: queries provider
- Agent tools → Browser service: uses browser (evidence: `README.md`)
- Agent service → Session history: persists sessions
- Session history → MongoDB: stores history (evidence: `README.md`)
- WebSocket events → Web API clients: streams events (evidence: `README.md`)
- WebSocket events → Session history: catches up history (evidence: `backend/app/interfaces/api/ws_routes.py`)
- User → Authentication: authenticates (evidence: `README.md`)
- Authentication → Auth service: resolves credentials (evidence: `backend/app/interfaces/api/auth_routes.py`)
- Auth service → Session history: reads users (evidence: `backend/app/application/services/auth_service.py`)
- Auth service → Redis: stores auth sessions (evidence: `backend/app/application/services/auth_service.py`)
- Chat and panels → File preview: previews artifacts (evidence: `README.md`)
- Agent service → Skill runtime: loads skills
- User → Projects, skills, library: manages resources (evidence: `README.md`)
- Projects, skills, library → Session history: organizes sessions
