How jason-hooo/isrc-rag-bot works
原寶 is a Chainlit conversational assistant for NCCU’s Indigenous Student Resource Center. Users choose Campus Resources or Indigenous Issues, ask questions over multiple turns, and receive streamed answers with source excerpts. The backend builds or loads a metadata-tagged Qdrant index from local documents, then uses an agent to decide whether to retrieve; resource questions can be category-filtered and fall back to broader search. Conversation turns are logged to Google Sheets. The graph reflects README-described capabilities where source excerpts are incomplete; some internal wiring is therefore left unspecified.
Main entry points: rag.py Filtered retrieval · app.py Chat interface · sheets_logger.py Sheets logger
Components 21
Chat experience
- Chat interface
app.py - Topic selection
app.py - Stream and cite
app.py - Turn logging
app.py
RAG workflow
- Multi-turn service
src/rag.py - Agent workflow
src/rag.py - Category classification
src/rag.py - Knowledge-base tool
src/rag.py - Filtered retrieval
src/rag.py - Global fallback
src/rag.py - Result reranking
src/rag.py
Knowledge indexing
- Document indexing
src/rag.py - Topic and category metadata
src/rag.py
External services
- Qdrant vector store
- Jina embeddings
- Jina reranker
- Gemini model
- Sheets logger
src/sheets_logger.py - Google Sheets
Other components
- Student or faculty
- ISRC source documents
Connections 23
- Student or faculty → Chat interface: asks
- Chat interface → Topic selection: offers topics
- Topic selection → Multi-turn service: creates session
- Chat interface → Multi-turn service: sends question
- Multi-turn service → Agent workflow: runs workflow
- Agent workflow → Category classification: classifies resources
- Agent workflow → Knowledge-base tool: calls when needed
- Knowledge-base tool → Filtered retrieval: searches topic
- Filtered retrieval → Qdrant vector store: queries vectors
- Qdrant vector store → Filtered retrieval: returns matches
- Filtered retrieval → Global fallback: broadens search
- Filtered retrieval → Result reranking: ranks matches
- Result reranking → Jina reranker: uses model
- Document indexing → ISRC source documents: loads files
- Document indexing → Topic and category metadata: assigns labels
- Document indexing → Jina embeddings: embeds chunks
- Document indexing → Qdrant vector store: writes index
- Agent workflow → Gemini model: generates response
- Multi-turn service → Stream and cite: streams answer and sources
- Stream and cite → Student or faculty: displays response
- Chat interface → Turn logging: records completed turn
- Turn logging → Sheets logger: calls logger
- Sheets logger → Google Sheets: appends row