The five layers
LLM layer
Frontier models (GPT-4o, Claude, Gemini). Often multi-model, different models for different tasks.
Retrieval (RAG)
Embedding store, hybrid search, reranker. Grounds answers in your content.
Tools
Functions the model calls, order lookup, refund issue, calendar book.
Guardrails
Input filtering, output policy enforcement, refusal handling.
Observability
Traces, evals, A/B, error budgets, hallucination detection.
A request, end to end
- User message arrives via web widget, Slack, Teams, SMS, or API.
- Auth + identity resolved (anonymous, known visitor, authed user).
- Input filter screens for jailbreaks, PII, abuse.
- Intent classifier (smaller, faster model) routes to the right flow.
- RAG fetches relevant context from your knowledge sources.
- Tool selection: which APIs or functions are appropriate to call.
- LLM generates a draft answer using context and tool outputs.
- Output guardrails check the response (no hallucination on facts, no policy violations, citation present).
- Response delivered, telemetry written, latency budget compared to SLO.
Why multi-model is the new default
A single model is a single failure mode. The 2026 architecture routes between Claude (better tone, lower hallucination on long context) and GPT-4o (faster, better tool calls) per task. Vendor lock-in is also reduced, if a provider goes down or raises prices, the routing layer reroutes.
RAG done right
- Hybrid retrieval (dense + sparse), never dense-only.
- Reranker on top, moves relevant chunks to top-3.
- Citation propagation, every claim cites source URL + section.
- Freshness, re-embed on doc updates within minutes.
- Per-tenant separation, no cross-customer leakage.
Tool calling: where chatbots become agents
When the bot can issue refunds, book appointments, and update CRM records, it crosses from chatbot to agent. The architecture needs human-in-the-loop checkpoints for high-impact tools, idempotency keys, and full audit logs of every tool invocation.
Guardrails: input + output
- Input: jailbreak detection, PII redaction, profanity, abuse.
- Output: hallucination detection, banned topics, brand voice check, citation completeness.
- Refusal phrasing: warm, empathetic, route to human.
Observability is non-negotiable
Without traces, you cannot debug a hallucination. Without evals, you cannot ship a model upgrade safely. Without A/B, you cannot prove a prompt change won. Modern chatbots are operated like services, not toys.
Latency budgets
Where teams trip
- Skipping evals, model upgrades silently regress.
- No reranker, RAG retrieval is noisy.
- No human handoff, the bot has nowhere to go when stuck.
- No PII redaction, leaks PII into logs and traces.
Keep reading
What to read next
- TechnologyWhy Multi-Model AI (GPT-4o, Claude 3.5, Gemini) Wins 9 min
- TechnologyAI Chatbot Security: Data Privacy & Best Practices 12 min
- TechnologyChoose the Right AI Model for Your Chatbot (2026) 10 min
Popular:Website AI chatbotFree AI chatbot for your websiteAI chatbot for small businessNo-code AI chatbotWhat is an AI chatbot?Best AI chatbot platforms
AI chat with this architecture, ready to ship
Multi-model, RAG with reranker, guardrails, full observability, out of the box.
See pricing