How ksganni/enterprise-rag-knowledge-assistant works
This is an enterprise RAG knowledge assistant. Employees use the Streamlit dashboard to load or upload a policy document, choose it, and ask a question; the API ingests and indexes documents or orchestrates retrieval and answer generation, then returns source-attributed results. The graph also includes document inventory and deletion. Relationships are based on the shown source calls and README descriptions; unsampled dashboard behavior is represented only where documented.
Main entry points: main.py FastAPI endpoints · chain.py Question orchestration · streamlit_app.py Streamlit dashboard · vectorstore.py Chroma vector index
Components 16
User interface
- Streamlit dashboard
frontend/streamlit_app.py - Sample policy corpus
data/sample_docs
API and contracts
- FastAPI endpoints
app/main.py - Request and response schemas
app/schemas.py - Answer and source attribution
app/main.py
Document ingestion
- Uploaded documents
app/config.py - Document parsing
app/rag/ingest.py - Text chunking
app/rag/ingest.py
Search and storage
- FastEmbed embeddings
app/rag/vectorstore.py - Chroma vector index
app/rag/vectorstore.py - Indexed document inventory
app/rag/vectorstore.py
Answer generation
- Semantic retrieval
app/rag/vectorstore.py - Question orchestration
app/rag/chain.py - Context and passage fallback
app/rag/chain.py - Google Gemini
Other components
- Employee
Connections 20
- Employee → Streamlit dashboard: uses
README.md - Streamlit dashboard → Sample policy corpus: loads samples
README.md - Streamlit dashboard → FastAPI endpoints: calls HTTP API
frontend/streamlit_app.py - FastAPI endpoints → Request and response schemas: validates and returns
app/main.py - FastAPI endpoints → Uploaded documents: writes and deletes
app/main.py - FastAPI endpoints → Document parsing: loads documents
app/main.py - Document parsing → Text chunking: splits text
app/rag/ingest.py - FastAPI endpoints → Text chunking: chunks documents
app/main.py - FastAPI endpoints → Chroma vector index: indexes chunks
app/main.py - FastEmbed embeddings → Chroma vector index: encodes vectors
app/rag/vectorstore.py - FastAPI endpoints → Indexed document inventory: lists and deletes
app/main.py - Question orchestration → Semantic retrieval: searches chunks
app/rag/chain.py - Semantic retrieval → Chroma vector index: searches index
app/rag/vectorstore.py - Question orchestration → Context and passage fallback: formats passages
app/rag/chain.py - Question orchestration → Google Gemini: requests generation
app/rag/chain.py - Context and passage fallback → Google Gemini: provides context
app/rag/chain.py - FastAPI endpoints → Question orchestration: asks question
app/main.py - FastAPI endpoints → Answer and source attribution: attributes sources
app/main.py - Question orchestration → Answer and source attribution: returns answer and passages
app/main.py - Answer and source attribution → Streamlit dashboard: delivers results
README.md