append
- Send a whole chat or any part of it. Each event's id is unique per thread, so resending a chat adds only the new messages.
- t_event is when it was said; the memory stamps t_ingest when it arrives. Nothing is ever edited or deleted.
- kind covers everything else: message, document, retract (hides the events it names), note (offline summaries and links, citing their sources).
- The reply comes after the tape write (milliseconds). Embedding follows in a background batch, so new text is searchable by keyword at once and by meaning about a second later.
{
"op": "append",
"memory": "team-alpha",
"source": "agent:planner",
"thread": "launch-q4",
"events": [
{ "id": "msg-8812", "role": "user",
"t_event": "2026-10-15T09:12:00Z",
"text": "Launch moves to 14 November. Bob takes over the checklist." },
{ "id": "fix-0031", "kind": "retract", "refs": ["msg-7710"],
"text": "Ad budget figure was entered by mistake." }
]
}
{ "ok": true, "added": 2, "skipped": 0,
"seq": [1849220, 1849221], "chunks": 1, "ms": 4 }
query
- Named questions in plain text. Each takes an optional time: as_of answers with what the memory knew then; since / until limit when things happened.
- mode: relevant (best matches, each dated), latest (among matches that say the same thing, the newest first, older ones attached), timeline (matches in time order; with since_seq it streams raw events, which is how another memory syncs).
- Answers come back keyed by question name: exact text, times, source and a score. With the reranker on, the score is the probability that the item answers the question.
- A budget caps time and tokens out; the trimmer keeps the sentences that best match.
{
"op": "query",
"memory": "team-alpha",
"filters": { "thread": "launch-q4" },
"questions": {
"launch_date": { "text": "When is the Q4 launch?", "mode": "latest" },
"owner_then": { "text": "Who owns the launch checklist?",
"as_of": "2026-10-01T00:00:00Z" },
"risks": { "text": "known launch risks", "since": "2026-10-01", "k": 5 }
},
"budget": { "max_ms": 100, "max_tokens_out": 800 }
}
{
"launch_date": { "items": [ {
"text": "Launch moves to 14 November. Bob takes over the checklist.",
"t_event": "2026-10-15T09:12:00Z", "source": "agent:planner",
"seq": 1849220, "score": 0.83,
"older": [ { "seq": 1712004, "t_event": "2026-09-12T10:00:00Z",
"text": "Q4 launch planned for 7 November." } ] } ] },
"owner_then": { "items": [ { "text": "Alice owns the launch checklist.",
"t_event": "2026-09-20T15:30:00Z", "score": 0.79 } ] },
"risks": { "items": [] },
"usage": { "ms": 38, "candidates": 200, "tokens_out": 96 }
}