How xerrors/yuxi-know works
Project Overview & Main Components
• Purpose & Domain:
– The system integrates large language model (LLM) techniques with both a knowledge base and a Neo4j‐based knowledge graph.
– It is designed as a multi-model question/answer platform that supports several conversational models (OpenAI, SiliconFlow, Deepseek, etc.) and various document types.
• Primary Components to Represent:
a. Frontend: The Vue.js web interface (found under the “web” directory) that provides the UI.
b. Backend/API Server: Built using FastAPI (located in “src”, with the main entry in “src/main.py”) which provides the core business logic, routing (in “src/routers”), and agent frameworks (in “src/agents”).
c. Agents & Models: The “src/agents” and “src/models” directories encapsulate components such as chatbots, reactive agents, and integration with multiple language models.
d. External Services & Databases:
– Neo4j for the knowledge graph (configured and deployed via Docker in docker-compose files).
– Vector database support (and potential Milvus integration) for handling embeddings and document retrieval.
– External LLM APIs (e.g., SiliconFlow, OpenAI, Deepseek, etc.) used via API_KEY configurations.
e. Containerization & Deployment: Docker configuration files (in the “docker” folder and docker-compose YAML files) indicate a container-driven deployment with separate services for API, web frontend, and graph services.
f. Auxiliary Scripts & Tools: Scripts for managing model downloads, running deployment, and testing (in “scripts”), plus documentation (in “docs”).
Analyzing the File Structure & Architectural Patterns
• Modular Structure:
– The “src” folder encapsulates the backend logic, broken into submodules:
• “agents” for different conversational and reactive components.
• “core” for fundamental functions such as history, indexing, and knowledge base management.
• “models” for interfacing with different LLM providers.
• “routers” for API endpoints (chat, data, tools) showing a separation of concerns using routing.
– The clear differentiation between “src” and “web” demonstrates the separation of backend and frontend responsibilities.
• Containerization:
– Docker-related files (Dockerfiles for “api” and “web”, docker-compose YAML files) imply that each major service (API, Frontend, perhaps even Neo4j) is containerized individually.
– The inclusion of nginx configuration (in docker/nginx) suggests there is a reverse proxy/load balancing layer.
• External Integration:
– Environment configuration (via “src/.env.template”) and dynamic model configuration (through “src/static/models.yaml”) highlights that the backend is designed to support multiple external language model services and local model deployments (vllm, ollama integrations in “scripts/vllm”).
Final Recommendations
– Start by sketching high-level blocks (frontend, backend, databases, external services).
– Break down each block into subcomponents (e.g., the backend’s agents, models, routers).
– Ensure each component’s responsibilities, interactions, and technologies (FastAPI, Vue.js, Neo4j, Docker) are clearly labeled.
Happy diagramming!