S'limane ChanchoulRAG chatbot fix demo

RAG chatbot fix: 20/30 correct answers before, 29/30 after

A support chatbot over 12 synthetic company documents, tested on 30 questions with known answers. Same documents, same questions, same LLM. Only the pipeline changed. Each version was run twice, and both runs gave the same scores: 10 wrong answers became right, and 1 right answer became a miss.

Correct answers, before20/30
Correct answers, after29/30
Outdated or wrong facts given as valid3 → 0
Answers citing a source0 → 29

Your RAG bot gives wrong answers? Send me 10 questions it gets wrong.

56-second silent replay of 3 real test questions (answers as saved from run 1), then the score table.

What was wrong, and the fix

The cause of each miss was found by reading the chunks the old bot got. All fixes went in together; the next section measures each one.

Which fix mattered (measured)

A fair question: did the fixes matter, or did the bot just get more text? To check, I changed one thing at a time and ran each version twice on the same 30 questions.

VersionCorrect of 30
(run 1 / run 2)
Outdated or wrong
facts given as valid
Answers citing
a source
Old bot20 / 203 / 30 / 0
Old bot, 6 chunks instead of 225 / 252 / 20 / 0
Fixed bot29 / 290 / 029 / 29
Fixed bot, but the old 500-character chunks27 / 270 / 028 / 28
Fixed bot, but no dates or status29 / 270 / 229 / 28
Fixed bot, but no reranker28 / 280 / 029 / 30
Fixed bot, but the old prompt30 / 300 / 00 / 0

I did not change the fixed bot after these runs. Picking the best version from the test answers would be tuning on the test.

Three real questions, before and after

Table lookupWhat is the price per user of the Team plan when billed annually?

Before: Said “not in the documents” (it was)

Based on the provided context, the pricing details for the Team plan are missing/cut off from the table, so the exact price cannot be determined from the text.

After: Correct

The Team plan costs $20 per user per month when billed annually [pricing-plans]. Annual billing is charged once a year for the whole term [pricing-plans]. Calculation: $20 × 12 months = $240 per user per year [pricing-plans].

Why it changed: The 500-character split cut the pricing table inside its first row (Starter), so the Team row never reached the model. Keeping tables whole put the full table in the context. Measured: the old bot with 6 chunks instead of 2 also got this one right, in both runs, so more chunks alone fix it too.

Current vs outdated policyIs there a fee when a refund is paid back for a bank transfer payment?

Before: Wrong

Based on the provided text, there are conflicting policies:
• One section states: There is no fee for refunds, including refunds of payments made by bank transfer.
• Another section states: Refunds of payments made by bank transfer carry a $25 processing fee.

After: Correct

No, there is no fee for refunds, including refunds of payments made by bank transfer [refund-policy]. Approved refunds are sent to the original payment method within 5 business days [refund-policy].

Why it changed: The old 2024 refund policy and the current one were both retrieved, with no dates, so the bot offered both rules. With document dates and status, the outdated policy ranks below the current one and is labelled as superseded. Measured: without the dates and status, the fixed bot gave the old $25 fee as a second valid rule in 1 of 2 runs.

Multi-hop (two documents)A Business customer with 10 users on monthly billing had 98.5% uptime last month. How much is the service credit in dollars?

Before: Partly answered

Based on the provided context, the exact monthly price for the Business plan is missing (the plan comparison table cuts off after the Starter plan). Therefore, the exact dollar amount of the service credit cannot be determined.
However, based on the uptime table, an uptime of 98.5% qualifies for a 25% service credit (since it is below 99.0% but at least 95.0%) applied to that month's subscription fee.

After: Correct

The Business plan on monthly billing costs $39 per user per month [pricing-plans], making the monthly fee $390 for 10 users ($39 × 10 = $390). Because the Business uptime commitment is 99.9% [sla] and the monthly uptime of 98.5% is below 99.0% but at least 95.0%, the customer is eligible for a 25% service credit [sla].
Calculation: $390 × 0.25 = $97.50.
The service credit is $97.50, which is added to the account balance [sla].

Why it changed: The answer needs two documents: the price table and the SLA credit table. Before, the price table was cut off; after, both whole tables were retrieved and the bot showed the calculation. Measured: with the old 500-character chunks, the fixed bot still missed it in both runs.

Scores by question type

10 questions fixed, 1 got worse (M2, below). Net: 20 → 29 in both runs.

Before, run 1Before, run 2After, run 1After, run 2
Correct answers20/3020/3029/3029/30
Numbers inside tables5/75/77/77/7
Current vs outdated policy3/63/66/66/6
Answers needing two documents2/62/65/65/6
Exact numbers in text5/65/66/66/6
Not in the documents (should decline)5/55/55/55/5
Outdated or wrong facts given as valid3300
Said “not in the documents” when it was4510
Right document(s) found (25 answerable questions)20/2520/2525/2525/25
Answers citing a source0/300/3029/3029/30
Median time per answer2.0 s2.0 s2.1 s2.0 s
LLM cost per answer (mean)$0.0005$0.0005$0.0009$0.0009

One question got worse

“Which plans have an uptime SLA, and what is the API rate limit per minute on the cheapest of them?” The old bot got it right in both runs: Business, 1,000 requests per minute. The fixed bot missed it in both runs.

Both bots had the same two tables (uptime and API limits) and no prices. The fixed bot had no price table in its 6 chunks, and its rule is “never guess”, so it would not say which plan is cheaper. When the price table is in its chunks (question T7), it does answer. The old prompt guessed and happened to be right: with the old prompt on the same chunks, the fixed bot was also right in both runs.

No document says Business costs less than Enterprise (Enterprise is a custom quote), so the refusal is defensible. I still count it as a miss: 10 old misses fixed, 1 old pass lost, 20 → 29.

How it was tested

Your RAG bot gives wrong answers? Send me 10 questions it gets wrong.

Synthetic data: the company (Orbitask) and its 12 documents are made up for this demo, with the usual traps (tables, an outdated policy, similar wording, facts split across documents). Real documents will change the numbers. Python, BM25, sentence-transformers (all-MiniLM-L6-v2 and an ms-marco cross-encoder reranker), OpenRouter.