close icon
Home
Blog
How to stop your chatbot from hallucinating

How to stop your chatbot from hallucinating

Share

When someone chats with an agent on your website or app, they’re expecting clear, accurate answers. But sometimes, agents get it wrong. And in some cases, they make things up. That’s called a hallucination.

What causes hallucinations in chatbots?

Skip the context and go straight to the setup tips from "The essentials." All AI chatbots, including Copilot.live agents, are built on large language models (LLMs). These models are great at understanding language and replying in a way that sounds natural. But there’s one important thing to understand: they don’t “know” facts in the way humans or databases do.

LLMs work by predicting the next word in a sentence based on patterns they’ve seen across a huge amount of training data. When you ask a question, the model tries to guess what a good response should sound like. It doesn’t look up answers from a fixed source. It generates them. It’s like texting someone who’s great at finishing your sentences, even if they don’t fully understand what you’re saying.

If the question is vague, unclear, or outside the data your agent has been trained on, the model might still try to answer. And that answer might sound confident, but be completely wrong. That’s what we call a hallucination.

Why it matters

Even if the mistake isn’t huge, it can still confuse your users. They might leave your site, which means you’ve lost a lead or a potential customer. In serious contexts like finance, healthcare, or legal, the consequences can be much bigger.

The good news is your agent on Copilot.live can be trained to do better. With the right setup, you can guide it to respond accurately and stay grounded in what you’ve taught it.

Here’s how to make that happen.

The essentials

These are must-haves. Set them up properly, and your agent will be much more accurate from the start.

1. Persona

Persona

When you create a new agent in Copilot.live, one of the first things you’ll see is the Persona section. This is where you define what your agent is, what it’s supposed to do, and the tone it should follow.

Persona2

We give you a pre-filled Persona template to get started. It covers the basics, like the agent’s role and what to avoid. This gives your agent a solid foundation from the start.

We’ve also got ready-to-use Persona templates for common use cases, like customer support. You can find them in our docs. Just copy, paste, and tweak them to match your needs. This alone can get your agent most of the way to sounding accurate and helpful.

Persona templates

2. Creativity settings

Creativity settings

In your Configuration panel, you’ll find a Creativity slider. This controls how much your agent is allowed to improvise.

  • Keep it low if you want the agent to stick closely to your training and data.
    Example: A support agent who explains product features should stay factual and grounded.

  • Increase it if your agent needs to be more conversational or suggestive.
    Example: A lifestyle or wellness agent that gives tips or advice might benefit from a bit more flexibility.

3. Accurate data sources

Your agent is only as smart as the information you give it. If you don’t upload anything, it’ll rely on general knowledge, which may not be accurate, and definitely won’t be specific to your business.

To keep your agent grounded, upload content that reflects what your company says and does. Prioritize:

  • Company docs: Internal documentation, help guides, support articles
  • Blog posts: Especially ones that explain your product or point of view
  • FAQs: From your website, email replies, or existing support tickets
  • About pages: Anything that clearly explains who you are and what you offer

Avoid feeding generic or vague material. The more targeted and specific the source, the better your agent can answer real questions from your users.

4. Data formats that work best

The format of your data makes a difference. Some file types are much better for training than others.

Here’s a rough order of what works best:

  • JSON / XML – Best for structured content like product info, FAQs, or mapped responses
  • Plain text files – Easy to read and parse, as long as the content is well written
  • PDF / Word documents – Okay for manuals, guides, and articles, but make sure they’re clean and readable
  • CSV / Excel sheets – Works for things like pricing tables or inventory, but needs to be clearly labeled and organized

The higher up on this list, the better your results will be. If your content is sitting in a clunky format, take a few minutes to clean it up or convert it before uploading. It’ll save you time (and headache) later.

Beyond the basics

Once you’ve nailed the setup, these additional steps will help your Copilot.live agent respond better.

1. Set up human handovers

Set up human handovers

If your agent isn’t sure how to respond, it’s better to hand off the conversation rather than guess. It’ll likely get things wrong otherwise.

Add instructions like: “If the user sounds upset, asks for help more than once, or types ‘talk to a human,’ transfer the chat to an agent.”

You can also define which queries should always be handed over, like anything related to billing, cancellations, or complaints. The smoother the handoff, the better the user experience.

2. Continuous updation

Your agent isn’t a set-it-and-forget-it tool. Check in regularly to see how it’s doing. Update the persona, upload fresh content, and fix weak responses.

Here’s a quick checklist:

  • Are users getting accurate answers to the top 5 questions?
  • Has anything changed in your product or policy?
  • Is the agent missing context or hesitating too often?

A little maintenance goes a long way. And the more your business evolves, the more important it is to keep your agent in sync.

3. Test your agent like a real user would

Before going live, chat with your agent. Pretend you're a curious (or confused) customer and ask:

  • Vague or open-ended questions
  • The same thing in different ways
  • Questions with typos, slang, or short phrases
  • “Wrong” or off-topic questions, and see how it recovers

This helps you catch where it’s guessing, where it’s confident, and where it needs more training.

4. Add fallback instructions 

Sometimes, your agent won’t know the answer, and that’s okay. But how it handles that moment matters.

In your persona or behavior settings, give it clear fallback guidance like:

  • “If unsure, say you don’t know and offer to connect to support.”
  • “Avoid guessing. Direct the user to the help page when needed.”

This keeps things honest instead of letting the agent fake confidence.

5. Make use of sentiment analysis

Make use of sentiment analysis

We recently rolled out Sentiment Analysis in your Inbox. It helps you understand how each chat went by breaking down the mood and topic. If you want the full breakdown, check out this article. This one’s more of a fine-tuning tool. But if you're looking to go deeper into your agent’s performance, it’s a great way to improve.

Look at what kinds of chats are getting negative reactions. Then go back to your training data or instructions and see what you can improve. Over time, this can really sharpen how your agent responds.

Your agent works best when you teach it well

Yes, AI agents are smart. But they don’t know your brand, your tone, or your users until you teach them. A few extra minutes during setup can make a huge difference in how helpful and trustworthy your agent feels. So if you haven’t already, go give your setup a quick check and let us know how it goes.

Happy building!

FAQs

Full documentation in Finsweet's Attributes docs.

Do you want to create your own online store?
Book a Demo