Agent-readable docs index: /docs/llms.txt. Full docs in one file: /docs/llms-full.txt. Download /docs/docs.zip to grep all markdown files locally.

Recipes

Each recipe is complete. They assume KAIBO_URL and KAIBO_KEY are set, so new Kaibo() and Kaibo() need no arguments.

Give an agent memory in a prompt

Recall before you answer, put the result in the prompt, and say "I do not know" when there is no answer.
import { Kaibo } from "kaibo"; const kaibo = new Kaibo(); async function answer(question: string) { // Text you can paste into a prompt: cited, with outdated and untrusted items marked. const memory = await kaibo.context(question); return callYourModel({ system: `Answer from the memory below. If it does not contain the answer, say you do not know.\n\n${memory}`, user: question, }); }
If you want to branch on whether anything matched, use recall and its helpers:
const pack = await kaibo.recall("who owns billing?"); if (!pack.found) return `I do not know (${pack.reason}).`; return `${pack.answer} (source events: ${pack.sources.map((s) => s.eventId).join(", ")})`;

Remember what happened, not what you inferred

Send the raw statement and let kaibo decide what it replaces. Do not store your own summary of it.
await kaibo.remember("Maya took over billing from Dana on Nov 3."); await kaibo.remember("Dana is out until January.");
Recall now says Maya owns billing, and explain shows Dana's version as replaced, with both source events.

Know what was true then

const before = await kaibo.recall({ query: "who owns billing?", asOf: "2026-10-01T00:00:00Z" }); console.log(before.answer); // Dana, and only because that was true on that date

Fix a wrong memory

If the memory is wrong because the world changed, remember the new fact. If it is wrong because it was recorded badly, edit it. The old text stays as history either way.
const pack = await kaibo.recall("release target"); if (pack.found) await kaibo.memories.edit(pack.top, "The release target is July 17.");

Forget something, and prove it

const target = { query: "home address" }; const preview = await kaibo.forget(target, { reason: "asked by user", dryRun: true }); // changes nothing console.log(preview); // what would go const { receipt } = await kaibo.forget(target, { reason: "asked by user" }); console.log(await kaibo.forget.verify(receipt.id)); // checks the receipt against the ledger

Use a recalled answer later without re-asking

A saved pack carries a proof that kaibo issued it. Check it before you trust a stored copy.
const pack = await kaibo.recall("refund policy"); const saved = JSON.stringify(pack); // ...later, in another process: const check = await kaibo.verifyPack(JSON.parse(saved)); if (!check.valid) throw new Error(check.reasons.join("; "));

Do not let tool output rewrite memory

Anything that comes from a tool or a file is stored as untrusted. It can add knowledge but cannot retire what you told kaibo directly. When an action matters, ask for trusted memory only:
const pack = await kaibo.recall({ query: "who may approve refunds?", minTrust: "trusted" });

Set up a project from a script

kaibo projects create "Support agent" kaibo keys create --label support-agent --scope read_write --for-project <project-id> --json kaibo webhooks create https://example.com/kaibo --event memory.forgotten
The same calls exist in the SDKs (kaibo.projects, kaibo.keys, kaibo.webhooks) and the dashboard.

Test code that uses kaibo

Point a test at its own project and clean up after, or give the client a fake fetch:
const kaibo = new Kaibo({ apiKey: "kaibo_aaaaaaaa.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", baseUrl: "http://localhost", fetch: async () => Response.json({ items: [], abstain: { abstained: true, reason: "test" }, version: 1, tokens: 0, asOf: new Date().toISOString() }), });