Support chatbots have moved from scripted decision trees to LLM-powered assistants that can actually answer questions. But a demo that impresses in a meeting is very different from a bot you can trust with real customers. Here is the architecture we use and the pitfalls we see most often.

The basic architecture

A production support bot usually has five parts:

  1. Channel layer - website widget, WhatsApp, Slack or in-app chat
  2. Orchestrator - your backend that receives a message, decides what to do and calls tools
  3. Retrieval (RAG) - search over your help center, docs and past tickets
  4. LLM - generates the answer from the retrieved context
  5. Handoff and logging - escalates to a human and records every conversation
User -> Widget -> Orchestrator -> Retriever -> Vector DB | | +----> LLM <----+ | +----> CRM / Ticketing (handoff) 

Retrieval-augmented generation done right

RAG is what keeps the bot grounded in your content instead of inventing answers.

  • Chunk by meaning, not by character count. Split docs on headings and keep chunks around 300 to 800 tokens.
  • Store metadata like product, plan and language so you can filter before searching.
  • Use hybrid search. Combine vector similarity with keyword search; product names and error codes are often missed by embeddings alone.
  • Re-rank the top results before sending them to the model.
  • Cite sources in the answer so users (and your team) can verify.

Guardrails that matter

  • A clear system prompt that limits the bot to your product and tells it to say "I don't know" when context is missing
  • Refusal and escalation rules for billing disputes, legal questions and angry customers
  • PII redaction before logs are stored
  • Rate limits and abuse detection on the public widget

Connect it to your systems

The biggest value comes from actions, not answers: checking order status, resetting a password, creating a ticket or updating a CRM record. Expose these as narrowly scoped tools with their own permission checks, and never let the model call internal APIs directly.

Measure before you scale

Track at least:

  • Resolution rate without human handoff
  • Escalation rate and reasons
  • Answer accuracy on a fixed test set of real questions
  • Customer satisfaction after bot conversations
  • Cost per conversation

Re-run your test set every time you change prompts, models or retrieval settings.

Common pitfalls

  • Indexing outdated docs, so the bot confidently gives old answers
  • No human handoff, which frustrates users with edge cases
  • Treating the prompt as the only safety layer
  • Launching on every channel at once instead of starting with one

Written by the team at Codestruk, a software development company in India that builds AI chatbots, AI CRM integrations and custom SaaS products.