How albiehao/nonjingai works
QianXun is an AI knowledge and agricultural analysis platform. Users enter through the Vue interface to ask questions or manage knowledge bases, while FastAPI routes requests to agent workflows and knowledge services; answers can draw on retrieval, graph context, external search, and specialist tools. Separate product branches cover document ingestion, visual detection, knowledge-graph exploration, and crop administration. The README documents those capabilities, but sampled code does not expose all route-to-service wiring, so uncertain connections are omitted; crop-management backend implementation is not present in the supplied tree.
Main entry points: manager.py Knowledge manager · App.vue Vue application · toolkits Agent toolkits · main.py FastAPI application
Components 28
Web interface
- Vue application
web/src/App.vue - Agent chat UI
web/src/components/AgentChatComponent.vue - Stream handling
web/src/composables/useAgentStreamHandler.js - Knowledge UI
web/src/components/QuerySection.vue - Graph explorer
web/src/components/GraphCanvas.vue - Crop administration
web/src/views/CropAdminView.vue
API and services
- FastAPI application
server/main.py - Chat endpoints
server/routers/chat_router.py - Knowledge endpoints
server/routers/knowledge_router.py - Graph endpoints
server/routers/graph_router.py - Crop endpoints
server/routers/crop_router.py
Knowledge and agents
- Chat agent graph
src/agents/chatbot/graph.py - Agent toolkits
src/agents/common/toolkits - Knowledge manager
src/knowledge/manager.py - Document indexing
src/knowledge/indexing.py - Document parsers
src/plugins/document_processor_factory.py - Crop agent
src/agents/crop_agent/graph.py
Data and integrations
- PostgreSQL
src/storage/postgres/manager.py - Repositories
src/repositories/conversation_repository.py - MinIO storage
src/storage/minio/client.py - Vector search
src/knowledge/implementations/milvus.py - LightRAG graph
src/knowledge/implementations/lightrag.py - Model providers
- Tavily search
- YOLO detection
yolo/main.py
Agriculture features
- Crop records
src/storage/postgres/models_crop.py - Crop API client
web/src/apis/crop_manager.js
Other components
- Platform user
Connections 31
- Platform user → Vue application: uses
- Vue application → Agent chat UI: renders
- Vue application → Knowledge UI: renders
- Vue application → Graph explorer: renders
- Vue application → Crop administration: renders
- Agent chat UI → Chat endpoints: sends chat
- Stream handling → Agent chat UI: updates stream
- Knowledge UI → Knowledge endpoints: queries API
- Graph explorer → Graph endpoints: requests graph
- Crop administration → Crop API client: manages crops
- Crop API client → Crop endpoints: calls API
- FastAPI application → Chat endpoints: dispatches
- FastAPI application → Knowledge endpoints: dispatches
- FastAPI application → Graph endpoints: dispatches
- FastAPI application → Crop endpoints: dispatches
- Chat endpoints → Chat agent graph: agent workflow
- Knowledge endpoints → Knowledge manager: manages knowledge
- Chat agent graph → Agent toolkits: invokes tools
- Chat agent graph → Model providers: generates response
- Agent toolkits → Knowledge manager: retrieves knowledge
- Agent toolkits → Tavily search: web search
- Agent toolkits → YOLO detection: image detection
- Knowledge manager → Document indexing: indexes documents
- Document indexing → Document parsers: parses files
- Knowledge manager → Vector search: vector retrieval
- Knowledge manager → LightRAG graph: graph retrieval
- Knowledge manager → MinIO storage: file storage
- Chat endpoints → Repositories: loads history
- Repositories → PostgreSQL: reads and writes
- Crop endpoints → Crop records: crop records
- Crop agent → Agent toolkits: uses tools