Run RAG Check

Run a local, no-API-key RAG readiness check on a doc page and get chunk-level findings before it ever reaches a retrieval pipeline.

Run RAG Check helps you find retrieval problems in a documentation page before those problems reach an AI or RAG pipeline.

It takes the same AI-readable text shown in AI View, splits it into retrieval-sized chunks, generates test questions, and uses a built-in keyword retriever to see whether those questions can find the right content.

You get chunk-level findings and retrieval scores that help you identify problems such as:

  • Content that is difficult to retrieve with likely user questions
  • Chunks that don't make sense when retrieved on their own
  • Headings that don't provide enough context
  • Tables or code blocks that lose meaning when extracted
  • Broken links that can stop an AI agent from following a documentation path
  • Sections that are too long or too fragmented for effective retrieval
Note
Run RAG Check is a local heuristic, not a replacement for testing your production RAG pipeline. It uses a built-in keyword retriever and does not call an LLM or require an API key.

When to use Run RAG Check

Use AI View and Run RAG Check together:

  1. Open AI View to see the exact text an AI pipeline receives.
  2. Fix formatting or content problems you find there.
  3. Run Run RAG Check to see how that content behaves when split into chunks and retrieved.
  4. Use the findings to improve the page.
  5. Run the check again to verify the changes.

Enable Run RAG Check

Run RAG Check is enabled by default during local development.

To configure it explicitly, add a ragCheck block under ai in camelmind.config.ts:

typescript
const config: CamelMindConfig = {
  // ...
  ai: {
    ragCheck: {
      enabled: true,
      localOnly: true,
      roles: [],
      defaultChunkSize: 500,
      defaultChunkOverlap: 80,
      maxGeneratedQuestions: 12,
    },
  },
}

Configuration fields

FieldRequiredDescription
enabledNoEnables or disables the feature. Defaults to true. Set to false to hide the tool from the toolbar and disable its route.
localOnlyNoKeeps the author tool restricted to localhost. Defaults to true. Setting this to false disables the tool rather than making it remotely accessible.
rolesNoRestricts access to specific roles, such as ["editor", "admin"]. Uses the same role-based access pattern as AI View. An empty array allows any authenticated local user. This has no effect when authentication is disabled.
defaultChunkSizeNoDefault value for Chunk size, in characters. Defaults to 500. Valid range: 100–4000.
defaultChunkOverlapNoDefault value for Chunk overlap, in characters. Defaults to 80. Must be smaller than the chunk size.
maxGeneratedQuestionsNoMaximum number of test questions generated for each run. Defaults to 12.
Note
Run RAG Check inherits your existing document access controls, just like AI View. A user who cannot open a page cannot open its RAG Check either.

Requirements

Run RAG Check is available only when all of the following conditions are met:

  • The dev server is running with NODE_ENV=development, or CAMELMIND_AUTHOR_TOOLS=true is set.
  • The request's Host header is localhost, 127.0.0.1, or [::1], on any port.
  • OFFLINE_MODE is set to false.
  • ai.ragCheck.enabled is set to true.
  • If roles contains values, the current session has at least one of those roles.

When these requirements aren't met, Run RAG Check is hidden from the toolbar and its route returns 404. This means a production reader does not receive a permission error or other indication that the author tool exists.

Warning
CAMELMIND_AUTHOR_TOOLS=true is a development-only escape hatch for testing author tools outside NODE_ENV=development. Do not set it in a production Docker image or shared staging environment. It removes the environment check but does not remove the localhost host check.

Run a check

The Run RAG Check screen has three panes:

  • AI-readable text and chunks — See how your page is divided into retrieval chunks.
  • Controls and summary — Configure chunking, run the check, and review RAG readiness scores and test queries.
  • Findings — Review issues and recommended fixes.

Run RAG Check

The left pane displays the AI-readable version of your page—the same content shown in AI View—divided into the retrieval chunks used by the check.

Selections are synchronized across the screen:

  • Click a line or chunk to select it.
  • Click a finding to jump to the affected chunk.
  • Click a test query to see which chunks were retrieved and jump to the relevant content.

Preview different chunking strategies

Change Chunk size or Chunk overlap in the middle pane to see how different settings affect your chunk boundaries.

Note

Line numbers refer to the generated AI-readable text, including the llms.txt directive prefix. They will not match the line numbers in your original MDX source.


Fixing common findings

Finding categoryFix
retrieval-miss / retrieval-noiseAdd the exact terms users are likely to search for; make the heading and opening sentence more specific.
weak-heading / weak-heading-contextRestate the section's subject in the heading and opening line instead of a generic label or pronoun.
over-split-section / long-chunkRebalance chunk size, or restructure the section so a natural break falls at a heading.
context-less-table / context-less-codeAdd a lead-in sentence before the table or code block explaining what it shows.
dead-linkFix or remove the link — an agent following it hits a dead end.
no-outbound-linksAdd at least one link to related docs so a multi-step task doesn't stall on this page.

Categories shared with AI View (long-paragraph, context-less-code, context-less-table, weak-alt-text, positional-reference, opaque-jsx, weak-heading-context) use the same fixes described on the AI View page.

Run RAG check


Run RAG Check across every doc

You can run a site-wide diagnostic scan across every page in your navigation tree to find low-scoring docs in a single pass:

bash
npx tsx scripts/rag-check-report.ts [threshold]

The rag-check-report.ts script runs the same chunking, question generation, retrieval, and scoring pipeline as the interactive tool against every document in nav.yml. It sorts the results by overall score and outputs pages scoring at or below the specified threshold (default 89).

For each flagged document, the report displays the overall score, the two lowest-scoring dimensions, and up to five findings:

text
--- /features/example-doc (Example Doc) — overall 72 — weakest: crossLinkQuality=40, retrievability=58
    [blocking] dead-link: ...
    [warning] weak-heading-context: ...
    ...and 3 more findings
Note
  • Run rag-check-report.ts locally as a diagnostic tool. CamelMind does not wire this script into package.json or CI build workflows.
  • The script skips entries without a source file (such as noDropdown group placeholders) or pages that fail to load, counting them separately in the final summary line.

  • AI View — preview the raw text a RAG pipeline ingests, without running chunking or retrieval.
  • LLMs.txt — the underlying AI-readable output both tools are built on.
September 10, 2026
Was this page helpful?