Back to Blog

security

Corpus: Giving AI Agents a Verifiable Evidence Base

Learn how the corpus skill lets agents build, consult, and audit a reproducible corpus for grounded answers.

OpenAgentSkillPublished:

Where this fits

Your agent has been answering questions from scattered files, and you're tired of it citing a line that doesn't exist or mixing up versions. You're about to onboard a new codebase and need a single, visible source of truth for every claim. The corpus skill addresses this by maintaining one evidence corpus in corpus/ — where CONTENT.md holds the actual evidence, and everything else routes to exact lines. It’s the missing discipline for grounding agent responses in repo reality.

Why agents benefit

  • Deterministic evidence routing – The agent learns to point to exact lines in CONTENT.md, not vague file mentions, so every answer is traceable.
  • Structured ingestion workflow – When you add a source, the agent reads references/ingest.md and converts it consistently, avoiding ad-hoc parsing that breaks later.
  • Self-auditing navigation – The lint workflow checks map and index integrity, catching broken links before they confuse downstream tasks.
  • Context-free consultation – For any question against the existing corpus, the agent follows a consultation flow that prevents over-reliance on raw files you haven't indexed.
  • Templates that force completeness – Bundled templates are adapted to your context, and the instruction to leave no placeholders pushes the agent to fill in gaps proactively.

Practical scenarios

Onboarding a new API docs folder

You point the agent at a freshly cloned repo with 40 markdown files. The skill’s ingest workflow reads each file, extracts key claims, and maps them into corpus/CONTENT.md with proper SOURCE.md references. Later, when you ask "What does this endpoint return on 404?", the agent goes straight to the evidence line instead of scanning raw docs.

Verifying a refactor against existing docs

Your team changed a service interface. You run a corpus consultation query to check if any existing CONTENT.md statements now contradict the code. The agent uses the consult workflow to compare each claim against current code, flagging stale lines and suggesting which ones to re-ingest.

Auditing corpus health before a release

A new teammate accidentally edited INDEX.md manually, breaking links. You ask the agent to lint the corpus. It runs the lint workflow, reports broken routes, and identifies which evidence lines are orphaned. You fix it in minutes instead of hunting for mismatches during a hotfix.

Add it to your agent workflow

Install the skill with:

npx skills add NathanAB/corpus-skill --skill corpus

Then, when you need to create a corpus from a folder, simply say: "Initialize a corpus from docs/ following the setup workflow." The agent will read references/setup.md and scaffold corpus/ with the correct structure. For a quick verification, ask: "Consult the corpus: does our installation guide mention the env var API_KEY?" The agent will navigate to the exact evidence line and respond with a direct quote plus source reference.

Compare before adopting

Before committing, compare against alternatives like skills add YiYangXu/corpus or simple grep-based solutions. Check: does the skill have active maintenance (latest commit, issue responsiveness)? Does its workflow match how you actually want to store evidence (single file vs. per-topic files)? Will the extra routing layers add latency for your common queries? Also verify it works with your agent runtime (Claude, GPT, etc.) — while the instructions are prompt-based, the structure may conflict with your existing memory or file organization.

Why it is worth tracking

With only 12 stars, this is an early-stage skill — but the design decisions (separating evidence from routing, enforcing exact-line references) are sound and surprisingly rare. The clear README with distinct workflows for setup, ingest, consult, and lint makes it easy to evaluate quickly. I’d track it if you’re building agents that need to answer questions from a large codebase and want reproducibility. Revisit it after a few more releases or community contributions, and check how it evolves around multi-file corpora. As more agents shift toward auditable outputs, this kind of discipline will become a baseline — see similar patterns in other skills on OpenAgentSkill.

Featured Skill

corpus

Skill by NathanAB