How v1629/kiet_buddy works
KIET Buddy is a campus-information chatbot with a React chat client and FastAPI service over a Python RAG backend. A user submits a question; the client consumes streamed answer events while the backend routes the query to general, analytical, or text retrieval/generation paths. The knowledge base is built from JSON into vector and tabular indexes. The README describes capabilities such as caching, hybrid search, reranking, and faithfulness checks; some are represented within the pipeline components because their individual implementations are not fully excerpted.
Main entry points: App.jsx Chat app · main.py Chat API · orchestrator.py Query pipeline · indexer.py Data indexing
Components 20
Chat client
- Chat app
frontend/src/App.jsx - Chat stream
frontend/src/hooks/useChat.js - Status hook
frontend/src/hooks/useStatus.js - API client
frontend/src/services/api.js - Chat views
frontend/src/components/ChatMessage.jsx - Message list
frontend/src/components/MessageList.jsx - Status guard
frontend/src/components/StatusGuard.jsx - Sidebar
frontend/src/components/Sidebar.jsx
HTTP service
- Chat API
backend/server/main.py
Query processing
- Query pipeline
backend/pipeline/orchestrator.py - Hybrid retrieval
backend/retrieval/retriever.py - Web fallback
backend/retrieval/web_search.py - Answer generation
backend/generation/generator.py
Knowledge base
- Data indexing
backend/indexing/indexer.py - Index storage
backend/storage/store.py
Other components
- Chat user
- Qdrant
- DuckDB
- LLM service
- Cohere services
Connections 24
- Chat user → Chat app: asks
- Chat app → Chat stream: uses
frontend/src/App.jsx - Chat app → Status hook: checks status
frontend/src/App.jsx - Chat app → Status guard: guards view
frontend/src/App.jsx - Chat app → Sidebar: renders
frontend/src/App.jsx - Chat app → Message list: renders
frontend/src/App.jsx - Status hook → API client: fetches status
frontend/src/hooks/useStatus.js - Chat stream → Chat API: posts and streams
frontend/src/hooks/useChat.js - API client → Chat API: calls endpoints
frontend/src/services/api.js - Message list → Chat views: renders messages
frontend/src/components/MessageList.jsx - Chat views → Chat views: renders details
frontend/src/components/ChatMessage.jsx - Chat API → Query pipeline: runs query
backend/server/main.py - Chat API → Data indexing: rebuilds indexes
backend/server/main.py - Chat API → Index storage: checks index state
backend/server/main.py - Query pipeline → Hybrid retrieval: retrieves context
backend/pipeline/orchestrator.py - Query pipeline → Web fallback: searches fallback
backend/pipeline/orchestrator.py - Query pipeline → Answer generation: generates answers
backend/pipeline/orchestrator.py - Data indexing → Index storage: uses storage
backend/indexing/indexer.py - Hybrid retrieval → Qdrant: queries vectors
- Data indexing → Qdrant: builds collection
- Data indexing → DuckDB: creates tables
backend/indexing/indexer.py - Answer generation → DuckDB: executes SQL
backend/generation/generator.py - Hybrid retrieval → Cohere services: embeds and reranks
- Answer generation → LLM service: requests completions
backend/generation/generator.py