Rylvo
Blog

Why Did My Chatbot Say That? How to Trace One Bad Answer to Its Cause

How to debug AI chatbot answers in 5 steps: trace one wrong reply to the page it read, the prompt version, the model, tool calls and guardrails, then fix it.

In this articleOverview

To debug a wrong chatbot answer, open the record of that one reply and check five things in order: the page it read, the instructions it followed, the model call, the tools it used and the guardrails. A wrong answer usually comes from one of those places, and checking them in order narrows the cause to one.

Key takeaways

  • Debug one reply at a time. Read what the bot had to work with before you blame the model.
  • Check five things in order: the passages it read, the prompt version, the model call, the tool calls and the guardrails.
  • Fix the cause in a test copy, not in the live bot, and release the fix.
  • Turn the bad reply into a test case so the same mistake is caught next time (how to write the test).
  • Group failures by cause once a week, so you fix patterns rather than single replies.

Why a wrong answer is worth tracing

A wrong answer is not only embarrassing. On February 14, 2024, the British Columbia Civil Resolution Tribunal held Air Canada responsible for what its website chatbot told a customer about bereavement fares, and rejected the argument that the chatbot was responsible for its own words (Moffatt v. Air Canada, 2024 BCCRT 149). The OWASP Top 10 for LLM Applications 2025 lists the same problem as LLM09: Misinformation, "when LLMs produce false or misleading information that appears credible", and names retrieval from trusted sources and human review among the mitigations (as of November 2026).

What a trace shows you

A trace is the record of one reply. For a support bot, it answers the questions you would ask a new hire who got something wrong: what did the customer say, what did you look up, what were you told to do, what did you try and what stopped you.

Opening a reply's full steps (Trace Replay) is on Lite and up, and the 7-day Pro trial includes it; the other plans list the replies without the steps. The method below works the same way in any tool that records retrieval, prompts and tool calls.

In Rylvo, every reply your bots send opens a trace, whether it came from the dashboard chat, the website widget, a Beam link, WhatsApp, Telegram, another channel or the public API. Each trace holds:

Part of the traceWhat it tells you
The conversation turnThe customer's message and the bot's reply, with the outcome: Passed, Warning or Failed
Knowledge baseThe passages the bot read, the source of each and its match score
What the model readThe instructions, earlier messages, this message, tool rounds and tool definitions, counted in tokens and set against the model's context window
Model callsThe provider and model, the prompt version, the input, the output and why it stopped
ToolsEach tool or connector call with its arguments, result and any error
GuardrailsEach check that could act on the message or the reply, and whether it passed, blocked, rewrote or escalated
Where the time wentFrom the message received to the reply ready: loading context, checks, the model, tools, guardrails and sending

Illustrative trace for Maya's reply (made-up values; Maya's case is worked through below)

StepWhat it recorded
Knowledge base3 passages. Top match: "Returns FAQ (2023)", score 0.81, says 60 days. Next: "Returns policy", score 0.74, says 30 days
Model callPrompt version 7, finished normally
ToolsNone called
GuardrailsPassed

Read it top to bottom: the old page outranked the policy page, so the fix is the content, not the prompt.

Under the hood a trace is a tree of steps of ten types: generations (model calls), tools, agents, guardrails, retrievers (knowledge searches), embeddings, evaluators, spans, events and chains. Those names matter if you export traces to another tool.

API keys, bearer tokens, passwords and card numbers are masked before a trace is saved. Email addresses and phone numbers are kept, so you can still find the person a reply was for.

How to debug a wrong chatbot answer in 5 steps

Take an illustrative example, not a real customer. A furniture store's support bot tells a customer, Maya, that she can return a damaged table within 60 days. The store's policy is 30 days. Here is how the five steps find out why.

Step 1: Find the exact reply

Start from the customer's words, not from a dashboard average. Search the reply list for the conversation, or open the person's history and pick the turn. Make sure you are looking at the right environment: a Rylvo workspace has Test and Production, and the Traces area shows one at a time, so a test conversation never hides among real customers (why Test and Production are kept apart).

Read the whole conversation in Sessions, not only the bad turn: many "wrong answers" reply to something said three messages earlier. In Maya's case, her message is in Production and nothing earlier in the conversation mentions returns, so the problem is in this one turn.

