# baiye-banned/agent_about_answer architecture

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

- Interactive diagram: https://gitdiagram.com/baiye-banned/agent_about_answer
- Repository: https://github.com/baiye-banned/agent_about_answer

## Overview

This is an enterprise knowledge-base RAG question-answering platform. Users sign in, manage knowledge bases and files, then ask questions in multi-turn chat; the backend may interpret image attachments, build memory context, retrieve and rerank knowledge, stream an answer with sources and trace data, persist the exchange, and evaluate it asynchronously. The graph includes the documented ingestion, authentication, profile, and evaluation capabilities. Evidence is limited to the supplied README and source index excerpts; links for unsampled subsystems use documented README relationships.

Main entry points: [`backend/service/chat_service.py`](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/service/chat_service.py) (Chat orchestration), [`backend/main.py`](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/main.py) (FastAPI app), [`backend/model/models.py`](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/model/models.py) (MySQL data), [`src/views/Chat.vue`](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/views/Chat.vue) (Chat view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web client"]
  node_chatview["Chat view<br/>[Chat.vue]"]
  node_knowledgeview["Knowledge view<br/>[Knowledge.vue]"]
  node_authview["Login and profile<br/>[Login.vue]"]
  node_chatstore["Chat state<br/>[chat.js]"]
  node_knowstore["Knowledge state<br/>[knowledge.js]"]
  node_chatapi["Chat API<br/>[chat.js]"]
  node_knowledgeapi["Knowledge API<br/>[knowledge.js]"]
  node_streamparser["SSE parsing<br/>[streamEvents.js]"]
  node_markdown["Markdown display"]
  node_traceview["Trace display"]
end

subgraph group_api["API and services"]
  node_fastapi["FastAPI app<br/>[main.py]"]
  node_auth["Authentication<br/>[auth_service.py]"]
  node_chatservice["Chat orchestration<br/>[chat_service.py]"]
  node_knowservice["Knowledge management"]
end

subgraph group_rag["RAG processing"]
  node_vision["Image understanding<br/>[vision_service.py]"]
  node_memory["Conversation memory<br/>[memory_service.py]"]
  node_retrieval["Advanced retrieval<br/>[retrieval.py]"]
  node_llm["LLM operations<br/>[llm.py]"]
  node_evaluation["RAGAS evaluation<br/>[ragas_eval.py]"]
end

subgraph group_data["Persistence and files"]
  node_mysql[("MySQL data<br/>[models.py]")]
  node_milvusclient["Vector indexing<br/>[milvus_client.py]"]
  node_ossservice["Object storage service<br/>[oss_service.py]"]
end

subgraph group_integrations["External integrations"]
  node_milvus[("Milvus index")]
  node_oss[("OSS storage")]
  node_ai["Model providers"]
end

node_user(("User"))

node_user -->|"asks questions"| node_chatview
node_user -->|"manages files"| node_knowledgeview
node_user -->|"signs in"| node_authview
node_chatview -->|"updates state"| node_chatstore
node_chatstore -->|"requests chat"| node_chatapi
node_chatapi -->|"parses events"| node_streamparser
node_chatview -->|"renders answers"| node_markdown
node_chatview -->|"renders traces"| node_traceview
node_knowledgeview -->|"updates state"| node_knowstore
node_knowstore -->|"requests knowledge"| node_knowledgeapi
node_chatapi -->|"streams requests"| node_fastapi
node_knowledgeapi -->|"calls API"| node_fastapi
node_authview -->|"authenticates"| node_fastapi
node_fastapi -->|"routes auth"| node_auth
node_fastapi -->|"routes chat"| node_chatservice
node_fastapi -->|"routes knowledge"| node_knowservice
node_chatservice -->|"authenticates user"| node_auth
node_chatservice -->|"interprets images"| node_vision
node_chatservice -->|"builds context"| node_memory
node_chatservice -->|"requests retrieval"| node_retrieval
node_chatservice -->|"streams answer"| node_llm
node_chatservice -->|"evaluates saved answer"| node_evaluation
node_knowservice -->|"indexes chunks"| node_milvusclient
node_milvusclient -->|"writes and searches"| node_milvus
node_retrieval -->|"recalls vectors"| node_milvusclient
node_retrieval -->|"plans queries"| node_llm
node_llm -->|"calls models"| node_ai
node_memory -->|"summarizes context"| node_llm
node_vision -->|"loads attachments"| node_ossservice
node_ossservice -->|"stores objects"| node_oss
node_fastapi -->|"initializes schema"| node_mysql
node_auth -->|"checks user and tokens"| node_mysql
node_chatservice -->|"persists conversations"| node_mysql
node_knowservice -->|"persists file metadata"| node_mysql
node_memory -->|"reads and updates memory"| node_mysql
node_evaluation -->|"saves scores"| node_mysql

click node_chatview "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/views/Chat.vue"
click node_knowledgeview "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/views/Knowledge.vue"
click node_authview "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/views/Login.vue"
click node_chatstore "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/stores/chat.js"
click node_knowstore "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/stores/knowledge.js"
click node_chatapi "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/api/chat.js"
click node_knowledgeapi "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/api/knowledge.js"
click node_streamparser "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/utils/streamEvents.js"
click node_markdown "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/components/MarkdownRenderer.vue"
click node_traceview "https://github.com/baiye-banned/agent_about_answer/blob/develop/src/components/TraceVariableFlow.vue"
click node_fastapi "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/main.py"
click node_auth "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/service/auth_service.py"
click node_chatservice "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/service/chat_service.py"
click node_knowservice "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/service/knowledge_service.py"
click node_vision "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/vision_service.py"
click node_memory "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/memory_service.py"
click node_retrieval "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/retrieval.py"
click node_llm "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/llm.py"
click node_evaluation "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/ragas_eval.py"
click node_mysql "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/model/models.py"
click node_milvusclient "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/milvus_client.py"
click node_ossservice "https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/service/oss_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_chatview,node_knowledgeview,node_authview,node_chatstore,node_knowstore,node_chatapi,node_knowledgeapi,node_streamparser,node_markdown,node_traceview,node_user toneBlue
class node_fastapi,node_auth,node_chatservice,node_knowservice toneAmber
class node_vision,node_memory,node_retrieval,node_llm,node_evaluation toneMint
class node_mysql,node_milvusclient,node_ossservice toneRose
class node_milvus,node_oss,node_ai toneIndigo
```

## Components

### Web client

- [Chat view](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/views/Chat.vue): `src/views/Chat.vue`
- [Knowledge view](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/views/Knowledge.vue): `src/views/Knowledge.vue`
- [Login and profile](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/views/Login.vue): `src/views/Login.vue`
- [Chat state](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/stores/chat.js): `src/stores/chat.js`
- [Knowledge state](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/stores/knowledge.js): `src/stores/knowledge.js`
- [Chat API](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/api/chat.js): `src/api/chat.js`
- [Knowledge API](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/api/knowledge.js): `src/api/knowledge.js`
- [SSE parsing](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/utils/streamEvents.js): `src/utils/streamEvents.js`
- [Markdown display](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/components/MarkdownRenderer.vue): `src/components/MarkdownRenderer.vue`
- [Trace display](https://github.com/baiye-banned/agent_about_answer/blob/develop/src/components/TraceVariableFlow.vue): `src/components/TraceVariableFlow.vue`

### API and services

- [FastAPI app](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/main.py): `backend/main.py`
- [Authentication](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/service/auth_service.py): `backend/service/auth_service.py`
- [Chat orchestration](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/service/chat_service.py): `backend/service/chat_service.py`
- [Knowledge management](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/service/knowledge_service.py): `backend/service/knowledge_service.py`

### RAG processing

- [Image understanding](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/vision_service.py): `backend/rag/vision_service.py`
- [Conversation memory](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/memory_service.py): `backend/rag/memory_service.py`
- [Advanced retrieval](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/retrieval.py): `backend/rag/retrieval.py`
- [LLM operations](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/llm.py): `backend/rag/llm.py`
- [RAGAS evaluation](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/ragas_eval.py): `backend/rag/ragas_eval.py`

### Persistence and files

- [MySQL data](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/model/models.py): `backend/model/models.py`
- [Vector indexing](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/rag/milvus_client.py): `backend/rag/milvus_client.py`
- [Object storage service](https://github.com/baiye-banned/agent_about_answer/blob/develop/backend/service/oss_service.py): `backend/service/oss_service.py`

### External integrations

- **Milvus index**
- **OSS storage**
- **Model providers**

### Other components

- **User**

## Connections

- User → Chat view: asks questions
- User → Knowledge view: manages files
- User → Login and profile: signs in
- Chat view → Chat state: updates state (evidence: `src/views/Chat.vue`)
- Chat state → Chat API: requests chat (evidence: `src/stores/chat.js`)
- Chat API → SSE parsing: parses events (evidence: `src/api/chat.js`)
- Chat view → Markdown display: renders answers (evidence: `src/views/Chat.vue`)
- Chat view → Trace display: renders traces (evidence: `src/views/Chat.vue`)
- Knowledge view → Knowledge state: updates state (evidence: `src/views/Knowledge.vue`)
- Knowledge state → Knowledge API: requests knowledge (evidence: `src/stores/knowledge.js`)
- Chat API → FastAPI app: streams requests
- Knowledge API → FastAPI app: calls API
- Login and profile → FastAPI app: authenticates
- FastAPI app → Authentication: routes auth (evidence: `backend/main.py`)
- FastAPI app → Chat orchestration: routes chat (evidence: `backend/main.py`)
- FastAPI app → Knowledge management: routes knowledge (evidence: `backend/main.py`)
- Chat orchestration → Authentication: authenticates user (evidence: `backend/service/auth_service.py`)
- Chat orchestration → Image understanding: interprets images (evidence: `backend/service/chat_service.py`)
- Chat orchestration → Conversation memory: builds context (evidence: `backend/service/chat_service.py`)
- Chat orchestration → Advanced retrieval: requests retrieval (evidence: `backend/service/chat_service.py`)
- Chat orchestration → LLM operations: streams answer
- Chat orchestration → RAGAS evaluation: evaluates saved answer (evidence: `backend/service/chat_service.py`)
- Knowledge management → Vector indexing: indexes chunks (evidence: `backend/service/knowledge_service.py`)
- Vector indexing → Milvus index: writes and searches
- Advanced retrieval → Vector indexing: recalls vectors (evidence: `backend/rag/retrieval.py`)
- Advanced retrieval → LLM operations: plans queries (evidence: `backend/rag/retrieval.py`)
- LLM operations → Model providers: calls models
- Conversation memory → LLM operations: summarizes context (evidence: `backend/rag/memory_service.py`)
- Image understanding → Object storage service: loads attachments (evidence: `backend/rag/vision_service.py`)
- Object storage service → OSS storage: stores objects
- FastAPI app → MySQL data: initializes schema (evidence: `backend/main.py`)
- Authentication → MySQL data: checks user and tokens (evidence: `backend/service/auth_service.py`)
- Chat orchestration → MySQL data: persists conversations (evidence: `backend/service/chat_service.py`)
- Knowledge management → MySQL data: persists file metadata (evidence: `backend/service/knowledge_service.py`)
- Conversation memory → MySQL data: reads and updates memory (evidence: `backend/rag/memory_service.py`)
- RAGAS evaluation → MySQL data: saves scores
