How sanika-gajarishi/ai-customer-support--rag works
ShopEase is a customer-support application with a Streamlit UI and FastAPI backend. Customers authenticate, ask policy questions, review conversation history, submit feedback, and manage support tickets; administrators monitor usage, manage policy files, rebuild the knowledge base, and update tickets. The chat handler owns conversation persistence and calls RAG, which retrieves policy context before generating an answer. Admin-triggered ingestion extracts and chunks documents, embeds them, and persists a FAISS index. The graph follows README-documented capabilities and sampled calls; unsampled internals are not inferred.
Main entry points: database.py Database sessions · main.py FastAPI app · admin.py Admin API · chat.py Chat handler
Components 22
User interface
- Streamlit interface
frontend/app.py
API and identity
- FastAPI app
backend/app/main.py - Registration and login
backend/app/api/auth.py - Token authorization
backend/app/security.py - Chat handler
backend/app/api/chat.py - History API
backend/app/api/history.py - Feedback API
backend/app/api/feedback.py - Admin API
backend/app/api/admin.py - Ticket API
backend/app/api/tickets.py
Knowledge and answers
- RAG answer service
backend/app/services/rag_service.py - Document extraction and chunking
backend/app/services/document_service.py - Index ingestion
backend/app/services/ingest_service.py - Embeddings and vector store
backend/app/services/embedding_service.py - Answer generation
backend/app/services/llm_service.py - Policy documents
backend/data/documents - FAISS index
backend/data
Support records
- Persistence models
backend/app/models.py - Database sessions
backend/app/database.py - PostgreSQL
Other components
- Customer
- Administrator
- Gemini
Connections 32
- Customer → Streamlit interface: uses
README.md - Administrator → Streamlit interface: uses
README.md - Streamlit interface → FastAPI app: sends HTTP requests
README.md - FastAPI app → Registration and login: registers routes
backend/app/main.py - FastAPI app → Chat handler: registers routes
backend/app/main.py - FastAPI app → History API: registers routes
backend/app/main.py - FastAPI app → Feedback API: registers routes
backend/app/main.py - FastAPI app → Admin API: registers routes
backend/app/main.py - FastAPI app → Ticket API: registers routes
backend/app/main.py - Registration and login → Token authorization: creates tokens
backend/app/api/auth.py - Registration and login → Database sessions: gets sessions
backend/app/api/auth.py - Chat handler → Token authorization: checks user
backend/app/api/chat.py - Chat handler → RAG answer service: requests answer
backend/app/api/chat.py - Chat handler → Database sessions: reads and writes
backend/app/api/chat.py - History API → Database sessions: reads history
backend/app/api/history.py - Feedback API → Database sessions: stores feedback
backend/app/api/feedback.py - Admin API → Token authorization: checks admin
backend/app/api/admin.py - Admin API → Database sessions: reads summary
backend/app/api/admin.py - Admin API → Policy documents: manages files
backend/app/api/admin.py - Admin API → Index ingestion: triggers rebuild
backend/app/api/admin.py - Ticket API → Token authorization: checks access
backend/app/api/tickets.py - Ticket API → Database sessions: reads and writes
backend/app/api/tickets.py - Database sessions → PostgreSQL: connects
README.md - Database sessions → Persistence models: provides base
backend/app/models.py - Index ingestion → Document extraction and chunking: loads and splits
backend/app/services/ingest_service.py - Index ingestion → Embeddings and vector store: builds index
backend/app/services/ingest_service.py - Index ingestion → Policy documents: ingests documents
README.md - Embeddings and vector store → FAISS index: persists index
README.md - RAG answer service → Embeddings and vector store: loads and searches
backend/app/services/rag_service.py - RAG answer service → Answer generation: generates answer
backend/app/services/rag_service.py - Answer generation → Gemini: requests generation
README.md - RAG answer service → FAISS index: retrieves context
README.md