How shourya845/chatbot works
a31-assistance is a Python backend and terminal chatbot for answering A3i questions, routing pricing and demo requests, and storing confirmed leads. Visitors submit chat through the separate frontend or use the CLI. The backend manages sessions, resolves follow-ups and intents, then the agent retrieves official evidence, optionally adds approved company-background snapshots, and synthesizes a checked answer; direct demo submissions follow a separate lead-storage path. The graph reflects documented workflows and indexed references; unsampled implementation details are omitted where their links cannot be established.
Main entry points: agent.py Answer agent · main.py FastAPI endpoints · tools.py Search and excerpts · chat_cli.py Terminal chatbot
Components 21
User entry
- Next.js frontend
- FastAPI endpoints
main.py - Terminal chatbot
chat_cli.py
Chat orchestration
- Intent routing
router.py - Follow-up resolution
conversation.py - Answer agent
agent.py - Session memory
memory.py - Demo guidance
router.py
Evidence retrieval
- Search and excerpts
tools.py - Official source catalog
website_sources.json - Official page reader
website.py - External snapshot review
external_sources.py - Snapshot database
Demo requests
- Lead endpoint
main.py - Lead validation and storage
leads.py - Lead database
External providers
- A3i website
- Tavily search
- Groq model
- Ollama model
Other components
- Website visitor
Connections 24
- Website visitor → Next.js frontend: submits chat
README.md - Next.js frontend → FastAPI endpoints: proxies requests
README.md - Website visitor → Terminal chatbot: enters messages
README.md - Terminal chatbot → Answer agent: streams answers
chat_cli.py - Terminal chatbot → Session memory: loads and saves
chat_cli.py - FastAPI endpoints → Intent routing: classifies intent
main.py - Intent routing → Follow-up resolution: resolves context
router.py - FastAPI endpoints → Answer agent: requests answers
main.py - FastAPI endpoints → Session memory: loads and saves
main.py - Answer agent → Search and excerpts: invokes search
agent.py - Search and excerpts → Official page reader: retrieves pages
tools.py - Official page reader → Official source catalog: selects sources
website.py - Official page reader → A3i website: fetches fragments
README.md - Search and excerpts → Tavily search: searches fallback
README.md - Search and excerpts → External snapshot review: loads approved evidence
tools.py - External snapshot review → Snapshot database: reads and reviews
external_sources.py - Answer agent → Groq model: generates answers
README.md - Answer agent → Ollama model: falls back
README.md - Answer agent → Next.js frontend: streams response
README.md - Intent routing → Demo guidance: handles demo intent
README.md - Website visitor → Next.js frontend: confirms demo form
README.md - Next.js frontend → Lead endpoint: posts lead
README.md - Lead endpoint → Lead validation and storage: validates and saves
main.py - Lead validation and storage → Lead database: writes confirmed lead
leads.py