Kaibo) and asyncio (AsyncKaibo) clients with the same methods. Responses are pydantic models with snake_case fields.1uv add kaibo # or: pip install kaibo
123456789from kaibo import Kaibo # Reads KAIBO_KEY, and KAIBO_URL and KAIBO_PROJECT when set. Or Kaibo(api_key=..., base_url=...). with Kaibo() as kaibo: kaibo.remember(text="We ship on July 17.", wait=True) pack = kaibo.recall("ship date", budget_tokens=1000) why = kaibo.explain(pack.top) if pack.found else None receipt = kaibo.forget(query="ship date", reason="asked by user") assert kaibo.verify_receipt(receipt.id).ok
forget_dry_run(...) lists matches without deleting. recall_stream(...) yields typed events. events.iter() and memories.iter() follow cursors.1memory = kaibo.context("what did we decide about the release?")
context is recall rendered as text: delimited as stored data, with citations, and with outdated, unverified and untrusted items marked. It takes the same options as recall (mode="fast", min_trust="trusted", as_of=...). render_context(pack) does the same for a pack you already have.123456from kaibo import AsyncKaibo async with AsyncKaibo() as kaibo: pack = await kaibo.recall("ship date") async for event in kaibo.recall_stream("ship date"): ...
123456dry = kaibo.imports.create("mem0", file_text, dry_run=True) # report only done = kaibo.imports.create("letta", af_text, stream="agent-1") for rec in kaibo.exports.stream(include=["events"]): # raises KaiboError if cut off print(rec.record) key = kaibo.keys.create("ci", ["read"]) # admin key; key.key is shown once kaibo.keys.list(); kaibo.keys.revoke(key.id)
AsyncKaibo has the same three (await kaibo.imports.create(...), async for rec in kaibo.exports.stream()).123from kaibo import verify_webhook event = verify_webhook(request_body_bytes, headers["X-Kaibo-Signature"], secret)
KaiboError is the base. ApiError has code, status and request_id; RateLimitError adds retry_after. Retry rules match the TypeScript SDK.