Skip to content

ButterIX v1 is out: versions, multiple languages, Ask AI, and a per-site MCP server, all built in. →

Docs eval

Write down what readers ask and what a correct answer says, let AI answer from the docs alone, and know before you publish whether it gets it right.

The more often docs change, the easier it is to lose a sentence that matters. Docs eval guards them like a test suite: questions are kept with the docs, AI answers them from the docs alone after every change, and each point is checked. For a wrong answer you see which point is missing and whether search found the page it should have.

Write questions

Create evals.yml next to docs.yml:

evals.yml
pass: 80
questions:
  - id: refund-time
    question: How long does a refund take?
    expect:
      - It arrives within three business days
      - It goes back to the original payment method
    avoid:
      - It can be paid to another account
    pages: [/guides/refund]

  - question: How do I get an invoice?
    expect:
      - Request it under Billing in the dashboard
passnumberDefault 80
Pass mark: the share of questions answered correctly, in percent.
questions[].questionstringRequired
The question, in the words readers use.
questions[].expectstring[]Required
Points a correct answer makes; all of them have to be there. One fact each.
questions[].avoidstring[]
What the answer must not say.
questions[].pagesstring[]
Pages the answer should come from. For diagnosis only; doesn't affect the result.
questions[].idstring
Name of the question, for --only. q1, q2… by default.
questions[].localestring
Language of the question; the site's default language if left out.
questions[].draftboolean
A draft isn't asked. Neither are questions without points.

Run it

Run biti login first (or set BITI_TOKEN): the questions are answered from the docs as the platform renders them for readers. Answering and grading use your own model key.

export DEEPSEEK_API_KEY=sk-…
biti eval

Questions are answered the way Ask AI answers readers: search the docs, then answer from what was found only, with ai.system-prompt applied. Each question takes 3 model calls: search terms, the answer, and grading. They are billed to your own key; the tokens used are shown at the end.

--providerstring
anthropic, deepseek or openrouter; by default the one whose key is set.
--modelstring
Model that answers.
--judge-modelstring
Model that grades; the same one by default.
--minnumber
Pass mark, in place of pass in evals.yml.
--onlystring
Ask these questions only; separate several ids with commas.
--concurrencynumberDefault 4
Questions at a time, up to 16.
--reportstring
Write the result as Markdown.
--jsonboolean
Machine-readable output.
--sitestring
Upload the result to this site.

The exit code is 1 below the pass mark, or when a question couldn't be graded.

Models don't answer the same way every time, and grading is done by a model too. Don't set the pass mark to 100%, and write points that are specific and can be checked. Custom answers and content sources from the dashboard aren't used: this tests the docs themselves.

In CI

.github/workflows/docs.yml
- run: biti check docs
  env:
    BITI_TOKEN: ${{ secrets.BITI_TOKEN }}
- run: biti eval docs --site acme-docs --report eval.md
  env:
    DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
    BITI_TOKEN: ${{ secrets.BITI_TOKEN }}

Questions from readers

biti eval --import --site acme-docs --days 30 --limit 20

Adds what readers asked most to evals.yml as drafts, skipping questions that are already there. Write the points and remove draft to include them. In the dashboard you can also select Copy as an eval question next to a question under Ask AI → Conversations, and paste it under questions.

Readers wrote these questions, and they may contain personal data. Check them before you commit the file.

History

Results uploaded with --site are under Ask AI → Docs eval in the dashboard: the score over time, each question's result, missing points, the answer, and its sources. The last 100 runs of a site are kept; you can also read them through the API.