How zhyese/grid-qa works
This is a grid-operations RAG question-answering product with a Vue interface and FastAPI backend. Its primary workflow routes an operator’s question, searches and filters operational knowledge, corrects/augments evidence, and streams a cited answer; feedback and evidence gaps feed knowledge improvement. The README also documents document management, governance, operational workflows, graph knowledge, and real-time twin capabilities. Some subsystem links reflect README descriptions because their implementation was not sampled.
Main entry points: qa_service.py Answer orchestration · main.py FastAPI application · retrieval_service.py Hybrid retrieval · App.vue Vue application
Components 23
User experience
- Vue application
frontend/src/App.vue - FastAPI application
backend/app/main.py
Question answering
- QA endpoints
backend/app/routers/qa.py - Answer orchestration
backend/app/services/qa_service.py - Query routing
backend/app/routing/query_classifier.py - Hybrid retrieval
backend/app/services/retrieval_service.py - Complex query planning
backend/app/services/query_plan_service.py - RAG correction and citations
backend/app/rag - LLM providers and fallback
backend/app/providers/llm_router.py - Answer and semantic caches
Knowledge lifecycle
- Document ingestion and collaboration
backend/app/services/document_service.py - Knowledge governance
backend/app/services/knowledge_governance_service.py - Knowledge evolution
backend/app/services/knowledge_evolution_service.py - Answer feedback
backend/app/services/feedback_service.py - Knowledge graph
backend/app/services/kg_service.py
Operations tools
- Operations and diagnosis
- Workflow execution
backend/app/services/workflow_engine.py - Digital twin events
backend/app/services/twin_service.py
Platform integrations
- Knowledge stores
backend/app/clients - Real-time delivery
backend/app/core/ws_manager.py - MCP tool server
backend/app/mcp/server.py - LLM evaluation console
llm-user-suite/llm_user_suite/main.py
Other components
- Grid operator
Connections 24
- Grid operator → Vue application: asks question
- Vue application → FastAPI application: sends request
- FastAPI application → QA endpoints: dispatches
- QA endpoints → Answer orchestration: invokes
- Answer orchestration → Answer and semantic caches: checks cache
- Answer orchestration → Query routing: classifies query
- Answer orchestration → Hybrid retrieval: requests evidence
- Answer orchestration → Complex query planning: plans complex query
- Complex query planning → Hybrid retrieval: retrieves subqueries
- Hybrid retrieval → Knowledge stores: searches knowledge
- Hybrid retrieval → Knowledge governance: filters results
- Answer orchestration → RAG correction and citations: corrects and cites
- RAG correction and citations → Knowledge graph: adds graph context
- Answer orchestration → LLM providers and fallback: generates answer
- LLM providers and fallback → Vue application: streams response
- Document ingestion and collaboration → Knowledge stores: indexes documents
- Grid operator → Answer feedback: rates answer
- Answer feedback → Knowledge evolution: informs improvement
- Knowledge evolution → Document ingestion and collaboration: proposes knowledge
- FastAPI application → Operations and diagnosis: serves operations
- FastAPI application → Workflow execution: serves workflows
- FastAPI application → Digital twin events: serves twin data
- Digital twin events → Real-time delivery: publishes events
- FastAPI application → MCP tool server: exposes tools