Agent Architecture/End-to-End Projects
Advanced14 min

Project: Build a Customer Support Agent

End-to-end walkthrough: build a customer support agent with query routing, RAG knowledge base, tool-calling for account actions, human-in-the-loop escalation, and multi-tenant auth.

Quick Reference

  • Architecture: router → specialized handlers (billing, technical, general) with shared RAG knowledge base
  • RAG: product docs in vector store with hybrid search + reranking for accurate answers
  • Actions: account lookup, refund processing, ticket creation — with HITL for destructive operations
  • Escalation: interrupt() when confidence is low or customer requests a human
  • Auth: multi-tenant with org-scoped threads and customer-scoped memory
  • Evaluation: resolution rate, customer satisfaction, escalation rate tracking

Requirements

RequirementSolution
Route queries to right handlerRouter pattern with structured output classification
Answer product questionsRAG with hybrid search over product docs
Perform account actionsTools: lookup_account, process_refund, create_ticket
Approve destructive actionsinterrupt() before refunds > $100 or account changes
Remember customer preferencesStore for cross-session memory per customer
Multi-tenant isolationAuth middleware with org_id + customer_id scoping