All projects

Customer Service · AI

·Live in production

CS AI: customer service that scales without scaling headcount.

A three-tier system (AI Rep, AI Manager, Human) with Claude AI and Twilio voice. Configurable escalation triggers, full audit trail, ready for compliance.

Claude AITwilio VoiceNestJSAnthropic SDKPostgreSQL

Tiers

3

Channels

Voice + Chat

Escalation triggers

12+

Audit trail

SOC2-ready

The challenge

Customer service is the function every growing company hates to scale. Hiring is slow, training is slower, and quality drops the moment volume spikes. Most "AI customer service" products shipped before this year were just chatbots: pattern matching on FAQ keywords, with a "talk to a human" button that hid the fact that they could not actually solve anything.

What was needed was different. An AI that could resolve the routine questions outright, escalate intelligently when the situation changed, and hand off to a human only when the issue actually required a human. And it had to leave behind a full audit trail, because the regulated industries we work in care about who said what to which customer and when.

The solution

Three tiers. AI Rep handles the routine: order status, shipping updates, simple account questions, no refunds, low credit limits. When something signals that the customer needs more (irate sentiment, a refund request, a complex issue), AI Rep escalates to AI Manager. AI Manager has elevated authority: refunds up to a configurable threshold, larger credits, the ability to make exceptions inside documented policy. When AI Manager hits its ceiling (refunds over threshold, an explicit human request, a policy exception), it escalates to a human agent through a Twilio live transfer.

The escalation logic is data-driven. Every company configures its own triggers, thresholds, refund ceilings, and routing. The same codebase serves a company that lets AI handle $200 refunds and another company that requires human approval for anything over $5. The AI does not hard-code policy. The policy hard-codes the AI.

What we built

The conversation engine is built on Claude with structured tool use. The model can look up orders, check shipment status, issue refunds within its tier limits, apply credits, and update customer notes, each through typed function calls that hit the platform's internal APIs. The model never invents data. It either calls the tool or admits it does not know.

The voice path runs through Twilio. Inbound calls hit a webhook that returns TwiML for the greeting, captures speech-to-text on each turn, sends the transcript to the conversation engine, and streams the response back as synthesized speech. The escalation path issues a Twilio dial verb to forward the call to a human agent's phone, with the conversation context attached so the human picks up where the AI left off.

The chat path is a websocket interface that runs in any web embed, with the same conversation engine on the backend. From the AI's perspective, voice and chat are interchangeable channels. The differences are in the I/O layer, not the reasoning layer.

Every message, escalation, tool call, and resolution writes to a structured audit log. The log captures the user, the customer, the channel, the tier, the action, and the decision rationale. Compliance teams can pull a complete transcript with reasoning for any session. That is the part that makes this deployable inside regulated workflows.

Hard problems we solved

Latency for voice. People expect a phone conversation to feel like a phone conversation. Even a 1.5 second pause feels broken. We use streaming responses where possible, pre-warm the model with system prompts, and short-circuit obvious intents (like "I need to cancel my order") with deterministic handlers that do not require a model round-trip.

Tool-call hallucinations. Claude is good but not perfect at structured output. We added a validation layer between the model and the tool execution: any malformed tool call gets retried with corrective context, and persistent failures escalate the conversation rather than ship a broken response. That guardrail is what stops "AI confidently issued a refund to the wrong customer" from being a possible outcome.

Configuration without redeployment. Every company has different thresholds, different escalation triggers, different policies. We built a CSConfig model that captures all of this and is editable through the admin UI. Changes take effect on the next conversation, no restart required. Operations teams can tune the system without engineering involvement.

The result

The CS AI module is live, handling real customer conversations across voice and chat. The escalation rate from AI Rep to AI Manager is meaningful but bounded. The escalation rate from AI Manager to human is small. Most conversations resolve at tier one, which is the entire point of the design.

The audit trail has already been useful in real operations. When a customer disputed a refund, the transcript answered the question in 30 seconds. When a policy needed tightening, the team could see exactly which conversations had pushed against the limit. That feedback loop is how the system gets better over time.

Why this case matters

Most "AI customer service" pitches are about replacing humans. That is the wrong frame. The right frame is about making the human time count. The AI handles the volume. The humans handle the cases that need judgment, with full context, with the AI's transcript and reasoning attached. That division of labor is the only one that holds up at scale.

Have something to ship?

Tell us what you're building.

Senior engineers, AWS-native, no slideware. We respond within 24 hours.