Step 2: Check what the bot read

Open the Knowledge base part of the reply. There are four common results:

  1. The right passage, read correctly. Move on to step 3.
  2. An outdated passage. The bot quoted an old returns page that still says 60 days. The fix is your content, not the bot.
  3. Nothing matched. The bot answered from general knowledge. When nothing passes the match threshold, the closest passages are used anyway and the reply notes it.
  4. The knowledge base could not be searched. This shows as a failure of its own: the bot answered without it.

In Maya's trace, an old FAQ page saying "60 days" outranked the current policy page. Content problems are the first thing to rule out, which is why our guide to stopping a chatbot from making things up starts with the content, not the prompt.

Step 3: Check the instructions and their version

Open What the model read, then the model call. Look for three things:

  • The prompt version. The model call shows which version of your prompt was live. If the bad answers started on a day, compare it with the day a prompt changed.
  • A conflicting rule. "Always be generous with customers" can beat a 30-day policy. The instructions the bot was given are listed. So are instructions it never saw: when a placeholder in a prompt points at something the bot does not have, Rylvo removes that sentence before the model runs, and the trace shows what was dropped.
  • A crowded context. If earlier messages and tool definitions fill most of the model's context window, the passage that mattered may be a small part of what it read.

In Maya's trace, the prompt version live that day has no returns rule, so the bot defers to what it retrieved. To change instructions safely, edit and version them in Prompts and compare the new version against the old one before you release it.

Step 4: Check the model call and the tools

The model call tells you why it stopped: it finished its answer, it asked for tools, it hit the output limit, or it failed. A reply cut off mid-sentence is usually the output limit. Maya's trace shows no tool calls, and none were needed for a policy question.

Then open each tool call. Three patterns cover most tool problems:

  • The tool failed. The order lookup returned an error, and the bot covered the gap with a guess. The step says whether a retry could succeed or whether retrying will not help until the cause is fixed.
  • The tool was blocked. A guardrail stopped it before it ran, or it is waiting for a person to approve it.
  • No tool ran at all. The reply says "I've started your return", but nothing was called. Rylvo counts this as its own failure, Claimed an action, because the customer is waiting for something that is not happening.

Step 5: Check the guardrails, then fix the cause

Guardrails can block a reply, rewrite it or hand the conversation to a person. A rewritten reply can read oddly because the customer saw the rewrite, not what the model wrote. A judged guardrail that could not run is also recorded, because it did not protect that reply.

Now fix the cause you found, in this order of preference:

CauseFix
Outdated or missing contentUpdate or add the source in the knowledge base, then ask the same question again
Nothing matchedAdd a page that answers the question in the customer's words, or lower that knowledge base's match threshold
Conflicting or missing instructionEdit the prompt, test the new version, release it
Tool failed or was called with wrong argumentsFix the connector or the tool description the model reads
No tool ran but the reply claimed it didAdd an instruction never to confirm an action without the tool's result, and a test for it
Guardrail too strict or too looseChange the guardrail, then run the conversations it should and should not catch

For Maya, the fix is to archive the old returns page, ask the same question again in Test, release, and save the reply as a test case. In general, make the change in Test, not in the live bot, and check the same message there. In Rylvo, changes made in Test reach Production with the next release (Environments).

Finally, save the bad reply so the mistake stays fixed. Add it to a dataset, create a test case from it, and run it with your other tests before every release. The pre-launch testing guide covers how to write the expected answer.

From one reply to patterns: Failure modes

Tracing one reply tells you about one customer. Once a week, look at all of them grouped by cause. Rylvo's Failure modes page groups what went wrong over the last hour, 24 hours, 7 days or 30 days, compares each cause with the period before (New, Rising, Falling or Steady), says what it meant for the customer, and opens the replies behind every number.

The causes it tracks include No reply, Model error, Claimed an action, Tool failed, Tool blocked, Connector failed, Blocked, Rewritten, Escalated, Guardrail not evaluated, Knowledge base unavailable, Truncated, Budget hit and Degraded. A rising cause matters more than any single bad reply: ten "Knowledge base unavailable" replies in one afternoon is an outage, not a prompt problem.

Scoring replies you did not read

