How talha915/gen-ai-dice-final-project works
This is a natural-language chatbot for querying structured car data and uploaded documents. A user asks through the Streamlit chat UI, which posts to the FastAPI chatbot route; its LangGraph workflow routes database questions through SQL generation, execution, and answer formatting, or sends other questions to retrieval-augmented generation. Separately, users upload PDFs through the UI and ingestion route, which stores document chunks in Chroma for later retrieval. The graph includes the documented product branches; unsampled health-check and workflow details are not expanded.
Main entry points: chatbot.py Chat route and graph · kb_query.py RAG query engine · knowledge_base.py Document ingestion builder · main.py Streamlit UI
Components 14
Chat interface
- Streamlit UI
client/main.py
API and routing
- FastAPI app
server/app/main.py - Chat route and graph
server/app/api/chatbot.py - Ingestion route
server/app/api/ingestion.py - Graph state models
server/app/core/models.py
Database agent
- Database agent
server/app/core/db_agent.py - Car database
server/app/db/used_cars.db
Knowledge base
- RAG query engine
server/app/core/kb_query.py - Document ingestion builder
server/app/core/knowledge_base.py - Uploaded PDFs
server/app/documents - Chroma vector store
server/chroma_store
Other components
- User
- Groq language model
- HuggingFace embeddings
Connections 17
- User → Streamlit UI: asks or uploads
README.md - Streamlit UI → Chat route and graph: posts query
client/main.py - Streamlit UI → Ingestion route: posts file
client/main.py - FastAPI app → Chat route and graph: registers route
server/app/main.py - FastAPI app → Ingestion route: registers route
server/app/main.py - Chat route and graph → Graph state models: uses state
server/app/api/chatbot.py - Chat route and graph → Database agent: runs workflow
server/app/api/chatbot.py - Chat route and graph → RAG query engine: queries knowledge base
server/app/api/chatbot.py - Database agent → Car database: reads and writes
server/app/core/db_agent.py - Database agent → Groq language model: generates and summarizes
server/app/core/db_agent.py - Ingestion route → Document ingestion builder: builds index
server/app/api/ingestion.py - Document ingestion builder → Uploaded PDFs: loads PDFs
server/app/core/knowledge_base.py - Document ingestion builder → Chroma vector store: stores chunks
server/app/core/knowledge_base.py - Document ingestion builder → HuggingFace embeddings: embeds chunks
server/app/core/knowledge_base.py - RAG query engine → Chroma vector store: retrieves chunks
server/app/core/kb_query.py - RAG query engine → HuggingFace embeddings: embeds query
server/app/core/kb_query.py - RAG query engine → Groq language model: generates answer
server/app/core/kb_query.py