How laaqshya/rag-bot works
Baahubali RAG Bot is a Streamlit chat application that answers questions from a franchise-specific knowledge base. Its main workflow accepts a user question, optionally asks for a subject and answer format, retrieves relevant chunks, generates an answer with Gemini, and saves the exchange. Separate capabilities include document ingestion, conversation history and feedback, and text-to-speech playback. The excerpts show the principal calls and storage behavior; the README is empty, and some UI and integration details are unsampled.
Main entry points: app.py Streamlit app · chroma_service.py Vector index service · ingest.py Document ingestion · rag_pipeline.py RAG coordinator
Components 17
Chat experience
- Streamlit app
RAG-BOT/app.py - Query clarification
RAG-BOT/app.py
Knowledge retrieval
- Document ingestion
RAG-BOT/ingest.py - Baahubali source
RAG-BOT/data/baahubali_source.txt - Section chunker
RAG-BOT/services/chunker.py - Vector index service
RAG-BOT/services/chroma_service.py - Chroma index
RAG-BOT/chroma_db - Chunk retriever
RAG-BOT/services/retriever.py
Answer generation
- RAG coordinator
RAG-BOT/services/rag_pipeline.py - Gemini client
RAG-BOT/services/gemini_client.py - Google Gemini
Persistence and audio
- Chat database service
RAG-BOT/services/database.py - SQLite chat history
RAG-BOT/database/chat_history.db - Speech synthesis
RAG-BOT/services/tts_service.py - gTTS service
- Audio cache
RAG-BOT/audio_cache
Other components
- User
Connections 18
- User → Streamlit app: asks question
RAG-BOT/app.py - Streamlit app → Query clarification: clarifies broad queries
RAG-BOT/app.py - Streamlit app → Document ingestion: starts ingestion
RAG-BOT/app.py - Document ingestion → Baahubali source: loads text
RAG-BOT/ingest.py - Document ingestion → Section chunker: chunks document
RAG-BOT/ingest.py - Section chunker → Vector index service: provides chunks
RAG-BOT/ingest.py - Vector index service → Chroma index: upserts chunks
RAG-BOT/services/chroma_service.py - Streamlit app → RAG coordinator: submits query
RAG-BOT/app.py - RAG coordinator → Chunk retriever: retrieves context
RAG-BOT/services/rag_pipeline.py - Chunk retriever → Vector index service: queries index
RAG-BOT/services/retriever.py - Vector index service → Chroma index: searches chunks
RAG-BOT/services/chroma_service.py - RAG coordinator → Gemini client: generates answer
RAG-BOT/services/rag_pipeline.py - Gemini client → Google Gemini: calls model
RAG-BOT/services/gemini_client.py - Streamlit app → Chat database service: loads and saves chats
RAG-BOT/app.py - Chat database service → SQLite chat history: reads and writes
RAG-BOT/services/database.py - Streamlit app → Speech synthesis: requests audio
RAG-BOT/app.py - Speech synthesis → gTTS service: synthesizes speech
RAG-BOT/services/tts_service.py - Speech synthesis → Audio cache: caches MP3
RAG-BOT/services/tts_service.py