You cannot read every reply. Evaluators let an AI judge score a sample of one bot's live replies against criteria you write, such as "quotes the 30-day policy correctly" or "never promises a delivery date", with a reason on each score. Evaluators are bot settings, so you change them in Test and they reach Production with the next release. Automatic scoring is on Lite and up.

For a deeper check before customers find problems, Edge Cases scans recent conversations for failures and drafts proposed fixes for a person to review (Edge Cases), and Red Team runs attack conversations against your bot. Both are on Pro and up, and the 7-day Pro trial for new workspaces includes them. A person still approves every fix. If you are worried about customers steering the bot on purpose, read how prompt injection works against support bots.

What it costs, and how long traces are kept

Every plan, Free included, lists the replies your bots sent. Opening a reply's full steps, the method above, is Trace Replay, on Lite ($40 a month) and up. The 7-day Pro trial includes it.

PlanTrace historyOpen a reply's full steps
Free7 daysNo
Starter14 daysNo
Lite14 daysYes
Pro90 daysYes
EnterpriseCustomYes

Prices checked on 2026-11-17; see pricing for the current figures. A workspace can choose a shorter window. A reply you add to a dataset is preserved past the window, within your plan's dataset limits, which is the way to keep the examples that matter.

Each model call in a trace is priced from one model price table, the same one the engine uses, or from a rate you set. A model with no price shows as Unpriced, never $0, so a missing price cannot pass for a free call. Use it to compare models and spot expensive conversations, such as a bot that loops through tool calls.

Sending traces to the tools you already use

If your team already watches services in another tool, you do not need two places to look. Add an OTLP/HTTP destination, such as Langfuse, Honeycomb or Grafana Tempo, or an OpenTelemetry Collector that forwards to Datadog or another tool, with a header carrying its API key. OTLP/HTTP is the standard way to send traces over HTTP, and Langfuse accepts it at its OTLP endpoint (as of November 2026). Finished replies go out in batches about every five minutes, from Test and Production, and a new destination receives your history first, oldest first. Destinations must use HTTPS, because traces carry customer messages; header values are never shown again after you save them; and only admins and owners can change where traces go.

When another tool fits better. If you build your own LLM application in code and want tracing inside it, a dedicated LLM observability tool you instrument with an SDK is the natural choice. Rylvo's traces exist for bots you build and run in Rylvo: every reply is traced without any code, and the trace knows about your knowledge base, prompts, tools and guardrails because they are the bot's own settings. You can use both, with the OTLP export carrying Rylvo's traces into the other tool.

A five-minute checklist for the next bad answer

  1. Find the reply from the customer's words, in the right environment.
  2. Open Knowledge base: right passage, old passage, nothing matched, or no search?
  3. Open the model call: which prompt version, which model, why it stopped.
  4. Open each tool call and guardrail: failed, blocked, never called, rewritten?
  5. Fix the cause in Test, check the same message, release.
  6. Save the reply as a test case.

Frequently asked questions

Why does my chatbot give a different answer to the same question?

The answer depends on what the bot read for that message: the knowledge passages that matched, the earlier messages in the conversation, the prompt version that was live and the model's own randomness. Open both replies and compare what each one read. The difference is often in the passages or the conversation history rather than the model, so compare those first.

What is a chatbot trace?

A trace is the record of one reply: the customer's message, every step the bot took to answer (knowledge searches, model calls, tool calls and guardrail checks) in order, and what each step took in time, tokens and cost. You read it to see why the bot said what it said.

Can I see which page my chatbot used for an answer?

Yes, if your tool records retrieval. In Rylvo the Knowledge base part of a reply lists the passages the bot read, the source each came from and its match score, and it says when nothing passed the match threshold and the closest passages were used anyway.

Do I need a paid plan to debug answers in Rylvo?

Every plan lists the replies your bots sent. Opening a reply's full steps (Trace Replay) is on Lite and up, and the 7-day Pro trial for new workspaces includes it. Trace history is kept 7 days on Free, 14 on Starter and Lite and 90 on Pro.

Can I send chatbot traces to Langfuse, Datadog or my own tools?

Yes. Rylvo exports finished replies over OTLP/HTTP to any OpenTelemetry destination, such as Langfuse, Honeycomb or Grafana Tempo, or an OpenTelemetry Collector that forwards to Datadog or another tool, in batches about every five minutes. Only admins and owners can change where traces go.

Build your first agent on the free plan.