How sufiankanaan/ai-car-assistant works
AI Car Assistant combines document-backed retrieval and calculator tools behind a model-routed chat agent. Users enter through Gradio or Streamlit; the agent calls Gemini, which may use knowledge search or calculators, then returns an answer subject to a numeric-input guard. The knowledge base is built from bundled text and documents, embedded, and stored in ChromaDB. README documents Langfuse tracing and these capabilities; unsampled internals are represented only where that documentation supports them.
Main entry points: agent.py Agent orchestration · rag.py ChromaDB collection · app.py Streamlit chat · gradio_app.py Gradio chat
Components 13
Chat interfaces
- Streamlit chat
app.py - Gradio chat
gradio_app.py
Agent and safeguards
- Agent orchestration
agent.py - Number guard
guard.py
Knowledge retrieval
- Knowledge search
agent.py - Document ingestion
doc_loader.py - Car knowledge sources
cars_knowledge.txt - PDF and Word documents
docs - ChromaDB collection
rag.py
Cost calculators
- Cost calculators
tools.py
External services
- Gemini API
- Langfuse tracing
Other components
- Car assistant user
Connections 15
- Car assistant user → Streamlit chat: asks via
app.py - Car assistant user → Gradio chat: asks via
README.md - Streamlit chat → Agent orchestration: calls
app.py - Gradio chat → Agent orchestration: calls
gradio_app.py - Agent orchestration → Gemini API: requests response
agent.py - Agent orchestration → Knowledge search: registers tool
agent.py - Agent orchestration → Cost calculators: registers tools
agent.py - Agent orchestration → Number guard: checks numbers
agent.py - Agent orchestration → Langfuse tracing: records traces
README.md - Knowledge search → ChromaDB collection: queries
agent.py - Knowledge search → Gemini API: embeds query
agent.py - Car knowledge sources → ChromaDB collection: indexed at startup
rag.py - PDF and Word documents → Document ingestion: converted and chunked
README.md - Document ingestion → ChromaDB collection: supplies chunks
rag.py - Cost calculators → Agent orchestration: returns results
agent.py