Case study 06 — AI support with human handoff
Ampere
The design assumption is that the AI will sometimes be wrong. Everything else follows from that: it answers only from documents it has, it watches its own output for signs of failure, and when it finds one it hands over inside the same conversation rather than leaving the customer at a dead end.
- Next.js
- Node.js
- Socket.IO
- Together AI
- LangChain
- SQLite

The problem
Support bots fail in three predictable ways. They hallucinate — inventing pricing and features that do not exist. They trap the customer, with no clear path to a human. And they leave the support team without live context, so the same question gets answered from scratch every time.
What we built
Three services. An embeddable widget with persistent sessions, live streaming and path-based visibility. A backend where retrieval-augmented answers are drawn strictly from company documentation, and every AI response is scanned before it is sent. And a live agent dashboard where tickets, chat history and customer metadata stay synced across every logged-in agent in real time.
How it works
Answers grounded in your documentation
The backend loads a knowledge base and instructs the model to answer strictly from it, citing top sources with their match scores. That constraint is the whole point: it is what prevents the bot inventing a pricing tier that does not exist.
Escalation triggered by the model's own uncertainty
Every AI response is scanned before it reaches the customer. A failure signal in the text attaches an escalation button to that message, so the customer is offered a human at the exact moment the AI stops being useful — not after they have given up.
Failures collected as a work queue
Questions that triggered escalation land in a dedicated unanswered-questions view. Every AI failure becomes a specific line item for whoever maintains the knowledge base, and once it is updated the bot handles that question itself.
The agent knows who they are talking to
The widget passes the customer's UID from the host site's login state, and the backend resolves their name, email and subscription plan through a secure Firebase lookup, attaching it permanently to the ticket. The agent sees whether this is a free or paying customer before they type a word.
Handoff inside the same window
The agent joins the conversation the customer is already in, with the full AI transcript above it. Ticket status syncs live across every logged-in agent, so a ticket flipping to human-handled is visible to everyone — which is what stops two agents working the same case.
Degrades instead of going down
Missing API keys or credentials drop the server into a mock mode rather than taking the service offline, and Discord webhooks alert the team on escalation so nobody has to watch the dashboard to know a customer is waiting.
In the product





Outcome
Support drop-off falls where the AI is unsure, because there is always a path to a person. Agents coordinate in real time with full context. The deck's own summary puts it best: a support system built for production, not a chatbot demo that breaks under real questions.
Have a system like this in mind?
Tell us the workflow you are trying to fix and we will tell you what it would take to build.