How krishnatiwari005/multi-utility-ai-chatbot works
This is a multi-utility conversational AI application: users chat through Streamlit or a FastAPI API, and a LangGraph workflow streams model responses while routing tool requests. Its distinct capabilities include web search, arithmetic, stock lookup, and PDF ingestion and question answering; conversation checkpoints persist in SQLite. The PDF retrievers and metadata are held in backend memory per thread. The README documents the Streamlit workflow, while the FastAPI entry point and its endpoints are evident in sampled source; PDF processing details are also sampled.
Main entry points: langgraph_backend.py Chat Graph · streamlit_frontend.py Streamlit Chat · fastapi_backend.py FastAPI API · ui.py UI Styling
Components 22
User Interfaces
- Streamlit Chat
streamlit_frontend.py - UI Styling
ui.py - FastAPI API
fastapi_backend.py
Chat Workflow
- Chat Graph
langgraph_backend.py - Model Node
langgraph_backend.py - Tool Dispatcher
langgraph_backend.py
Tools and Documents
- Web Search
langgraph_backend.py - Calculator
langgraph_backend.py - Stock Lookup
langgraph_backend.py - PDF Ingestion
langgraph_backend.py - PDF Extraction
langgraph_backend.py - Text Chunking
langgraph_backend.py - Embeddings
langgraph_backend.py - FAISS Index
langgraph_backend.py - PDF Retrieval
langgraph_backend.py
Conversation State
- Thread Retrievers
langgraph_backend.py - SQLite Checkpoint
langgraph_backend.py
Other components
- User
- API Client
- Groq Model
- DuckDuckGo
- Alpha Vantage
Connections 30
- User → Streamlit Chat: chats
- Streamlit Chat → UI Styling: loads styling
- Streamlit Chat → Chat Graph: streams turns
- Streamlit Chat → PDF Ingestion: uploads PDF
- Streamlit Chat → Chat Graph: loads threads
- Streamlit Chat → Chat Graph: reads document metadata
- API Client → FastAPI API: calls API
- FastAPI API → Chat Graph: streams turns
- FastAPI API → PDF Ingestion: uploads PDF
- FastAPI API → Chat Graph: loads threads
- FastAPI API → Chat Graph: loads conversations
- FastAPI API → Chat Graph: reads document metadata
- Chat Graph → Model Node: starts and resumes
- Model Node → Groq Model: invokes model
- Chat Graph → Tool Dispatcher: routes tool calls
- Tool Dispatcher → Model Node: returns tool results
- Tool Dispatcher → Web Search: dispatches
- Tool Dispatcher → Calculator: dispatches
- Tool Dispatcher → Stock Lookup: dispatches
- Tool Dispatcher → PDF Retrieval: dispatches
- Web Search → DuckDuckGo: searches
- Stock Lookup → Alpha Vantage: requests quote
- PDF Ingestion → PDF Extraction: loads PDF
- PDF Ingestion → Text Chunking: splits documents
- PDF Ingestion → Embeddings: embeds chunks
- PDF Ingestion → FAISS Index: builds index
- PDF Ingestion → Thread Retrievers: stores retriever
- PDF Retrieval → Thread Retrievers: gets retriever
- PDF Retrieval → FAISS Index: retrieves chunks
- Chat Graph → SQLite Checkpoint: reads and writes checkpoints