remember appends events to a stream. Each event gets a sequence number and a hash:1hash = sha256(prevHash || canonical(event))
kaibo verify.superseded or canceled, its validTo is set, and the two are linked. Nothing is lost, and recall answers from what is current.remember returns a job id; pass wait to block until the memory is searchable. A model structures what you wrote, so three things follow:explain shows the chain that led to each one.remember you may see a quick provisional memory; a few seconds later it is replaced by the structured one, with a new id and a better type. Use wait: true before you store or compare ids.recall takes a question and a token budget and returns the smallest set of memories that answers it. Each item is either a verbatim quote or a short summary, and each has citations. Results are scored on stemmed term matches, filtered to what was valid at asOf (default now), de-duplicated for diversity, then packed into the budget.abstain.abstained: true and a reason. Treat that as "I do not know". With Accept: text/event-stream the same call streams candidates, packed and final events.explain takes a memory id (or a recalled item) and returns the chain of memories it replaced (oldest first), each with the text it said, and the source events with sequence numbers and hashes. Use it to show a user why an agent believes something:12const why = await kaibo.explain(pack.top); for (const version of why.chain) console.log(version.status, version.validFrom, version.content);
forget takes a memory id or a query, and a reason. The memory is tombstoned immediately and the text is purged after a grace window (24 hours). A receipt points at an entry in a hash-chained deletion ledger; verify recomputes it and checks the memories are gone. The ledger stores a digest of the reason, not the reason.dryRun) can list more than you stored statements: the old versions and any memories derived from the same events. Read it before you confirm.memory.forgotten webhook to clean up your own copies.