Appearance
Memory APIs
Memory APIs persist execution history and reconstruct useful context for future runs.
Endpoints
POST /v1/memory/writePOST /v1/memory/recallPOST /v1/memory/recall_textPOST /v1/memory/context/assemblePOST /v1/memory/findPOST /v1/memory/resolve
Write contract rules
- Include recallable
nodesin write payload. input_textdoes not create nodes automatically.- Empty-node writes may return
warnings[].code=write_no_nodes.
When to use each endpoint
writewhen an agent step produced information worth keeping.recallorrecall_textwhen you need relevant prior context before the next step.context/assemblewhen you want the server to combine retrieval into prompt-ready context.findwhen you already know structured fields to query.resolvewhen you have a URI or commit identifier and need the underlying object.
Minimal write + recall
bash
curl -sS "$BASE_URL/v1/memory/write" \
-H 'content-type: application/json' \
-d '{"tenant_id":"default","scope":"default","input_text":"hello","memory_lane":"shared","nodes":[{"type":"event","memory_lane":"shared","text_summary":"hello"}]}' | jq
curl -sS "$BASE_URL/v1/memory/recall_text" \
-H 'content-type: application/json' \
-d '{"tenant_id":"default","scope":"default","query_text":"hello","limit":5}' | jqExample response (write, trimmed)
json
{
"status": "ok",
"request_id": "req_xxx",
"tenant_id": "default",
"scope": "default",
"data": {
"commit_id": "commit_xxx",
"commit_uri": "memory://commit/commit_xxx"
}
}Example response (recall_text, trimmed)
json
{
"status": "ok",
"request_id": "req_yyy",
"tenant_id": "default",
"scope": "default",
"data": {
"context": "Customer prefers email follow-up ...",
"candidates": []
}
}Response fields to keep
request_idtenant_idscopecommit_idcommit_uri
Common mistakes
- Writing only
input_textand expecting retrieval to work. - Mixing
memory_lanevalues without a retrieval strategy. - Omitting
tenant_idorscopeand then debugging the wrong dataset. - Not storing
commit_uri, which later blocks replay and audit work.
Error example and fix
Example error:
json
{
"error": "invalid_request",
"message": "write_nodes_required"
}Fix:
- Add at least one recallable node in
nodes[]. - Keep
tenant_idandscopeexplicit in every request. - Re-run write, then verify with
recall_text.