1 / 11
A 503-page hands-on project: build a production-ready AI customer support chatbot that answers from your help center with citations, looks up orders, starts returns, and hands off to humans cleanly — with evals, guardrails, and a full launch.
From Knowledge Base to Production with LLMs, RAG, Tools, and Human Handoff
Read before you buy: the PDF here is a free sample — the first 20 pages of the 503-page book (payments, sales and reviews on this demo site are sample data). Get the full e-book at thenexbooks on Gumroad.
Your support team answers the same questions every day. An AI assistant could answer many of them — if it gets them right.
"Where is my order?" "How do I return this?" "Why is my device blinking?" Most support questions have clear answers in a help article, a policy page, or an order record. A well-built AI assistant can answer them in plain language, with citations, look up the customer's real order, start a return, and hand the conversation to a human — with full context — when it should. A badly built one invents policies, promises refunds nobody approved, leaks data, and traps frustrated customers in loops. The difference is the engineering and the product decisions around the model.
This book walks you through that engineering as one hands-on project. Chapter by chapter, you build the complete support assistant for Glowfield, a fictional smart-home store: from scoping and conversation design, through retrieval with citations, tool calling, identity verification, and human handoff, to evaluation, guardrails, privacy, deployment, and launch.
- 503 pages · 28 chapters + 4 appendices
- Scoping intents, support data, success metrics, and an escalation policy
- A FastAPI backend, PostgreSQL with pgvector, and a provider-agnostic LLM client
- Conversation design, system prompts, memory, and a streaming chat API with Server-Sent Events
- A React and TypeScript chat widget with streaming answers and source citations
- Knowledge-base preparation, chunking, embeddings, hybrid search, reranking, and freshness
- Safe fallbacks, confidence, and clarifying questions when the assistant doesn't know
- Tool calling for orders, returns, cancellations, and warranty checks — with identity verification
- Human handoff with context transfer, helpdesk integration, and web, email, and messaging channels
- Evaluation sets and LLM judges, prompt-injection guardrails, PII and privacy, and multilingual support
- Analytics (containment, CSAT, reopen rate), cost and latency, deployment, monitoring, and a full launch case study
- Model- and vendor-neutral: placeholders instead of model names, illustrative prices and metrics
Table Of Contents
Part I — Planning the Chatbot
- Ch 1 · What a Good Support Chatbot Does (and What It Should Never Do)
- Ch 2 · Scoping the Project: Intents, Support Data, Success Metrics, and Escalation Policy
- Ch 3 · Architecture of a Modern Support Chatbot
- Ch 4 · Project Setup: FastAPI, PostgreSQL with pgvector, and a Provider-Agnostic LLM Client
Part II — The Conversation Core
- Ch 5 · Conversation Design: Persona, Tone, and Support Flows
- Ch 6 · Prompting the Support Assistant: System Prompts, Policies, and Response Formats
- Ch 7 · Conversation State, Memory, and Context Windows
- Ch 8 · A Streaming Chat API with Server-Sent Events
- Ch 9 · Building the Chat Widget with React and TypeScript
Part III — Grounding Answers in Your Knowledge
- Ch 10 · Preparing the Knowledge Base: Help Articles, Policies, Manuals, and Past Tickets
- Ch 11 · Chunking, Embeddings, and Vector Search with pgvector
- Ch 12 · Retrieval-Augmented Answers with Citations
- Ch 13 · Better Retrieval: Hybrid Search, Reranking, and Keeping Knowledge Fresh
- Ch 14 · Knowing What It Doesn't Know: Confidence, Clarifying Questions, and Safe Fallbacks
Part IV — Taking Action
- Ch 15 · Tool Calling: Order Status, Account Lookups, and Product Data
- Ch 16 · Authentication, Identity Verification, and Permissions in Chat
- Ch 17 · Multi-Step Workflows: Returns, Cancellations, and Guided Troubleshooting
- Ch 18 · Human Handoff: Escalation Rules, Context Transfer, and Helpdesk Integration
- Ch 19 · Going Multichannel: Web, Email, and Messaging Apps
Part V — Quality, Safety, and Trust
- Ch 20 · Evaluating the Chatbot: Test Sets, Metrics, and LLM-as-a-Judge
- Ch 21 · Guardrails: Prompt Injection, Off-Topic Requests, and Harmful Content
- Ch 22 · Privacy, PII, and Compliance for Support Conversations
- Ch 23 · Multilingual Support
- Ch 24 · Analytics: Containment, CSAT, and Conversation Review
Part VI — Production and Launch
- Ch 25 · Cost, Latency, and Scaling
- Ch 26 · Deployment, Monitoring, and Incident Response
- Ch 27 · Continuous Improvement: Feedback Loops, Knowledge Gaps, and Safe Prompt Releases
- Ch 28 · Case Study: Launching the Glowfield Support Assistant
Appendices
- App A · Support Chatbot Cheat Sheet
- App B · Templates and Reference
- App C · Launch Checklist
- App D · Glossary
WHO IT IS FOR
Backend and full-stack developers asked to add an AI assistant to a product or support site, developers at agencies and startups who build chatbots for clients, technical support-operations and product people, and tech leads responsible for the quality, safety, and cost of customer-facing AI. You should be comfortable reading Python and a little TypeScript; no prior LLM experience is required.
FORMAT
PDF (A4), 503 pages, English, clickable table of contents and PDF bookmarks. 1st Edition, 2026. Published by thenexbooks.
This book is independent and is not affiliated with or endorsed by any AI model provider or helpdesk vendor. All product names are trademarks of their respective owners. Prices and metrics in the book are illustrative; nothing in it is legal advice.
Book details
| Detail | |
|---|---|
| Pages | 503 |
| Format | PDF (A4) |
| Language | English |
| Level | Intermediate |
| Edition | 1st Edition, 2026 |
| Download on this site | Free sample, first 20 pages (PDF) |
| Publisher | thenexbooks |
Files you get
No reviews yet. Only buyers can review.
More from thenexbooks