A retrieval layer for AI agents
Local first, token efficient, open source.
Use cases
Retrieval patterns for agent workflows that need exact commands, low token pressure, and local memory.
Vendor docs scraping
king-scrape https://docs.stripe.com --name stripe --yes
Open web research
king-research "prompt engineering techniques" --high --yes
Internal runbooks
kctx read stripe authentication --preview
ADR memory
kctx adr
Code agents
kctx grep "Bearer" --doc stripe --context 3
Content pipelines
Metadata-first retrieval for token efficient pipelines.
IDE integrations
kctx search "authentication" --doc stripe
Self-evolving retrieval
kctx install stripe@v1
How it works
Metadata narrows the search path before an agent reads full source text.
{
"keywords": [
"retrieval",
"metadata",
"token efficient",
"local first",
"open source"
],
"use_cases": [
"Vendor docs scraping",
"Open web research",
"Internal runbooks",
"ADR memory",
"Code agents",
"Content pipelines",
"IDE integrations",
"Self-evolving retrieval"
],
"tags": [
"MCP",
"CLI",
"Firecrawl",
"Crawl4AI",
"Context7"
],
"priority": "high"
} Search metadata first
kctx search "authentication" --doc stripe checks keywords, use_cases, tags, and priority before expanding context.
Read the relevant slice
kctx read stripe authentication --preview returns a compact preview instead of dumping an entire document.
Escalate only when needed
The agent moves from metadata to preview to fulltext, preserving exact facts without unnecessary token load.
Benchmarks vs Context7
Round 1 compares MCP vs MCP. Round 2 compares Skill vs Skill.
| Metric | King Context | Context7 |
|---|---|---|
| Tokens | 968 tokens | 3125 |
| Metadata lookup | 1.15ms metadata | 200-500ms |
| Fulltext | 97.83ms fulltext | — |
| Duplicates | 0 duplicates | 11 duplicates |
| Relevance | 3.2 relevance | 2.8 |
| Implementability | 4.4 implementability | 4.0 |
| Metric | King Context | Context7 |
|---|---|---|
| Average tokens | 1064 médio | 1896 médio |
| Median tokens | 901 mediana | 1750 mediana |
| Correct facts | 38/38 correct (100%) | 32/38 (84%) |
| Hallucinations | 0.0 hallucinations | 0.33 hallucinations |
| Quality | 4.79 quality | 3.46 quality |
Scraper providers
Firecrawl cloud zero-config or Crawl4AI local beta.
Firecrawl cloud zero-config
Cloud provider path for docs scraping with no local crawler setup.
Crawl4AI local beta
Local provider path for teams that want scraping under local control.
Cookbooks
Reference workflows built on top of King Context.
ebook-factory by @Vadelo
Content pipeline cookbook for turning retrieved context into repeatable ebook production flows.