How divakar-star/customer-support-rag-assistant works
This is a local-first support-document RAG assistant. Its main workflows are document upload/ingestion into FAISS and SQLite, and chat through semantic retrieval, confidence-based refusal, context assembly, Gemini generation, and citation validation. The graph retains the documented UI and ingestion-script entry points and the distinct ingestion and answer-generation stages. Source excerpts establish the principal calls; README statements support the documented user workflow. Unsampled UI and loader internals are not expanded, and no unverified UI-to-API call is asserted.
Main entry points: ingestion/pipeline.py Ingestion orchestrator · rag/pipeline.py Answer orchestrator · main.py FastAPI app · vector_search.py Vector retrieval
Components 22
User entry points
- Streamlit UI
ui/streamlit_app.py - FastAPI app
app/main.py - Chat endpoint
app/api/routes_chat.py - Document endpoint
app/api/routes_documents.py - Ingestion script
scripts/ingest_documents.py
Document ingestion
- Ingestion orchestrator
app/ingestion/pipeline.py - Document loader
app/ingestion/loader.py - Text cleaner
app/ingestion/cleaner.py - Page chunker
app/ingestion/chunker.py - Embedding service
app/embeddings/model.py
Answer pipeline
- Answer orchestrator
app/rag/pipeline.py - Vector retrieval
app/retrieval/vector_search.py - Context builder
app/rag/context_builder.py - Prompt builder
app/rag/prompts.py - LLM generator
app/rag/generator.py - Citation validator
app/rag/citations.py
Search and storage
- FAISS index
app/storage/faiss_store.py - Document repository
app/storage/document_repository.py - SQLite database
app/storage/sqlite.py - Runtime settings
app/core/config.py
Other components
- Support user
- Google Gemini
Connections 28
- Support user → Streamlit UI: uses
README.md - Support user → FastAPI app: submits requests
README.md - FastAPI app → Chat endpoint: registers
app/main.py - FastAPI app → Document endpoint: registers
app/main.py - Document endpoint → Ingestion orchestrator: ingests upload
app/api/routes_documents.py - Ingestion script → Ingestion orchestrator: runs ingestion
README.md - Ingestion orchestrator → Document loader: loads files
app/ingestion/pipeline.py - Ingestion orchestrator → Text cleaner: cleans text
app/ingestion/pipeline.py - Ingestion orchestrator → Page chunker: chunks pages
app/ingestion/pipeline.py - Ingestion orchestrator → Embedding service: embeds chunks
app/ingestion/pipeline.py - Ingestion orchestrator → Document repository: writes document and chunks
app/ingestion/pipeline.py - Ingestion orchestrator → FAISS index: adds vectors
app/ingestion/pipeline.py - Chat endpoint → Answer orchestrator: answers question
app/api/routes_chat.py - Answer orchestrator → Vector retrieval: searches query
app/rag/pipeline.py - Vector retrieval → Embedding service: embeds query
app/retrieval/vector_search.py - Vector retrieval → FAISS index: searches vectors
app/retrieval/vector_search.py - Vector retrieval → Document repository: loads chunk metadata
app/retrieval/vector_search.py - Answer orchestrator → Context builder: builds context
app/rag/pipeline.py - Answer orchestrator → Prompt builder: builds prompt
app/rag/pipeline.py - Answer orchestrator → LLM generator: generates answer
app/rag/pipeline.py - LLM generator → Google Gemini: calls model
README.md - Answer orchestrator → Citation validator: validates citations
app/rag/pipeline.py - Document repository → SQLite database: queries and writes
app/storage/document_repository.py - FastAPI app → SQLite database: initializes schema
app/main.py - FAISS index → Runtime settings: reads index paths
app/storage/faiss_store.py - SQLite database → Runtime settings: reads database path
app/storage/sqlite.py - Embedding service → Runtime settings: reads model setting
app/embeddings/model.py - Answer orchestrator → Runtime settings: reads retrieval threshold
app/rag/pipeline.py