How jinendra12kumar/parcelpilot-ai-chatbot works
ParcelPilot AI is a support-operations copilot: agents ask questions in the React chat, the FastAPI API supplies identity and thread context, and a LangGraph agent returns answers or pauses for human confirmation before escalation. Its domain paths include policy/document retrieval, account/order/ticket lookup, SLA-credit calculation, and authorized escalation; document indexing and structured-data access support those paths. The README documents streaming and role/account isolation capabilities, though the sampled excerpts do not establish all their internal links. Edges are limited to excerpted calls, indexed references, or documented interactions.
Main entry points: graph.py LangGraph agent · App.tsx Chat application · chat.py Chat endpoints · document_search.py Document search
Components 26
Chat interface
- Chat application
frontend/src/App.tsx - Chat controls
frontend/src/components - Confirmation card
frontend/src/components/ConfirmationCard.tsx - Session sidebar
frontend/src/components/Sidebar.tsx - API client
frontend/src/services/api.ts
API and identity
- FastAPI application
app/main.py - Chat endpoints
app/api/chat.py - Streaming endpoint
app/api/chat_stream.py - Chat schemas
app/api/schemas.py - User context
app/services/auth_context.py
Agent orchestration
- LangGraph agent
app/agent/graph.py - Thread checkpoints
app/agent/graph.py
Knowledge and operations
- Document search
app/tools/document_search.py - Document retrieval
app/services/retrieval.py - Authority ranking
app/services/source_ranking.py - Document indexing
app/ingestion/indexer.py - PDF loading
app/ingestion/documents.py - Chroma index
app/ingestion/indexer.py - Operational lookup
app/tools/data_lookup.py - Operational data
app/ingestion/structured.py - Service credit calculation
app/tools/calculations.py
Authorization and actions
- Role permissions
app/services/permissions.py - Account authorization
app/services/data_access.py - Escalation actions
app/tools/actions.py
Other components
- Support user
- Gemini model
Connections 27
- Support user → Chat application: asks
README.md - Chat application → API client: sends requests
frontend/src/App.tsx - Chat application → Chat controls: renders
frontend/src/App.tsx - Chat application → Confirmation card: renders
frontend/src/App.tsx - Chat application → Session sidebar: renders
frontend/src/App.tsx - API client → Chat endpoints: HTTP requests
README.md - FastAPI application → Chat endpoints: registers
app/main.py - Chat endpoints → LangGraph agent: invokes and resumes
app/api/chat.py - Chat endpoints → User context: gets user context
- Chat endpoints → Chat schemas: validates payloads
app/api/chat.py - Streaming endpoint → LangGraph agent: invokes
app/api/chat_stream.py - LangGraph agent → Gemini model: calls model
app/agent/graph.py - LangGraph agent → Thread checkpoints: saves thread state
app/agent/graph.py - LangGraph agent → Document search: dispatches tool
app/agent/graph.py - LangGraph agent → Operational lookup: dispatches tool
app/agent/graph.py - LangGraph agent → Service credit calculation: dispatches tool
app/agent/graph.py - LangGraph agent → Escalation actions: prepares and executes
app/agent/graph.py - LangGraph agent → Role permissions: checks role
app/agent/graph.py - Document search → Document retrieval: searches
app/tools/document_search.py - Document search → Authority ranking: ranks results
app/tools/document_search.py - Document retrieval → Chroma index: queries
app/services/retrieval.py - Document indexing → PDF loading: loads documents
app/ingestion/indexer.py - Document indexing → Chroma index: writes chunks
app/ingestion/indexer.py - Operational lookup → Operational data: reads records
app/tools/data_lookup.py - Escalation actions → Operational data: reads tickets
app/tools/actions.py - Escalation actions → Account authorization: checks account scope
app/tools/actions.py - Chat application → Streaming endpoint: streams replies
README.md