# gaojie618/agent-graph architecture

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

- Interactive diagram: https://gitdiagram.com/gaojie618/agent-graph
- Repository: https://github.com/gaojie618/agent-graph

## Overview

Agent-Graph is a visual multi-agent application for designing and running autonomous agents and structured workflows. A user configures agents, graphs, models, prompts, and tools in the frontend, then starts a conversation or scheduled graph run; execution coordinates model responses, tool calls, context, and persisted run state before returning results. The README also documents project and conversation management, exports, MCP integrations, memory, and team administration. Unsampled subsystems are represented by documented capabilities and tree paths; their internal call wiring is not asserted.

Main entry points: [`agent_graph/app/api/routes.py`](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/api/routes.py) (API routes), [`agent_graph/app/services/graph/graph_executor.py`](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/graph/graph_executor.py) (Graph execution), [`agent_graph/app/services/agent/agent_run_service.py`](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/agent/agent_run_service.py) (Agent execution), [`agent_graph/app/services/tool_execution/tool_executor.py`](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/tool_execution/tool_executor.py) (Tool dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_chat_ui["Chat workspace<br/>[ChatSystem.tsx]"]
  node_graph_ui["Graph editor"]
  node_manager_ui["Resource managers<br/>[AgentManager.tsx]"]
  node_frontend_api["Frontend API client<br/>[api.ts]"]
end

subgraph group_runtime["Agent runtime"]
  node_api["API routes<br/>[routes.py]"]
  node_agent_service["Agent execution"]
  node_graph_engine["Graph execution<br/>[graph_executor.py]"]
  node_run_state["Run conversations"]
  node_tool_execution["Tool dispatch<br/>[tool_executor.py]"]
end

subgraph group_capabilities["Platform capabilities"]
  node_model_service["Model service<br/>[model_service.py]"]
  node_memory_service["Long-term memory<br/>[memory_service.py]"]
  node_mcp_service["MCP integration<br/>[mcp_service.py]"]
  node_system_tools["Built-in tools<br/>[registry.py]"]
  node_prompt_service["Prompt center<br/>[prompt_service.py]"]
  node_project_service["Projects<br/>[project_service.py]"]
  node_task_service["Scheduled graphs<br/>[task_scheduler.py]"]
  node_export_service["Dataset export<br/>[export_service.py]"]
end

subgraph group_persistence["Persistence"]
  node_mongo[("MongoDB<br/>[client.py]")]
  node_object_storage[("MinIO storage<br/>[minio_client.py]")]
end

subgraph group_operations["Platform operations"]
  node_team_service["Team and accounts<br/>[team_service.py]"]
end

node_user(("User"))
node_model_provider{{"LLM / VLM provider"}}
node_mcp_servers{{"External MCP servers"}}

node_user -->|"configures and chats"| node_chat_ui
node_user -->|"designs workflows"| node_graph_ui
node_user -->|"manages resources"| node_manager_ui
node_chat_ui -->|"sends requests"| node_frontend_api
node_graph_ui -->|"saves graphs"| node_frontend_api
node_manager_ui -->|"manages resources"| node_frontend_api
node_frontend_api -->|"calls endpoints"| node_api
node_api -->|"starts agent runs"| node_agent_service
node_api -->|"starts graph runs"| node_graph_engine
node_graph_engine -->|"reads and updates state"| node_run_state
node_agent_service -->|"requests model responses"| node_model_service
node_graph_engine -->|"runs agent nodes"| node_model_service
node_agent_service -->|"dispatches tools"| node_tool_execution
node_graph_engine -->|"dispatches node tools"| node_tool_execution
node_tool_execution -->|"dispatches built-ins"| node_system_tools
node_tool_execution -->|"dispatches MCP tools"| node_mcp_service
node_model_service -.->|"requests completions"| node_model_provider
node_mcp_service -.->|"connects to tools"| node_mcp_servers
node_agent_service -->|"uses long-term memory"| node_memory_service
node_api -->|"manages prompts"| node_prompt_service
node_api -->|"manages projects"| node_project_service
node_task_service -->|"schedules graph runs"| node_graph_engine
node_api -->|"requests exports"| node_export_service
node_run_state -->|"persists run state"| node_mongo
node_memory_service -->|"stores memories"| node_mongo
node_project_service -->|"stores project data"| node_mongo
node_project_service -->|"stores shared files"| node_object_storage
node_api -->|"manages team access"| node_team_service
node_team_service -->|"stores account data"| node_mongo

click node_chat_ui "https://github.com/gaojie618/agent-graph/blob/main/frontend/src/pages/ChatSystem.tsx"
click node_graph_ui "https://github.com/gaojie618/agent-graph/blob/main/frontend/src/components/graph-editor/GraphEditorView.tsx"
click node_manager_ui "https://github.com/gaojie618/agent-graph/blob/main/frontend/src/pages/AgentManager.tsx"
click node_frontend_api "https://github.com/gaojie618/agent-graph/blob/main/frontend/src/services/api.ts"
click node_api "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/api/routes.py"
click node_agent_service "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/agent/agent_run_service.py"
click node_graph_engine "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/graph/graph_executor.py"
click node_run_state "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/graph/conversation_manager.py"
click node_tool_execution "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/tool_execution/tool_executor.py"
click node_model_service "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/model/model_service.py"
click node_memory_service "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/memory/memory_service.py"
click node_mcp_service "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/mcp/mcp_service.py"
click node_system_tools "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/system_tools/registry.py"
click node_prompt_service "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/prompt/prompt_service.py"
click node_project_service "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/project/project_service.py"
click node_task_service "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/task/task_scheduler.py"
click node_export_service "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/export/export_service.py"
click node_mongo "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/infrastructure/database/mongodb/client.py"
click node_object_storage "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/infrastructure/storage/object_storage/minio_client.py"
click node_team_service "https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/user/team_service.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_chat_ui,node_graph_ui,node_manager_ui,node_frontend_api,node_user toneBlue
class node_api,node_agent_service,node_graph_engine,node_run_state,node_tool_execution toneAmber
class node_model_service,node_memory_service,node_mcp_service,node_system_tools,node_prompt_service,node_project_service,node_task_service,node_export_service,node_mcp_servers toneMint
class node_mongo,node_object_storage toneRose
class node_team_service,node_model_provider toneIndigo
```

## Components

### User experience

- [Chat workspace](https://github.com/gaojie618/agent-graph/blob/main/frontend/src/pages/ChatSystem.tsx): `frontend/src/pages/ChatSystem.tsx`
- [Graph editor](https://github.com/gaojie618/agent-graph/blob/main/frontend/src/components/graph-editor/GraphEditorView.tsx): `frontend/src/components/graph-editor/GraphEditorView.tsx`
- [Resource managers](https://github.com/gaojie618/agent-graph/blob/main/frontend/src/pages/AgentManager.tsx): `frontend/src/pages/AgentManager.tsx`
- [Frontend API client](https://github.com/gaojie618/agent-graph/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Agent runtime

- [API routes](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/api/routes.py): `agent_graph/app/api/routes.py`
- [Agent execution](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/agent/agent_run_service.py): `agent_graph/app/services/agent/agent_run_service.py`
- [Graph execution](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/graph/graph_executor.py): `agent_graph/app/services/graph/graph_executor.py`
- [Run conversations](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/graph/conversation_manager.py): `agent_graph/app/services/graph/conversation_manager.py`
- [Tool dispatch](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/tool_execution/tool_executor.py): `agent_graph/app/services/tool_execution/tool_executor.py`

### Platform capabilities

- [Model service](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/model/model_service.py): `agent_graph/app/services/model/model_service.py`
- [Long-term memory](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/memory/memory_service.py): `agent_graph/app/services/memory/memory_service.py`
- [MCP integration](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/mcp/mcp_service.py): `agent_graph/app/services/mcp/mcp_service.py`
- [Built-in tools](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/system_tools/registry.py): `agent_graph/app/services/system_tools/registry.py`
- [Prompt center](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/prompt/prompt_service.py): `agent_graph/app/services/prompt/prompt_service.py`
- [Projects](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/project/project_service.py): `agent_graph/app/services/project/project_service.py`
- [Scheduled graphs](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/task/task_scheduler.py): `agent_graph/app/services/task/task_scheduler.py`
- [Dataset export](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/export/export_service.py): `agent_graph/app/services/export/export_service.py`

### Persistence

- [MongoDB](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/infrastructure/database/mongodb/client.py): `agent_graph/app/infrastructure/database/mongodb/client.py`
- [MinIO storage](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/infrastructure/storage/object_storage/minio_client.py): `agent_graph/app/infrastructure/storage/object_storage/minio_client.py`

### Platform operations

- [Team and accounts](https://github.com/gaojie618/agent-graph/blob/main/agent_graph/app/services/user/team_service.py): `agent_graph/app/services/user/team_service.py`

### Other components

- **User**
- **LLM / VLM provider**
- **External MCP servers**

## Connections

- User → Chat workspace: configures and chats
- User → Graph editor: designs workflows
- User → Resource managers: manages resources
- Chat workspace → Frontend API client: sends requests
- Graph editor → Frontend API client: saves graphs
- Resource managers → Frontend API client: manages resources
- Frontend API client → API routes: calls endpoints
- API routes → Agent execution: starts agent runs
- API routes → Graph execution: starts graph runs
- Graph execution → Run conversations: reads and updates state
- Agent execution → Model service: requests model responses
- Graph execution → Model service: runs agent nodes
- Agent execution → Tool dispatch: dispatches tools
- Graph execution → Tool dispatch: dispatches node tools
- Tool dispatch → Built-in tools: dispatches built-ins
- Tool dispatch → MCP integration: dispatches MCP tools
- Model service → LLM / VLM provider: requests completions
- MCP integration → External MCP servers: connects to tools
- Agent execution → Long-term memory: uses long-term memory
- API routes → Prompt center: manages prompts
- API routes → Projects: manages projects
- Scheduled graphs → Graph execution: schedules graph runs
- API routes → Dataset export: requests exports
- Run conversations → MongoDB: persists run state
- Long-term memory → MongoDB: stores memories
- Projects → MongoDB: stores project data
- Projects → MinIO storage: stores shared files
- API routes → Team and accounts: manages team access
- Team and accounts → MongoDB: stores account data
