Case file 12AI · Testing8 min read

Rami was too eager. A bigger model didn't fix it, the prompt did.

How a chat that answers only from a website is built, checked and measured, and why the fix for an over-eager assistant was a shorter prompt, not a bigger model.

Read by an AI voice of Sajib. Words light up as he reads.

Voice score

2.95 → 3.85

Scored 1 to 5 by two AI judges, same rubric before and after.

Average answer

62 → 42 words

Accuracy went up too: 4.32 → 4.58.

Padded answers

32 → 1

Out of 116 answers. 58 eval questions, each asked twice.

Rami is the chat on this site. You ask it about my work, and it answers.

Early on, I asked it about something that wasn’t on the site. It said so, which was right. Then it offered to open the contact form. I asked about a project that was on the site. It answered, then ended with “the case file also covers the test setup.” It had just shown the case card, and the next sentence described the card.

None of those answers was wrong. All of them were too much. This article covers how Rami works, how I measure it, and why I fixed the over-eagerness by deleting instructions.

What it is, and what it may use

Rami answers visitors’ questions about my work, using only this site’s own content. Its backend fetches llms.txt, the site’s index for AI tools, then every Markdown page it links to. It refreshes them every hour. The site’s pages are the only source. If something isn’t on the site, Rami says so.

That rule is why the case files are written the way they are. Whatever a page doesn’t say, Rami can’t say.

Visitor
Rami's server
The model
Checks
status line while it works, then the answer and up to three cards
Fig. 12.1 · The site's own pages go in. Checked text and cards come out.

Cards, not just text

Text is a weak way to show proof. So Rami can also show a case card, a card of key numbers, a figure, two things side by side, my products, a timeline, a set of choices, or the contact form.

The rule for cards is that the model picks them by ID only. It never writes one. Three things keep this honest:

  • The tool definitions list the site’s real IDs, so the model cannot invent one.
  • The server checks every ID again before sending it.
  • At most three cards go out with one answer.

An ID that doesn’t exist is dropped. A card is always one of the site’s own components, so it cannot say anything the site doesn’t.

Checks after every answer

I don’t trust the model to follow rules, so every answer goes through checks. They flag:

  • a number that isn’t in the source document
  • a link or Markdown in the text
  • padding, like a closing pitch or a menu of topics to ask next

A flag does not block the answer. It is logged. Every miss is visible, and that is the point: I can count them and see whether a change made them better or worse.

Two more details help.

If the main model is down, a fallback model takes over. And while Rami works, the visitor sees a status line, for example “Reading ‘Ten copies of one login popup’”. The server writes that line. It is not the model’s raw output, so it can’t leak half-formed text.

How it’s measured

Checks tell me about single answers. To compare two versions, I need an evaluation set, a fixed list of questions asked every time.

Mine has 58 questions, including prompt-injection attempts and questions in Bangla. Each is asked twice, because the same question can get different answers. That gives 116 answers per run.

Two kinds of judging happen on each run:

  • Fixed checks decide pass or fail, for example whether the right card was shown.
  • Two AI judges score each answer from 1 to 5 on four things: does it answer the question, is it faithful to the site, did it choose the right cards, and is the voice right.

The problem: too eager

Faithfulness and card choice were fine. Voice was not. Four habits kept coming back:

  • It ended answers with a pitch: “the case file also covers…”
  • It listed topics to ask about next.
  • It offered the contact form whenever a fact wasn’t on the site.
  • It described the card it had just shown.

The voice score was 2.95 out of 5. In the 116 answers, 32 were padded.

A bigger model scored no better

My first guess was the model. A bigger one should follow instructions better. I ran the same questions on a bigger model and scored them with the same rubric. The voice score didn’t move.

So the model was following its instructions. The instructions were the problem. My prompt asked for “two to four sentences” and for suggestions of what to ask next. Rami had been doing exactly that. An assistant told to fill two to four sentences will fill them, and one told to suggest a next question will suggest one.

I rewrote the prompt around one idea: answer what was asked, then stop. I also replaced the example answers, because a model copies its examples more closely than it follows its rules. The new examples were short and ended when the answer ended.

Fig. 12.2 · Same questions, same judging rubric. Only the prompt changed.
Before After
Voice score 2.95 3.85
Average answer 62 words 42 words
Padded answers 32 of 116 1 of 116
Accuracy 4.32 4.58

Accuracy went up as well. I did not aim for that. My guess is that fewer sentences leave fewer places to be wrong, and that the extra sentences were where the unsupported claims lived.

Two lessons from the judges

The measuring tools needed fixing too, and each fix taught me something.

The rubric still described the old voice

After the rewrite, the judges kept suggesting fixes. Many of them would have put the pitching back, like mentioning related case files or offering more help. The judges weren’t broken. The rubric I gave them still described the old, eager voice as the goal.

A rubric is a copy of the design. If the design changes and the rubric doesn’t, the judges will score the old design and push you back to it. I rewrote the rubric to match the new prompt, and that is the rubric behind the numbers above.

The judges only saw the page the answer cited

An answer named Tarawih Finder and EventCamp, two projects from the Now page. It was correct. The judge scored it 1 for “inventing” them, because the judge had only been given the page the answer cited, and these names were not on that page.

Now the judges get that page and also every page that holds a distinctive name the answer uses. A judge can only check a claim against what it is shown, which is the same problem the code review bot in case file 10 had, seen from the other side.

A bug the setup caught

The site redesign renamed a heading on the home page from “Pinned on the wall” to “Shipped”. Rami finds my products by reading that section. With the old heading gone, it found none, and it silently stopped showing product cards. Nothing crashed. Answers still came back, just without the cards.

It went unnoticed for a day. Now the backend logs a warning when the home page has no products. The heading is also a contract between the site and Rami: the home page must have ## Shipped, with each product under a ### heading.

What is still not great

The judges are AI too. Two of them are better than one, but they can share blind spots.

58 questions is a small set. It catches a regression like the padding. It would not catch a subtle new failure on a topic I never thought to ask about.

And Rami can only be as good as the pages. If a case file leaves something out, Rami will say it isn’t on the site, and it will be right.

What I learned

When an AI assistant behaves badly, read the prompt before changing the model. A bigger model scored no better here, because the prompt had asked for the behaviour.

Count the behaviour, don’t just feel it. “It talks too much” is an opinion. “32 of 116 answers end with a pitch” is something a prompt change can be tested against.

Keep the rubric in step with the design. Every time the prompt changes, ask whether the judges are still being told the truth about what good looks like.

Make the model choose, not write, wherever you can. Cards picked by ID, from a list the model is given and the server checks again, can’t be invented.

And log what the checks flag, even when you let the answer through. A silent failure, like the missing product cards, looks the same as a working system until someone counts.