How limeload/customer-support-agent works
This is a multi-agent customer-support platform with chat and polled-email entry points. A request loads conversation context, runs through triage, a specialist, escalation review, and a final quality check, then saves the response and agent path. The README also documents ticket handling, knowledge-document management, feedback, analytics, and an admin Agent Trace. Relationships are grounded in the README and shown excerpts; unsampled capabilities are included where documented, but their internal wiring is not inferred.
Main entry points: graph.ts Support Graph · client.ts Supabase · page.tsx Support Dashboard · route.ts Chat API
Components 29
Customer Channels
- Chat Widget
components/ChatWidget.tsx - Chat API
app/api/chat/route.ts - Gmail Poller
app/api/cron/gmail-poll/route.ts - Analytics API
app/api/analytics/route.ts - Documents API
app/api/documents/route.ts - Feedback API
app/api/feedback/route.ts - Ticket API
app/api/tickets/route.ts - Support Dashboard
app/(admin)/dashboard/page.tsx
Agent Workflow
- Support Graph
lib/agents/graph.ts - Shared Agent State
lib/agents/state.ts - Triage Agent
lib/agents/triage.ts - Knowledge Agent
lib/agents/knowledgeBase.ts - Order Billing Agent
lib/agents/orderBilling.ts - Troubleshooting Agent
lib/agents/troubleshooting.ts - Escalation Agent
lib/agents/escalation.ts - Quality Review
lib/agents/qualityReview.ts - Guardrail Policies
lib/guardrails/policies.ts
Support Capabilities
- Knowledge Retrieval
lib/rag/retrieve.ts - Document Ingestion
lib/rag/ingest.ts - Ticket Operations
lib/tools/tickets.ts - Slack Notifications
lib/tools/slack.ts - Email Operations
lib/tools/gmail.ts - Analytics Agent
lib/agents/analytics.ts
Data and Operations
- Conversation Store
lib/conversations.ts - Supabase
lib/db/client.ts - Agent Logging
lib/logging/logger.ts
Other components
- Customer
- Gmail
- OpenAI Models
Connections 35
- Customer → Chat Widget: sends message
README.md - Chat Widget → Chat API: submits request
- Chat API → Conversation Store: loads and saves
app/api/chat/route.ts - Chat API → Support Graph: invokes
app/api/chat/route.ts - Chat API → Supabase: loads customer
app/api/chat/route.ts - Gmail → Gmail Poller: provides messages
app/api/cron/gmail-poll/route.ts - Gmail Poller → Support Graph: invokes
app/api/cron/gmail-poll/route.ts - Gmail Poller → Conversation Store: loads and saves
app/api/cron/gmail-poll/route.ts - Gmail Poller → Email Operations: reads and replies
app/api/cron/gmail-poll/route.ts - Support Graph → Triage Agent: dispatches first
lib/agents/graph.ts - Support Graph → Knowledge Agent: routes by intent
lib/agents/graph.ts - Support Graph → Order Billing Agent: routes by intent
lib/agents/graph.ts - Support Graph → Troubleshooting Agent: routes by intent
lib/agents/graph.ts - Support Graph → Escalation Agent: routes and follows up
lib/agents/graph.ts - Support Graph → Quality Review: dispatches final check
lib/agents/graph.ts - Quality Review → Guardrail Policies: checks response
lib/agents/qualityReview.ts - Quality Review → OpenAI Models: polishes or revises
lib/agents/qualityReview.ts - Knowledge Agent → Knowledge Retrieval: retrieves sources
README.md - Escalation Agent → Ticket Operations: creates ticket
README.md - Escalation Agent → Slack Notifications: notifies
README.md - Support Graph → Shared Agent State: shares typed state
lib/agents/graph.ts - Documents API → Document Ingestion: ingests upload
app/api/documents/route.ts - Documents API → Supabase: lists documents
app/api/documents/route.ts - Document Ingestion → Supabase: stores chunks
lib/rag/ingest.ts - Document Ingestion → OpenAI Models: embeds chunks
lib/rag/ingest.ts - Conversation Store → Supabase: reads and writes
lib/conversations.ts - Agent Logging → Supabase: stores agent traces
lib/logging/logger.ts - Analytics API → Analytics Agent: runs analysis
app/api/analytics/route.ts - Analytics Agent → Supabase: reads ticket data
lib/agents/analytics.ts - Feedback API → Supabase: stores rating
app/api/feedback/route.ts - Ticket API → Ticket Operations: manages tickets
app/api/tickets/route.ts - Support Dashboard → Analytics API: requests analytics
README.md - Support Dashboard → Documents API: manages documents
README.md - Support Dashboard → Ticket API: reviews tickets
README.md - Support Dashboard → Agent Logging: views agent trace
README.md