The Tier-1 Support Problem
Look at your support queue. A significant percentage of tickets are questions your docs already answer: 'How do I reset my password?' 'What are your business hours?' 'Where is my order?' Your team answers these the same way every time, and it eats the hours they could spend on problems that actually need a human.
An AI support agent solves this by handling the repetitive tier-1 questions automatically, using your existing knowledge base as its source of truth. It answers instantly, around the clock, and only escalates to a human when the question is outside its scope or the customer needs personal attention.
The hard part is not making the AI answer questions. The hard part is making it know when to stop.
Architecture: Intake, Retrieve, Respond, Escalate
The agent has four stages. First, intake: the customer's message arrives through your channel (email, chat widget, form). The agent classifies the intent — is this a question, a complaint, a feature request, or something urgent?
Second, retrieval: if it is a question, the agent searches the knowledge base using a RAG (Retrieval-Augmented Generation) pipeline. It finds the most relevant documents, ranks them by relevance, and checks if the top result passes a confidence threshold.
Third, response: if the retrieval confidence is high enough, the agent drafts an answer grounded in the retrieved documents. The answer is written in the company's tone, includes relevant links, and is checked against guardrails before sending.
Fourth, escalation: if the intent is a complaint, if the retrieval confidence is too low, if the customer has been waiting too long, or if the question touches a sensitive topic, the agent escalates to a human with the full conversation thread and its own analysis attached.
Escalation decision tree
function shouldEscalate(ticket: Ticket, retrieval: RetrievalResult): boolean {
// Always escalate: complaints, legal threats, refund requests
if (ticket.intent === "complaint" || ticket.intent === "legal") return true;
if (ticket.keywords.some(k => SENSITIVE_KEYWORDS.includes(k))) return true;
// Escalate if AI confidence is below threshold
if (retrieval.confidence < 0.75) return true;
// Escalate if customer has already been escalated once
if (ticket.previousEscalations > 0) return true;
// Escalate if wait time exceeds SLA
if (ticket.waitTime > MAX_WAIT_MS) return true;
// Escalate if the answer would involve account-specific data
// the AI should not access
if (ticket.requiresAccountAccess && !ticket.hasAuth) return true;
return false;
}The escalation logic is the most important part of the system. A wrong answer is worse than no answer.
RAG Pipeline: Grounding Answers in Real Knowledge
The retrieval pipeline uses a vector store built from the company's knowledge base: help docs, FAQ pages, policy documents, and past resolved tickets. Each document is chunked, embedded, and indexed.
When a question arrives, the agent embeds the question, finds the top-K most similar chunks, and passes them to the LLM as context. The LLM is instructed to answer only from the provided context and to say 'I am not sure, let me connect you with our team' if the context does not contain a clear answer.
I add a re-ranking step after the initial retrieval: a second model scores each chunk's relevance to the specific question, which catches cases where the vector similarity is high but the content is actually about a different topic. This re-ranking step alone cuts hallucination rates significantly.
Guardrails: What the Agent Cannot Do
Every AI support agent needs hard boundaries. I implement guardrails at three levels. Input guardrails: the agent checks for prompt injection attempts and personally identifiable information before processing. Output guardrails: the generated answer is checked against a policy compliance layer — it cannot promise refunds, share other customers' data, or make commitments outside the documented policies.
Context guardrails: the agent can only access the knowledge base, not customer account data, billing systems, or internal tools. If a question requires account-specific information, the agent escalates rather than guessing.
These guardrails are not suggestions. They are enforced at the code level, and any violation triggers an immediate escalation with an incident log.