How mr-chetan-66/halfgpt works
HalfGPT is a browser-based agentic chatbot. A user chats or uploads a supported document; FastAPI streams agent responses or ingests files, while conversation history and agent checkpoints persist separately. The agent routes requests to direct chat or specialized tools for calculations, web search, document retrieval, and memory. The README also documents Google Search with Tavily fallback. The graph reflects shown calls and documented capabilities; deployment details are excluded, and unsampled frontend behavior is not inferred.
Main entry points: app.py FastAPI endpoints · agent.py Tool dispatch · tools.py Web search · index.html Web interface
Components 19
Web application
- Web interface
templates/index.html - FastAPI endpoints
app.py - Document upload
app.py - Chat streaming
app.py
Agent runtime
- LangGraph agent
agent.py - Intent router
agent.py - Tool dispatch
agent.py - Calculator
tools.py - Web search
tools.py
Documents and memory
- Document search tool
tools.py - Document ingestion
rag.py - Chroma vector store
rag.py - Memory tools
tools.py
Persistence
- Conversation storage
database.py - Agent checkpoints
agent.py
External services
- Groq chat model
- Google Search
- Tavily search
Other components
- Chat user
Connections 24
- Chat user → Web interface: uses
README.md - Web interface → FastAPI endpoints: sends requests
README.md - FastAPI endpoints → Web interface: renders page
app.py - FastAPI endpoints → Document upload: routes uploads
app.py - FastAPI endpoints → Chat streaming: routes chat
app.py - Document upload → Document ingestion: ingests file
app.py - FastAPI endpoints → Conversation storage: reads and writes
app.py - Chat streaming → LangGraph agent: streams agent
app.py - Chat streaming → Conversation storage: saves messages
app.py - LangGraph agent → Intent router: classifies intent
agent.py - Intent router → Tool dispatch: routes requests
agent.py - Tool dispatch → Calculator: dispatches
agent.py - Tool dispatch → Web search: dispatches
agent.py - Tool dispatch → Document search tool: dispatches
agent.py - Tool dispatch → Memory tools: dispatches
agent.py - LangGraph agent → Groq chat model: generates responses
README.md - Web search → Google Search: queries when configured
tools.py - Web search → Tavily search: falls back to
tools.py - Document search tool → Chroma vector store: retrieves chunks
tools.py - Document ingestion → Chroma vector store: stores chunks
rag.py - Memory tools → Conversation storage: saves and searches
tools.py - LangGraph agent → Agent checkpoints: persists state
agent.py - FastAPI endpoints → Agent checkpoints: deletes thread state
app.py - FastAPI endpoints → Chroma vector store: deletes thread documents
app.py