How baiye-banned/agent_about_answer works
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: chat_service.py Chat orchestration · main.py FastAPI app · models.py MySQL data · Chat.vue Chat view
Components 26
Web client
- Chat view
src/views/Chat.vue - Knowledge view
src/views/Knowledge.vue - Login and profile
src/views/Login.vue - Chat state
src/stores/chat.js - Knowledge state
src/stores/knowledge.js - Chat API
src/api/chat.js - Knowledge API
src/api/knowledge.js - SSE parsing
src/utils/streamEvents.js - Markdown display
src/components/MarkdownRenderer.vue - Trace display
src/components/TraceVariableFlow.vue
API and services
- FastAPI app
backend/main.py - Authentication
backend/service/auth_service.py - Chat orchestration
backend/service/chat_service.py - Knowledge management
backend/service/knowledge_service.py
RAG processing
- Image understanding
backend/rag/vision_service.py - Conversation memory
backend/rag/memory_service.py - Advanced retrieval
backend/rag/retrieval.py - LLM operations
backend/rag/llm.py - RAGAS evaluation
backend/rag/ragas_eval.py
Persistence and files
- MySQL data
backend/model/models.py - Vector indexing
backend/rag/milvus_client.py - Object storage service
backend/service/oss_service.py
External integrations
- Milvus index
- OSS storage
- Model providers
Other components
- User
Connections 36
- User → Chat view: asks questions
- User → Knowledge view: manages files
- User → Login and profile: signs in
- Chat view → Chat state: updates state
src/views/Chat.vue - Chat state → Chat API: requests chat
src/stores/chat.js - Chat API → SSE parsing: parses events
src/api/chat.js - Chat view → Markdown display: renders answers
src/views/Chat.vue - Chat view → Trace display: renders traces
src/views/Chat.vue - Knowledge view → Knowledge state: updates state
src/views/Knowledge.vue - Knowledge state → Knowledge API: requests knowledge
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
backend/main.py - FastAPI app → Chat orchestration: routes chat
backend/main.py - FastAPI app → Knowledge management: routes knowledge
backend/main.py - Chat orchestration → Authentication: authenticates user
backend/service/auth_service.py - Chat orchestration → Image understanding: interprets images
backend/service/chat_service.py - Chat orchestration → Conversation memory: builds context
backend/service/chat_service.py - Chat orchestration → Advanced retrieval: requests retrieval
backend/service/chat_service.py - Chat orchestration → LLM operations: streams answer
- Chat orchestration → RAGAS evaluation: evaluates saved answer
backend/service/chat_service.py - Knowledge management → Vector indexing: indexes chunks
backend/service/knowledge_service.py - Vector indexing → Milvus index: writes and searches
- Advanced retrieval → Vector indexing: recalls vectors
backend/rag/retrieval.py - Advanced retrieval → LLM operations: plans queries
backend/rag/retrieval.py - LLM operations → Model providers: calls models
- Conversation memory → LLM operations: summarizes context
backend/rag/memory_service.py - Image understanding → Object storage service: loads attachments
backend/rag/vision_service.py - Object storage service → OSS storage: stores objects
- FastAPI app → MySQL data: initializes schema
backend/main.py - Authentication → MySQL data: checks user and tokens
backend/service/auth_service.py - Chat orchestration → MySQL data: persists conversations
backend/service/chat_service.py - Knowledge management → MySQL data: persists file metadata
backend/service/knowledge_service.py - Conversation memory → MySQL data: reads and updates memory
backend/rag/memory_service.py - RAGAS evaluation → MySQL data: saves scores