Skip to main content
These Chatbase best practices help you improve the answers your AI agent gives customers, on every channel it runs on. They’re for anyone who has built an AI agent and wants it to be more accurate, stay on topic, and hand off to a person at the right time. Each practice comes with a bad and a good example you can compare against your own setup. The quality of your AI agent’s answers comes down to four things you control: the instructions you give it, the Data Sources you train it on, the model you pick, and how you correct it once it’s live. This page covers each in turn, then how to test and design escalation before you launch.
Work through these in order. Instructions and data sources account for most quality problems, so fix those before reaching for a different model.

Refine the AI agent’s instructions

The instructions shape your AI agent’s behavior and responses. Use them to set a persona, define tone, or specify the types of questions the AI agent can answer. Clear, precise instructions keep the AI agent aligned with your goals and your user experience. This is the default, which you can edit or replace:
To keep the AI agent from answering outside your training data, say so explicitly. For example: “You will only provide answers based on the information from your training data.” Vague instructions leave the AI agent to guess your scope, tone, and what to do when it doesn’t know. Compare these two:
This doesn’t say which product, who the customers are, what’s off-limits, or what to say when the answer isn’t in the training data. The AI agent fills those gaps itself.
Each line answers a question the AI agent would otherwise guess at: who it works for, what it covers, how long and in what tone to reply, what’s off-limits, and when to hand off.
For a fuller template, use the example below after customizing it to suit your company.
Put rules that must hold in every conversation, such as topics to avoid or information never to share, in the separate Guardrails instructions field on Build > Instructions. For more detail on refining your instructions, including examples for support, sales, and ecommerce, see Instructions.

Improve readability of data sources

The quality of your AI agent’s responses depends heavily on the quality of the data sources you provide. Chatbase relies on readable text to generate accurate responses, so make sure the websites or PDFs you upload contain readable text. Some websites aren’t scraper-friendly. If your AI agent struggles to answer questions based on your website, this could be why. Work around it by copying the information in as text, or uploading it as a PDF.
Chatbase can’t process images, videos, or other non-textual elements in documents.
Product: Widget123, colors not specified, possibly red or blue. Discount details unclear. Weight: Approx. 1 kg or 1.5 kg? Shipping: Delivery time uncertain, could be fast or delayed. Availability: Global shipping not confirmed. Packaging: Uncertain if it comes in a box. Assembly: Information unclear. Limited stock? Not confirmed.
Product: Widget123
Colors: Red, Blue
Discount: 50% off
Weight: 1.5 kg
Shipping: Estimated delivery within 1-2 weeks (depends on location)
Availability: Ships worldwide
Packaging: Comes in a standard-sized box
Assembly: Some assembly required
Order Now: Limited stock available, don’t miss out!
The product is a thing. Its color is unspecified, and its size is unknown. The product might be useful, but it’s not clear. Its availability is uncertain, and shipping times are not mentioned. There might be a discount, but it’s not specified. Assembly instructions? Unclear. Get it soon? It’s unclear when stock might run out.
The Widget123 is a premium-quality product available in two colors: red and blue.
It offers a 50% discount, making it an excellent deal.
The product weighs 1.5 kg and is shipped worldwide.
You can expect delivery within 1-2 weeks, depending on your location.
The item comes in a standard-sized box and requires minimal assembly.
Act fast, stock is limited!

Add suggestable images

To display images in the Chat Bubble, have the AI agent send image links in markdown format. The URL must end in .png or .jpg for the image to render. You can also use a Widget. You can include a line like this in your instructions to display an image after each response:
The link must point to the image file itself:
  • Bad: https://example.com/products/tent, a product page rather than an image, so nothing renders.
  • Good: https://example.com/images/tent.png, a direct link to a .png file.
Once added, every AI agent response displays the image:
An AI agent response with an image rendered beneath it

Choose the right AI model

Selecting the right model matters for performance. Match it to your use case, considering task complexity and speed: a model suited for structured data is ideal for data-heavy tasks, while a conversational model works best for customer support. Also consider scalability. Choose a model that can grow with your needs, handling more data while maintaining accuracy. Some models are better for real-time interactions, others excel in batch processing.

Compare models side by side

To see how each model responds, go to Build > Instructions and click Compare in the header. You can run the same message against several models at once and judge:
  • Response quality and accuracy
  • Response time and speed
  • Tone and personality
  • Handling of edge cases
  • Bad: your AI agent gets a pricing question wrong, so you switch to the model with the highest message credit cost. If the right price isn’t in your Data Sources, the new model gets it wrong too, and each reply now costs more.
  • Good: you first confirm the price is in your Data Sources and readable, then use Compare to send the same five real customer questions to two or three models, and pick the cheapest one that answers all of them well.
If you’re unsure which model to use, see the models comparison page.

Use Revise and Q&A to correct answers

