# j2085123997/yuxi architecture

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

- Interactive diagram: https://gitdiagram.com/j2085123997/yuxi
- Repository: https://github.com/j2085123997/yuxi

## Overview

Yuxi is a self-hosted, multi-tenant knowledge-agent platform. Its main user journey is to submit a request in the workspace, have an Agent use knowledge retrieval and tools (including subagents where configured), then return a response or deliverable that can be previewed or downloaded. Separate product branches cover knowledge ingestion, graph exploration, evaluation, and team administration. The README documents these capabilities; the source excerpts provide only partial implementation evidence, so undocumented runtime links are omitted.

Main entry points: [`backend/package/yuxi/agents`](https://github.com/j2085123997/yuxi/tree/main/backend/package/yuxi/agents) (Agent runtime), [`backend/server/routers`](https://github.com/j2085123997/yuxi/tree/main/backend/server/routers) (FastAPI routers), [`backend/package/yuxi/knowledge/manager.py`](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/manager.py) (Knowledge ingestion), [`backend/server/routers/auth_dept_router.py`](https://github.com/j2085123997/yuxi/blob/main/backend/server/routers/auth_dept_router.py) (Users and departments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Agent workspace"]
  node_web["Web application<br/>[App.vue]"]
  node_chat_ui["Chat interface"]
  node_api["FastAPI routers"]
  node_chat_service["Chat service<br/>[chat_service.py]"]
end

subgraph group_knowledge["Knowledge services"]
  node_knowledge_ingest["Knowledge ingestion<br/>[manager.py]"]
  node_parsing_chunking["Parsing and chunking"]
  node_retrieval["Knowledge retrieval<br/>[base.py]"]
  node_graph_service["Knowledge graph"]
  node_evaluation["RAG evaluation<br/>[service.py]"]
  node_milvus[("Milvus<br/>[milvus.py]")]
  node_neo4j[("Neo4j<br/>[manager.py]")]
end

subgraph group_agents["Agent execution"]
  node_agent_runtime["Agent runtime"]
  node_subagents["Subagents<br/>[graph.py]"]
  node_extensions["Tools, Skills, MCP"]
end

subgraph group_delivery["Workspace delivery"]
  node_workspace_files["Sandbox workspace<br/>[filesystem.py]"]
  node_artifacts["Artifact delivery"]
end

subgraph group_governance["Team governance"]
  node_auth["Authentication<br/>[auth_middleware.py]"]
  node_admin["Users and departments"]
  node_permissions["Resource permissions"]
  node_postgres[("PostgreSQL<br/>[manager.py]")]
end

node_user(("User"))

node_user -->|"uses"| node_web
node_web -->|"opens chat"| node_chat_ui
node_chat_ui -->|"submits requests"| node_api
node_api -.->|"handles chat"| node_chat_service
node_chat_service -.->|"runs Agent"| node_agent_runtime
node_agent_runtime -->|"retrieves context"| node_retrieval
node_agent_runtime -->|"uses capabilities"| node_extensions
node_agent_runtime -->|"dispatches tasks"| node_subagents
node_retrieval -.->|"queries indexed knowledge"| node_knowledge_ingest
node_knowledge_ingest -->|"parses and chunks"| node_parsing_chunking
node_knowledge_ingest -->|"indexes chunks"| node_milvus
node_knowledge_ingest -->|"extracts relations"| node_graph_service
node_graph_service -->|"stores graph"| node_neo4j
node_evaluation -->|"evaluates retrieval"| node_retrieval
node_agent_runtime -->|"works with files"| node_workspace_files
node_workspace_files -->|"provides deliverables"| node_artifacts
node_api -->|"authenticates requests"| node_auth
node_api -->|"manages users"| node_admin
node_admin -->|"sets access scope"| node_permissions
node_auth -->|"checks user records"| node_postgres
node_admin -.->|"persists governance data"| node_postgres

click node_web "https://github.com/j2085123997/yuxi/blob/main/web/src/App.vue"
click node_chat_ui "https://github.com/j2085123997/yuxi/blob/main/web/src/components/AgentChatComponent.vue"
click node_api "https://github.com/j2085123997/yuxi/tree/main/backend/server/routers"
click node_chat_service "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/services/chat_service.py"
click node_agent_runtime "https://github.com/j2085123997/yuxi/tree/main/backend/package/yuxi/agents"
click node_subagents "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/agents/buildin/subagent/graph.py"
click node_extensions "https://github.com/j2085123997/yuxi/tree/main/backend/package/yuxi/agents/toolkits"
click node_knowledge_ingest "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/manager.py"
click node_parsing_chunking "https://github.com/j2085123997/yuxi/tree/main/backend/package/yuxi/knowledge/parser"
click node_retrieval "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/base.py"
click node_graph_service "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/graphs/milvus_graph_service.py"
click node_evaluation "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/eval/service.py"
click node_workspace_files "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/workspace/filesystem.py"
click node_artifacts "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/services/artifact_service.py"
click node_auth "https://github.com/j2085123997/yuxi/blob/main/backend/server/utils/auth_middleware.py"
click node_admin "https://github.com/j2085123997/yuxi/blob/main/backend/server/routers/auth_dept_router.py"
click node_permissions "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/permissions/resource_permission.py"
click node_postgres "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/storage/postgres/manager.py"
click node_milvus "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/implementations/milvus.py"
click node_neo4j "https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/storage/neo4j/manager.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_web,node_chat_ui,node_api,node_chat_service,node_user toneBlue
class node_knowledge_ingest,node_parsing_chunking,node_retrieval,node_graph_service,node_evaluation,node_milvus,node_neo4j toneAmber
class node_agent_runtime,node_subagents,node_extensions toneMint
class node_workspace_files,node_artifacts toneRose
class node_auth,node_admin,node_permissions,node_postgres toneIndigo
```

## Components

### Agent workspace

- [Web application](https://github.com/j2085123997/yuxi/blob/main/web/src/App.vue): `web/src/App.vue`
- [Chat interface](https://github.com/j2085123997/yuxi/blob/main/web/src/components/AgentChatComponent.vue): `web/src/components/AgentChatComponent.vue`
- [FastAPI routers](https://github.com/j2085123997/yuxi/tree/main/backend/server/routers): `backend/server/routers`
- [Chat service](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/services/chat_service.py): `backend/package/yuxi/services/chat_service.py`

### Knowledge services

- [Knowledge ingestion](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/manager.py): `backend/package/yuxi/knowledge/manager.py`
- [Parsing and chunking](https://github.com/j2085123997/yuxi/tree/main/backend/package/yuxi/knowledge/parser): `backend/package/yuxi/knowledge/parser`
- [Knowledge retrieval](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/base.py): `backend/package/yuxi/knowledge/base.py`
- [Knowledge graph](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/graphs/milvus_graph_service.py): `backend/package/yuxi/knowledge/graphs/milvus_graph_service.py`
- [RAG evaluation](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/eval/service.py): `backend/package/yuxi/knowledge/eval/service.py`
- [Milvus](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/knowledge/implementations/milvus.py): `backend/package/yuxi/knowledge/implementations/milvus.py`
- [Neo4j](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/storage/neo4j/manager.py): `backend/package/yuxi/storage/neo4j/manager.py`

### Agent execution

- [Agent runtime](https://github.com/j2085123997/yuxi/tree/main/backend/package/yuxi/agents): `backend/package/yuxi/agents`
- [Subagents](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/agents/buildin/subagent/graph.py): `backend/package/yuxi/agents/buildin/subagent/graph.py`
- [Tools, Skills, MCP](https://github.com/j2085123997/yuxi/tree/main/backend/package/yuxi/agents/toolkits): `backend/package/yuxi/agents/toolkits`

### Workspace delivery

- [Sandbox workspace](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/workspace/filesystem.py): `backend/package/yuxi/workspace/filesystem.py`
- [Artifact delivery](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/services/artifact_service.py): `backend/package/yuxi/services/artifact_service.py`

### Team governance

- [Authentication](https://github.com/j2085123997/yuxi/blob/main/backend/server/utils/auth_middleware.py): `backend/server/utils/auth_middleware.py`
- [Users and departments](https://github.com/j2085123997/yuxi/blob/main/backend/server/routers/auth_dept_router.py): `backend/server/routers/auth_dept_router.py`
- [Resource permissions](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/permissions/resource_permission.py): `backend/package/yuxi/permissions/resource_permission.py`
- [PostgreSQL](https://github.com/j2085123997/yuxi/blob/main/backend/package/yuxi/storage/postgres/manager.py): `backend/package/yuxi/storage/postgres/manager.py`

### Other components

- **User**

## Connections

- User → Web application: uses (evidence: `README.md`)
- Web application → Chat interface: opens chat (evidence: `README.md`)
- Chat interface → FastAPI routers: submits requests (evidence: `README.md`)
- FastAPI routers → Chat service: handles chat
- Chat service → Agent runtime: runs Agent
- Agent runtime → Knowledge retrieval: retrieves context (evidence: `README.md`)
- Agent runtime → Tools, Skills, MCP: uses capabilities (evidence: `README.md`)
- Agent runtime → Subagents: dispatches tasks (evidence: `README.md`)
- Knowledge retrieval → Knowledge ingestion: queries indexed knowledge (evidence: `backend/package/yuxi/knowledge/manager.py`)
- Knowledge ingestion → Parsing and chunking: parses and chunks (evidence: `README.md`)
- Knowledge ingestion → Milvus: indexes chunks (evidence: `README.md`)
- Knowledge ingestion → Knowledge graph: extracts relations (evidence: `README.md`)
- Knowledge graph → Neo4j: stores graph (evidence: `README.md`)
- RAG evaluation → Knowledge retrieval: evaluates retrieval (evidence: `README.md`)
- Agent runtime → Sandbox workspace: works with files (evidence: `README.md`)
- Sandbox workspace → Artifact delivery: provides deliverables (evidence: `README.md`)
- FastAPI routers → Authentication: authenticates requests (evidence: `backend/server/utils/auth_middleware.py`)
- FastAPI routers → Users and departments: manages users (evidence: `backend/server/routers/auth_dept_router.py`)
- Users and departments → Resource permissions: sets access scope (evidence: `README.md`)
- Authentication → PostgreSQL: checks user records (evidence: `backend/server/utils/auth_middleware.py`)
- Users and departments → PostgreSQL: persists governance data
