How sohaggain/ai-omnichannel-support-agent works
This is a FastAPI customer-support service that accepts website, WhatsApp, email, and Messenger messages and routes them through one Claude-based agent. The agent loads conversation context, may retrieve grounded knowledge, create an internal ticket, or escalate to a human, then persists and returns a reply through the originating channel. The README also documents optional CRM mirroring and n8n automations. The supplied source excerpts show the orchestrator, CRM, RAG, and several integration clients; some channel, tool, and vector-store wiring is documented but not sampled, so uncertain links are omitted.
Main entry points: orchestrator.py Agent orchestrator · main.py FastAPI app · service.py CRM service · tools.py Agent tools
Components 28
Channels
- FastAPI app
src/main.py - Website adapter
src/channels - WhatsApp adapter
src/channels - Email adapter
src/channels - Messenger adapter
src/channels
Agent workflow
- Agent orchestrator
src/agent/orchestrator.py - Agent tools
src/agent/tools.py
Knowledge base
- KB ingestion
src/rag/ingest.py - KB retrieval
src/rag/retriever.py - Vector store
src/rag/vectorstore.py
Support records
- CRM service
src/crm/service.py - DB sessions
src/db/session.py - Support records
src/db/models.py
External services
- Anthropic Claude
- WhatsApp API
- Gmail API
- Messenger API
- Slack
- HubSpot
- GoHighLevel
- Gmail client
src/integrations/gmail_client.py - WhatsApp client
src/integrations/whatsapp_client.py - Messenger client
src/integrations/messenger_client.py - Slack client
src/integrations/slack_client.py - HubSpot client
src/integrations/hubspot_client.py - GoHighLevel client
src/integrations/gohighlevel_client.py - n8n workflows
workflows/n8n
Other components
- Customer
Connections 28
- Customer → FastAPI app: sends message
- FastAPI app → Website adapter: routes request
- FastAPI app → WhatsApp adapter: routes request
- FastAPI app → Email adapter: routes request
- FastAPI app → Messenger adapter: routes request
- Website adapter → Agent orchestrator: submits message
- WhatsApp adapter → Agent orchestrator: submits message
- Email adapter → Agent orchestrator: submits message
- Messenger adapter → Agent orchestrator: submits message
- Agent orchestrator → Anthropic Claude: requests completion
- Agent orchestrator → Agent tools: executes tools
- Agent tools → KB retrieval: searches knowledge
- KB ingestion → Vector store: upserts chunks
- KB retrieval → Vector store: queries chunks
- Agent orchestrator → CRM service: gets contact
- Agent orchestrator → DB sessions: persists conversation
- DB sessions → Support records: reads and writes
- CRM service → Support records: writes tickets
- CRM service → HubSpot client: mirrors ticket
- CRM service → GoHighLevel client: mirrors ticket
- HubSpot client → HubSpot: creates ticket
- GoHighLevel client → GoHighLevel: creates ticket
- Agent tools → Slack client: requests escalation
- Slack client → Slack: posts handoff
- WhatsApp client → WhatsApp API: sends reply
- Messenger client → Messenger API: sends reply
- Gmail client → Gmail API: sends reply
- n8n workflows → Slack: optional follow-up