How arshadak1/ai-customer-support works
This is an AI-assisted customer-support service: it polls Gmail, screens and classifies incoming conversations, drafts or escalates replies, and records tickets and processing events. A FastAPI service exposes those records and knowledge-base editing to a password-protected dashboard. The dashboard covers activity, conversations, knowledge-base maintenance, and login. The excerpts show the backend workflow and dashboard composition; frontend-to-API wiring is not shown, so that relationship is marked unverified. The repository also includes golden-email evaluation cases, but their runtime role is separate from customer support.
Main entry points: App.tsx Dashboard shell · pipeline.py Message workflow · decide.py Decision logic · gmail.py Gmail client
Components 22
Mail workflow
- Gmail client
app/gmail.py - Inbox poller
app/poller.py - Message workflow
app/pipeline.py - Message guards
app/guards.py
AI decisions
- Classifier
app/ai/classifier.py - Decision logic
app/ai/decide.py - Support rules
app/ai/rules.py - Reply agent
app/ai/agent.py - AI schemas
app/ai/schemas.py - Golden email cases
evals/golden_emails.py
Service and records
- FastAPI service
app/main.py - Support records
app/db.py - Runtime settings
app/config.py
Support dashboard
- Dashboard shell
dashboard/src/App.tsx - Login view
dashboard/src/pages/login.tsx - Activity view
dashboard/src/pages/events.tsx - Conversation view
dashboard/src/pages/tickets.tsx - Knowledge view
dashboard/src/pages/knowledge-base.tsx - Dashboard API client
dashboard/src/lib/api.ts
Other components
- Email sender
- Gmail API
- Dashboard user
Connections 26
- Email sender → Gmail client: emails
- Inbox poller → Gmail client: fetches mail
app/poller.py - Inbox poller → Message workflow: dispatches messages
app/poller.py - Message workflow → Gmail client: reads and replies
app/pipeline.py - Message workflow → Message guards: checks messages
app/pipeline.py - Message workflow → Decision logic: requests decision
app/pipeline.py - Message workflow → Support records: records processing
app/pipeline.py - Gmail client → Gmail API: calls Gmail API
app/gmail.py - Gmail client → Runtime settings: loads credentials
app/gmail.py - Decision logic → Classifier: classifies thread
app/ai/decide.py - Decision logic → Support rules: applies rules
app/ai/decide.py - Decision logic → Reply agent: requests reply
app/ai/decide.py - Reply agent → Support records: reads knowledge
app/ai/agent.py - Reply agent → Runtime settings: loads model setting
app/ai/agent.py - Classifier → Runtime settings: loads model setting
app/ai/classifier.py - FastAPI service → Support records: serves and updates
app/main.py - FastAPI service → Inbox poller: starts polling
app/main.py - FastAPI service → Runtime settings: checks login
app/main.py - Dashboard shell → Login view: shows when logged out
dashboard/src/App.tsx - Dashboard shell → Activity view: renders activity
dashboard/src/App.tsx - Dashboard shell → Conversation view: renders conversations
dashboard/src/App.tsx - Dashboard shell → Knowledge view: renders knowledge
dashboard/src/App.tsx - Dashboard shell → Dashboard API client: checks session
dashboard/src/App.tsx - Dashboard user → Dashboard shell: uses dashboard
- Dashboard API client → FastAPI service: calls service
- Golden email cases → Decision logic: evaluation input