Agentic Context Engine is an open-source engine that gives AI agents a persistent learning loop, helping them remember successful strategies and learn from failures across sessions. It is used to improve production agents, and also powers Kayba’s hosted service. Catalogue add-ons support workflows for operating and configuring the engine.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/kayba-ai/agentic-context-engine/kayba-agent-instructionsgit clone --depth 1 https://github.com/kayba-ai/agentic-context-engineWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/kayba-ai/agentic-context-engine/kayba-agent-instructions)<a href="https://agentmods.dev/commands/kayba-ai/agentic-context-engine/kayba-agent-instructions"><img src="https://agentmods.dev/badge/commands/kayba-ai/agentic-context-engine/kayba-agent-instructions.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00603 |
| Opus 5 | $0.00000 | $0.00302 |
| Sonnet 5 | $0.00000 | $0.00121 |
| Haiku 4.5 | $0.00000 | $0.00060 |
Grade A, and why
kayba-agent-instructions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Kayba CLI
The kayba CLI interacts with the Kayba hosted API (https://use.kayba.ai).
Auth: set KAYBA_API_KEY env var or pass --api-key to every command.
Commands
kayba traces list [--json] List uploaded traces
kayba traces show <id> [--meta] [--json] View a trace
kayba traces upload <paths...> Upload trace files/dirs (or - for stdin)
--type [md|json|txt] Force file type (auto-detected by default)
kayba traces delete <ids...> [--force] Delete traces
kayba run Run pipeline (interactive trace selector)
--traces ID --all --model MODEL --epochs N
--reflector-mode [recursive|standard] --anthropic-key KEY
--wait --json
kayba insights generate Trigger insight generation
--traces ID --model MODEL --epochs N --reflector-mode [recursive|standard]
--anthropic-key KEY --wait
kayba insights list List insights
--status [pending|new|accepted|rejected] --section NAME --json
kayba insights triage Accept/reject insights
--accept ID --reject ID --accept-all --note TEXT
kayba prompts generate Generate prompt from accepted insights
--insights ID --label NAME -o FILE
kayba prompts list List prompt versions
kayba prompts pull Download a prompt
--id ID -o FILE --pretty
kayba prompts install Install a generated prompt into an agent file
--target TARGET --file PATH --id ID --input FILE
kayba status <job-id> Check job status
--wait --interval N
kayba materialize <job-id> Materialize results into skillbook
kayba integrations list [--json] Show configured integrations
kayba integrations configure <name> Configure mlflow or langsmith
kayba integrations test <name> Test integration connection
kayba batch <paths...> Pre-batch traces for Recursive Reflector
--apply FILE --upload --min-batch-size N --max-batch-size N
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 71 lines · 0 tokens per session scan A 4bf8f961dd7e
kayba-agent-instructions is a command published in the GitHub repository kayba-ai/agentic-context-engine (2,564 stars, last pushed 8d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 603 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
dream-apply
Walk a dream proposal artifact, review each item, apply accepted ones, commit.
end
End a session — log what happened and propose durable memory updates.
dream
Run a curator pass over the memory dir. Produces a proposal artifact for /dream-apply. Default curator: rot.
start
Start a session — load context + memory and brief yourself on current state.
update
Mid-session checkpoint — save progress without ending the session.
findcode
Find one function or class and show its code.