← All Test Cases

NIH-002

needle haystack

critical
Repetitions
3
Documents
26
Questions
1
Reasoning
DIRECT
retrieval-precision high-distractor-load needle-in-haystack

📖 In Plain English

What this category tests

Can the brain find one specific document among many distractors?

How the test works

One target document with a unique canary token is ingested alongside 10+ similar-sounding distractor documents. The test uses the canary to find only the target.

Why it matters

Precision matters at scale — a brain that returns 'mostly relevant' results is unusable in production.

⚙️ How a single rep runs

① Generate
Model creates 26 synthetic documents and 1 question with unique canary tokens
→ Fresh content per run prevents memorization and proves real retrieval
② Ingest (MCP)
Model calls brain_ingest to store the 26 documents
→ Tests the brain's storage and indexing pipeline
③ Query (MCP)
Model answers the question using brain retrieval tools (search, fetch, context_pack, etc.)
→ Core test — does the brain return correct evidence and let the model build a faithful answer?
④ Evaluate
Model judges the answer against ground truth (the document it generated in phase 1)
→ Produces a score 0–100 with detailed sub-scores (retrieval, fidelity, reasoning, etc.)

This rep is run 3 times per test run. A pass requires score ≥ 85 and no critical failures.

🔬 Technical Instructions (raw prompts sent to AI)

🔧 ① Setup Instructions 1423 chars
Generate ONE target document and 25 distractor documents. This is a harder version of NIH-001.

Requirements:
- Target: one sentence with a specific unique fact and canary.
- 25 distractors: varied topics that are semantically related to the target topic but different.
  Include some that are deliberately misleading (mention the same object type but different properties).
- source_ids: KB-{{RUN}}-NIH-002-TARGET-v1 for target, KB-{{RUN}}-NIH-002-D01-v1 through D25-v1.
- Question uses the canary to identify the target.

Output ONLY this JSON:
{
  "run_id": "{{RUN}}",
  "test_id": "NIH-002",
  "repetition": {{REP}},
  "documents": [
    {"source_id": "KB-{{RUN}}-NIH-002-TARGET-v1", "content": "<target with canary>", "title": "<title>", "version": 1},
    {"source_id": "KB-{{RUN}}-NIH-002-D01-v1", "content": "<distractor 1 — similar topic>", "title": "<title>", "version": 1},
    ... (25 distractors, some deliberately misleading)
  ],
  "questions": ["Canary '<token>': return the exact sentence and source_id of the matching document."],
  "expected_answers": [{
    "question_index": 0,
    "correct_answer": "<the target fact>",
    "required_source_ids": ["KB-{{RUN}}-NIH-002-TARGET-v1"],
    "required_quote": "<exact target sentence>",
    "required_label": "DIRECT",
    "must_refuse": false,
    "notes": "25 distractors, some misleadingly similar. Only the canary uniquely identifies the target."
  }]
}
▶ ② Execution Instructions 543 chars
You have access to MCP Knowledge Brain tools.

Use brain_search with the exact canary token from the question.
The canary is unique — only ONE document contains it.
Find that document. Return immediately once found — do not search further.

⚠️ OUTPUT RULE: As soon as you find the target document, stop reasoning
and output the JSON. Do not re-examine other documents. Do not verify.
Just output the required JSON schema with the found document's source_id and quote.

Question: {{QUESTION}}

Return ONLY this JSON:
{{REQUIRED_ANSWER_SCHEMA}}
⚖ ③ Judge Instructions 323 chars
Ground truth:
{{SETUP_CONTEXT_JSON}}

Tested AI answer:
{{EXEC_ANSWER_JSON}}

25 distractors, some semantically similar to target. Only the canary uniquely identifies the target.
Critical failures: cited any distractor, hallucinated source_id, mixed target with distractors.

Return ONLY this JSON:
{{JUDGE_RESULT_SCHEMA}}

Critical Failure Conditions

Recent Run History

3 runs
When Run ID Pass Rate Avg Score Reps
2026-05-24 13:08 20260524T130808Z-kqze 0% 0 0/1 View →
2026-05-24 12:41 20260524T124148Z-z2do 0% 0 0/1 View →
2026-05-24 11:37 20260524T113756Z-kduj 0% 0 0/1 View →
📄 Raw YAML cases/needle_haystack/NIH-002.yaml
schema_version: "1.0"
test_id: "NIH-002"
category: "needle_haystack"
severity: "critical"
repetitions: 3
reasoning_type: "DIRECT"
num_documents: 26
num_questions: 1
tags: ["retrieval-precision", "high-distractor-load", "needle-in-haystack"]

setup_instructions: |
  Generate ONE target document and 25 distractor documents. This is a harder version of NIH-001.

  Requirements:
  - Target: one sentence with a specific unique fact and canary.
  - 25 distractors: varied topics that are semantically related to the target topic but different.
    Include some that are deliberately misleading (mention the same object type but different properties).
  - source_ids: KB-{{RUN}}-NIH-002-TARGET-v1 for target, KB-{{RUN}}-NIH-002-D01-v1 through D25-v1.
  - Question uses the canary to identify the target.

  Output ONLY this JSON:
  {
    "run_id": "{{RUN}}",
    "test_id": "NIH-002",
    "repetition": {{REP}},
    "documents": [
      {"source_id": "KB-{{RUN}}-NIH-002-TARGET-v1", "content": "<target with canary>", "title": "<title>", "version": 1},
      {"source_id": "KB-{{RUN}}-NIH-002-D01-v1", "content": "<distractor 1 — similar topic>", "title": "<title>", "version": 1},
      ... (25 distractors, some deliberately misleading)
    ],
    "questions": ["Canary '<token>': return the exact sentence and source_id of the matching document."],
    "expected_answers": [{
      "question_index": 0,
      "correct_answer": "<the target fact>",
      "required_source_ids": ["KB-{{RUN}}-NIH-002-TARGET-v1"],
      "required_quote": "<exact target sentence>",
      "required_label": "DIRECT",
      "must_refuse": false,
      "notes": "25 distractors, some misleadingly similar. Only the canary uniquely identifies the target."
    }]
  }

execution_instructions: |
  You have access to MCP Knowledge Brain tools.

  Use brain_search with the exact canary token from the question.
  The canary is unique — only ONE document contains it.
  Find that document. Return immediately once found — do not search further.

  ⚠️ OUTPUT RULE: As soon as you find the target document, stop reasoning
  and output the JSON. Do not re-examine other documents. Do not verify.
  Just output the required JSON schema with the found document's source_id and quote.

  Question: {{QUESTION}}

  Return ONLY this JSON:
  {{REQUIRED_ANSWER_SCHEMA}}

judge_instructions: |
  Ground truth:
  {{SETUP_CONTEXT_JSON}}

  Tested AI answer:
  {{EXEC_ANSWER_JSON}}

  25 distractors, some semantically similar to target. Only the canary uniquely identifies the target.
  Critical failures: cited any distractor, hallucinated source_id, mixed target with distractors.

  Return ONLY this JSON:
  {{JUDGE_RESULT_SCHEMA}}

critical_failures:
  - "cited_distractor_instead_of_target"
  - "hallucinated_source_id"
  - "mixed_target_with_distractors"