Skip to content

Memory API (Management)

Document ID: API-005
File Path: docs/09-api/memory.md
Version: 1.0.0
Status: Draft
Owner: AI Platform Team
Last Updated: 2026-06-27


This document defines the control-plane API for managing memory — namespaces, records, retention policy, and inspection — exposed through the API Gateway.

For high-throughput store/retrieve operations, callers use the data-plane Memory Engine API directly; this management API governs and inspects memory rather than serving the hot path.


2. Scope of This API vs. the Engine Contract

Section titled “2. Scope of This API vs. the Engine Contract”
Use caseEndpoint
Configure namespaces, retention, policyThis API
Browse / inspect / export memoryThis API
Bulk admin (purge, reindex)This API
High-volume store/query at runtimeMemory Engine API

The management API may proxy reads to the Engine for inspection but adds governance, auditing, and admin operations.


MethodPathScope
GET/api/v1/memory/namespacesmemory:read
POST/api/v1/memory/namespacesmemory:write
GET/api/v1/memory/recordsmemory:read
GET/api/v1/memory/records/{id}memory:read
POST/api/v1/memory/recordsmemory:write
PATCH/api/v1/memory/records/{id}memory:write
DELETE/api/v1/memory/records/{id}memory:write
POST/api/v1/memory:querymemory:read
POST/api/v1/memory:purgememory:write
POST/api/v1/memory:reindexmemory:admin
POST/api/v1/memory:exportmemory:read

A namespace scopes memory and its policy (tier defaults, retention, embedding model):

{
"id": "ns_01H...",
"object": "memory_namespace",
"name": "support-bot-knowledge",
"project": "support-bot",
"default_scope": "project",
"embedding_model": "text-embedding-3-large",
"retention": { "semantic": "permanent", "conversation": "90d" }
}

The embedding_model is fixed per namespace (see Semantic Memory §3); changing it triggers a :reindex.


Record shape and query semantics follow the Memory Engine API. The management endpoints add admin filters (by tier, importance, age) and return the same score/score_breakdown from Ranking.

POST /api/v1/memory:query
{ "query": "refund window", "scope": ["project"], "limit": 10 }

PATCH /api/v1/memory/namespaces/ns_01H...
{ "retention": { "conversation": "30d" } }

Retention changes are applied by the Engine’s lifecycle reaper (Overview §8). Sensitive namespaces can require elevated scope and enforce Policy Engine rules (e.g. PII handling).


OperationEffect
:purgeDelete records matching a filter (soft or hard=true)
:reindexRebuild vectors (e.g. new embedding model) — async operation
:exportStream records (JSON/JSONL) for backup or migration

:reindex and :export return an operation.


  • Every record access is tenant-isolated and audited.
  • Reads respect memory scopes and the caller’s RBAC/ABAC grants.
  • Exports of sensitive data require memory:admin and are audited with the filter used.

Emits memory.namespace.created, memory.purged, memory.reindex.completed to the Event Bus.


Uses the standard error envelope. Notable codes: forbidden (scope), not_found, conflict (namespace exists), storage_unavailable (degraded backend).




VersionDateDescription
1.0.02026-06-27Initial Memory (Management) API specification