How taheryhaia2/chatbot-based-on-rag-architecture works
This is a Streamlit administrative assistant for asking questions about institutional PDFs. Its main workflow is PDF ingestion and indexing, followed by hybrid retrieval and a locally hosted Mistral answer with source context. The app also provides salted-password authentication, session history, and optional speech output. The sampled code is partial and places the application in one file; several capabilities and connections are therefore based on README documentation rather than inspected implementations. gTTS is an optional integration and is not local.
Main entry points: chat.py Streamlit app
Components 17
Chat Interface
- Streamlit app
chat.py - Question handling
chat.py - Source display
chat.py - Speech output
chat.py
Document RAG
- PDF ingestion
chat.py - Semantic chunking
chat.py - Vector indexing
chat.py - Chroma index
chat.py - Hybrid retrieval
chat.py - Context prompt
chat.py
Identity And History
- Authentication
chat.py - User records
chat.py - Chat history
chat.py - Session records
chat.py
Runtime Integrations
- Ollama models
- gTTS service
Other components
- Staff user
Connections 18
- Staff user → Streamlit app: uses
- Streamlit app → Authentication: authenticates
- Authentication → User records: reads / writes
- Streamlit app → PDF ingestion: uploads PDF
- PDF ingestion → Semantic chunking: extracts text
- Semantic chunking → Vector indexing: creates chunks
- Vector indexing → Ollama models: embeds with
- Vector indexing → Chroma index: stores vectors
- Streamlit app → Question handling: submits question
- Question handling → Hybrid retrieval: retrieves context
- Hybrid retrieval → Chroma index: searches vectors
- Question handling → Context prompt: formats context
- Context prompt → Ollama models: requests answer
- Question handling → Source display: provides sources
- Streamlit app → Chat history: manages sessions
- Chat history → Session records: reads / writes
- Streamlit app → Speech output: optionally speaks
- Speech output → gTTS service: generates audio