Introduction
Enterprise-grade policy, SOP, contract, and knowledge resolution over one managed HTTP or MCP API.
Mackerel is a managed, enterprise-grade search and retrieval API for a company's knowledge base, especially policies, SOPs, product rules, contracts, wikis, and many more.
Company documents are often unstructured, messy, and contradict each other on purpose: a regional addendum narrows a global policy, a customer rider waives a standard fee, and last year's handbook sits beside this year's update. Half the battle in deploying autoregressive AI agents is wrangling years, if not decades, of messy data into structured, orderly ontologies—a near-impossible feat for anything beyond a small business. Deploying agents as-is results in poor accuracy and high latency, leaving the agent to re-figure out how to navigate your files every time it looks for an answer. Instead of returning overlapping chunks and asking an LLM to guess, one call to Mackerel enforces acl permissions, resolves overrides, excludes superseded_by revisions, and returns the exact governing clause in milliseconds.
Mackerel pairs a compilation engine with a fast System 1 search and retrieval agent. Our compiler takes existing, messy SOPs, contracts, and documentation and organizes them into clean, structured, easily crawlable interfaces—preserving permissions, exceptions, and revision history without forcing your team to maintain a hand-built ontology. At query time, Mackerel's System 1 retrieval agent deploys directly onto that compiled corpus to resolve and return the authoritative clause in milliseconds, giving your downstream reasoning agents and applications fast, deterministic grounding on every request.
Core concepts
Traditional keyword and vector search treat every paragraph as equal text. Mackerel treats rules as versioned, permissioned primitives with explicit precedence so answers stay deterministic as your documentation grows.
| Term | Meaning |
|---|---|
| Corpus | An isolated collection of rules or documents queried as a single unit (such as demo_sops, support_policies, or internal_runbooks). |
| Rule | An addressable statement with a stable ID, source citation, optional ACL groups, and optional override or supersession links. |
| ACL groups | Caller permission tags passed in groups. Permissions are evaluated before retrieval so unauthorized rules are never read, counted, or returned. |
| Governing rule | The active rule that controls the answer after more specific exceptions beat broader defaults. |
| Overridden vs. superseded | An overridden rule still applies generally, just narrowed by a more specific exception. A superseded rule has been replaced by a newer version and stays out of active answers. |
| Abstention | An explicit abstained: true response when no permitted rule covers the question, so your application or agent never invents a fallback. |
| Zero Data Retention | Optional per-request, per-key, or workspace-wide mode (X-Mackerel-ZDR: true) that omits raw query text from logs while keeping billing and trace metadata. |
How Mackerel works
Ingest policies and exceptions once
Connect or upload policies, regional addenda, contract riders, and supersession links through the API or MCP.Enforce permissions before retrieval
Callergroupsfilter restricted rules before candidates are evaluated. Unauthorized clauses never enter results or traces.Resolve override chains automatically
Regional addenda, entity rules, and customer-tier exceptions automatically override broader defaults while retired revisions stay out of active answers.Return typed citations or abstain cleanly
Every response returnsgoverning,overridden,superseded, and a reproducible trace—orabstained: truewhen no authorized rule covers the question.
What Mackerel returns
governing
The active rule that applies, plus the exact list of base policies it overrides.
overridden
General rules that matched the topic but lost to a narrower addendum or tier rider.
superseded
Retired versions surfaced only for audit logs so agents never cite old handbooks.
abstained
Explicit boolean true when no authorized rule covers the question. Zero guessing.
DACH addendum (€95 cap) overrides the global €150 meal cap and keeps the retired 2024 handbook out.
{
"corpus": "demo_sops",
"query": "Can a contractor on our German entity expense a €140 client dinner?",
"groups": [
"finance-emea"
],
"model": "mackerel-flash"
}Click Run to query the demo_sops corpus.
Choose your path
Quickstart
Mint an API key, run your first search in 6 languages, and verify the response in 60 seconds.
SDKs & Test Code
Copy-pasteable test suites for Bun/TypeScript, Vercel AI SDK, Python pytest, Go, Rust, and cURL.
Vercel AI SDK
Wire Mackerel into streamText, generateText, and useChat with live citation badges.
Agent setup (MCP)
Connect Claude Code, Codex, Grok Build, VS Code, or OpenCode via Streamable HTTP MCP.