How takiuddinahmed/ai-call-support-agent works
Support agent is a local customer-support product for Robo Parts BD, with text chat and English voice calls sharing the same agent core. Customers discover products, check orders, and place cash-on-delivery orders; order placement is guarded by a quoted summary and explicit confirmation. Voice adds browser and Asterisk/SIP entry points, speech processing, and call diagnostics. The graph reflects the README and shown source/index references; some voice internals are unsampled, so uncertain links are omitted.
Main entry points: loop.py Turn orchestrator · routes.py Voice routes · app.py HTTP application · pipeline.py Speech pipeline
Components 22
User interfaces
- Chat and voice pages
src/support_agent/server/static - HTTP application
src/support_agent/server/app.py
Conversation core
- Session state
src/support_agent/session.py - Agent instructions
src/support_agent/instructions.py - Prompt history
src/support_agent/history.py - Turn orchestrator
src/support_agent/loop.py
Store operations
- Store tools and guards
src/support_agent/tools.py - Store API client
src/support_agent/store/client.py - Store data types
src/support_agent/store/models.py
Voice calling
- Voice routes
src/support_agent/voice/routes.py - Voice dependencies
src/support_agent/voice/deps.py - Speech pipeline
src/support_agent/voice/pipeline.py - Voice agent processor
src/support_agent/voice/agent_processor.py - Asterisk adapter
src/support_agent/voice/asterisk.py - Call debug events
src/support_agent/voice/debug_hub.py
Runtime services
- Model client
src/support_agent/llm.py - Settings
src/support_agent/config.py
Other components
- Customer
- Robo Parts BD store
- Local Ollama
- Whisper and Kokoro
- SIP softphone
Connections 28
- Customer → Chat and voice pages: uses
README.md - Chat and voice pages → HTTP application: sends requests
src/support_agent/server/app.py - HTTP application → Session state: creates and updates
src/support_agent/server/app.py - HTTP application → Store API client: authenticates with
src/support_agent/server/app.py - HTTP application → Turn orchestrator: starts chat turn
src/support_agent/server/app.py - Turn orchestrator → Agent instructions: builds prompt
src/support_agent/loop.py - Turn orchestrator → Prompt history: fits history
src/support_agent/loop.py - Turn orchestrator → Model client: streams model calls
src/support_agent/loop.py - Turn orchestrator → Store tools and guards: dispatches tools
src/support_agent/loop.py - Store tools and guards → Store API client: requests store data
src/support_agent/tools.py - Store API client → Robo Parts BD store: calls store API
README.md - Store API client → Store data types: maps responses
src/support_agent/store/client.py - Store tools and guards → Session state: checks order approval
src/support_agent/tools.py - Settings → Model client: configures endpoint
src/support_agent/llm.py - HTTP application → Voice routes: registers voice routes
src/support_agent/server/app.py - Voice routes → Speech pipeline: builds call pipeline
src/support_agent/voice/routes.py - Voice routes → Voice dependencies: uses dependencies
src/support_agent/voice/routes.py - Voice routes → Asterisk adapter: handles phone transport
src/support_agent/voice/routes.py - Speech pipeline → Voice agent processor: runs agent processor
src/support_agent/voice/pipeline.py - Voice agent processor → Turn orchestrator: shares agent core
src/support_agent/voice/agent_processor.py - Voice agent processor → Session state: uses conversation state
src/support_agent/voice/agent_processor.py - Speech pipeline → Whisper and Kokoro: transcribes and speaks
README.md - Voice dependencies → Model client: warms model
src/support_agent/voice/deps.py - Speech pipeline → Call debug events: publishes events
src/support_agent/voice/pipeline.py - SIP softphone → Asterisk adapter: places SIP call
README.md - Asterisk adapter → Voice routes: opens phone route
README.md - Model client → Local Ollama: streams completions
src/support_agent/llm.py - Voice routes → Call debug events: serves call events
src/support_agent/voice/routes.py