Reusable template — adaptable to any business with a documented knowledge base (FAQ, product docs, policies)

This is a reference architecture I designed and fully tested end-to-end. All business-specific content (the knowledge base itself, escalation contacts, confidence thresholds) lives outside the workflow logic — replacing the sample FAQ with a real client's documentation is the only step needed to adapt this to a new business.

🔹 Context

Most businesses accumulate a documentation base over time — pricing pages, onboarding guides, billing policies, security FAQs — but customers still end up asking a human the same repeated questions, because searching through scattered docs is slower than just messaging support. Generic chatbots "solve" this by answering confidently from general AI knowledge, which creates a worse problem: confidently wrong answers about a specific business's actual policies.


🔹 Problem


🔹 Solution

Built an AI Customer Support Agent using Retrieval-Augmented Generation (RAG) — the AI only answers using content retrieved from the business's own knowledge base, never from general training knowledge. The system consists of two workflows:

  1. Ingestion Pipeline — a one-time (or on-demand) process that takes a source document (PDF, docs), breaks it into topic-sized chunks, and stores each chunk together with its semantic embedding.
  2. Customer Support Agent — the runtime process: takes an incoming question, finds the most semantically relevant chunks from the knowledge base, and either generates a grounded answer or honestly escalates to a human when no good match is found.

🔹 The Process

Chunking by topic, not by character count. An early version split the source document into fixed-size blocks, which mixed multiple unrelated FAQ answers into a single chunk and diluted the meaning captured by the embedding. Switching to splitting on natural question boundaries improved retrieval accuracy — the same test question went from a 0.45 similarity score (below the usable threshold) to 0.81 (a confident, correct match) after this change.

A relevance threshold as the safety net. Every retrieved answer comes with a similarity score. If the best match falls below the configured threshold, the system does not let the AI answer at all — it escalates to a human instead. This is the same design principle used in the Lead Qualification template: the system is built to recognize the limits of what it actually knows, rather than always producing a confident-sounding response.

Grounded generation. The AI's prompt explicitly instructs it to answer only from the retrieved context, and to say so honestly if the context is insufficient — rather than filling gaps with general knowledge.