Two features let you fix a wrong answer so it stays fixed. Add Q&A’s gives the AI agent exact answers for specific questions. On Build > Data Sources, click Add Q&A’s. When a user asks something similar to one of your saved questions, the AI agent replies with your predefined answer word-for-word. Revise corrects an answer after the fact. Monitor your AI agent’s responses under Activity > Conversations. When you find an answer you’d like to change, click the revise button and adjust it. The revised answer is saved as a Q&A data type, so the AI agent references it for future queries. Revised responses appear on Build > Data Sources with a Q/A badge.
Revising an AI agent answer from the conversation log
Because a matching Q&A is sent word for word, write each answer the way you want a customer to read it:
  • Bad: Question “Refunds?” with the answer “See policy.” The question is too short to match the ways customers ask, and the answer gives them nothing.
  • Good: Question “How do I get a refund for my order?” with the answer “You can request a refund within 30 days of delivery. Reply with your order number and we’ll start it for you.” Use your own policy in place of this sample.

Test before you launch

The Playground shows you one conversation at a time. Before customers see your AI agent, test it more systematically:
  1. Ask real questions in the Playground. Use questions from your support inbox, worded the way customers write them, including typos and vague ones. The Playground runs your draft, so you can test changes before you publish.
  2. Compare settings side by side. On Build > Instructions, click Compare to send the same message to several models, temperatures, or instructions at once. See Compare area.
  3. Run Tests for the conversations that matter most. A test is a conversation between your AI agent and a simulated customer, graded automatically against a success criterion you write. Tests run against your published AI agent, so run them again after you publish each change and compare the pass rate.
A good test describes one customer and one outcome. For example: Tests don’t reach your customers: the conversations aren’t saved to your chat logs, and Actions return a generic success instead of running, unless you set a read-only Action to Live. Tests use free monthly test credits first, then message credits. On the Free plan, tests use message credits from the start. See Test credits.

Design escalation before you need it

Every AI agent meets questions it can’t or shouldn’t answer. Decide in advance where those conversations go, so customers aren’t left stuck. Chatbase has two ways to hand a conversation to a person: When you set up an escalation, write down when it should happen. The Escalations Action’s When to use field tells the AI agent when to create a ticket:
  • Bad: “Escalate when needed.” The AI agent has to guess what “needed” means.
  • Good: “Create a ticket when the customer asks for a person, reports a billing error, or still has the same problem after two answers. Confirm with the customer before creating the ticket.”
For escalation flows with several steps, such as collecting an order number before handing off, use a Procedure. A Procedure’s branch conditions can use the {{agentAvailable}} variable, which is true when at least one Helpdesk agent is available, so the AI agent can offer live chat when your team is online and a ticket when it isn’t. To check that escalation works, write a test whose simulated customer asks for a person, and add the escalation Action under Expected Actions. The test fails if the AI agent never calls it. See Expected Actions.

Pre-launch checklist

Before you deploy your AI agent to customers, confirm that:
  • Every source on Build > Data Sources shows Synced, and the content is readable text.
  • Your instructions state the AI agent’s role, its scope, a fallback reply for unknown questions, and when to hand off.
  • Rules that must always apply are in the Guardrails instructions field.
  • Questions that need an exact answer, such as pricing or policies, have a Q&A.
  • Your most important conversations have Tests, and they pass.
  • An escalation path is set up and tested.
  • You’ve clicked Publish so your changes are live.
  • Someone will review conversations in Activity after launch and fix wrong answers by adjusting whatever caused them, such as the instructions, Actions, Procedures, or Data Sources.

Frequently asked questions

Usually because its instructions don’t tell it to stay within its training data, or because the answer isn’t in its Data Sources. Add an instruction such as “Answer only from your training data” with a fallback reply, then add the missing content. A low temperature also keeps answers more focused. See Temperature.You can also ask Backstage to fix it for you. Describe the wrong answer in plain language, and Backstage can update the instructions, build an Action or a widget, or set up a Procedure. Its changes go into your draft, so click Publish to make them live.
Ask the same question in the Playground, then click Show sources below the chat. It lists the Data Sources the AI agent used for that reply, so you can update or remove the one behind a wrong answer.
Add a Q&A on Build > Data Sources. When a customer asks something similar to the saved question, the AI agent replies with your answer word for word. Use Q&A for pricing, policies, and anything else that must be worded exactly.
Not first. Most wrong answers come from instructions or Data Sources, and a different model can’t answer from content it doesn’t have. Fix those first, then use Compare to test models on the same questions. See Models comparison.
Run your Tests before the change, then again after you publish it, and compare the pass rate. Tests run against your published AI agent, not your draft. Also watch real conversations in Activity and trends in Analytics.
Use instructions for how the AI agent behaves in every conversation: its role, tone, and rules. Use a Procedure for a specific situation that needs ordered steps, such as a refund, an order issue, or an escalation, where you don’t want the AI agent improvising.

Next steps

Instructions

The full reference on instructions, Guardrails, model, and temperature.

Data Sources

Add, organize, and retrain on the content your AI agent learns from.

Models comparison

See how the available models differ before you commit to one.

Analytics

Track conversations and measure whether your changes actually helped.