kb-retrieve

Query knowledge bases for assertions and return ranked results with freshness and supersession signals.

1|1|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/williamthorsen/codeassembly --skill kb-retrieve-williamthorsen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kb-retrieve
Source: https://github.com/williamthorsen/codeassembly/tree/main/packages/agents/content/skills/kb-retrieve
Command: npx skills add https://github.com/williamthorsen/codeassembly --skill kb-retrieve-williamthorsen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires node, ripgrep, and includes scripts (resource) components.

What problem does it solve? Searching scattered Markdown knowledge-base notes by hand is slow and error-prone, and raw grep hits do not tell you which notes are current, deprecated, or genuinely relevant. This Skill runs a bundled recall helper over registered knowledge bases and guides the ranking of candidates so you get a trustworthy, annotated answer list. ## Core Features & Use Cases - Scoped recall across knowledge bases: Searches the project-local .kb/ store plus the registry default by default, with flags to widen to all registered KBs or narrow to one named store. - Facet filtering: Restricts results by Diátaxis type (howto, concept, reference), tag, or folder segment. - Freshness and supersession annotations: Flags stale notes (not verified in 90+ days), volatile tags, deprecated notes with canonical successors, and problems that have recorded resolutions. - Registry health reporting: Surfaces malformed registries and dead KB paths as warnings instead of silently shrinking the search. - Use Case: While working in a monorepo, ask how the team handles pnpm workspace setup; the Skill searches the knowledge bases, ranks matching how-to notes, and points you to the current canonical guidance rather than a superseded draft. ## Quick Start Ask the agent to search the knowledge base for a topic, for example: "Use kb-retrieve to find notes about pnpm workspace setup, filtered to how-to guides."

Frequently Asked Questions about kb-retrieve

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search a Markdown knowledge base from the command line?

Run the bundled helper with node kb-retrieve.mjs followed by your query and optional flags such as --diataxis, --tag, or --folder. It prints a JSON object with ranked candidate notes, the knowledge bases searched, and any registry warnings.

How do I filter knowledge-base search results by tag or note type?

Pass --diataxis with a facet like howto, concept, or reference, or --tag with a canonical or alias tag name, or --folder with a path segment. Filters accept both space-separated and equals-sign forms, and matches are case-insensitive for tags.

What are the runtime requirements for the kb-retrieve helper?

The helper requires Node.js version 24 or later and ripgrep (rg) installed on the system. If ripgrep is missing, the helper exits with a remediation hint explaining how to install it.

Why does my knowledge-base search return no results?

The diagnostic field explains empty results: no knowledge base may be configured, the registry may be invalid, no notes matched, filters may have excluded all hits, or only non-assertion records matched. Check the warnings array for registry problems before broadening the query.

When should I use kb-retrieve-events instead of kb-retrieve?

Use kb-retrieve-events when you need raw event observations rather than canonical assertion notes. kb-retrieve returns assertions only; if a query matches only events, the diagnostic explicitly suggests switching to kb-retrieve-events.