Skip to content

Memory Capability Specification ​

Capability Identity ​

PropertyValue
EnumA2ECapability.MEMORY
String"memory"
Plugin TypeMemoryPlugin
Namespacememory/*
Message Count8

Overview ​

The memory capability provides the agent's episodic and semantic memory store. Memories are key-value blobs with optional vector embeddings for similarity search. The host decides the backend (SQLite, Redis, Chroma, etc.).

Three memory tiers:

TierScopePersistenceUse Case
workingIn-sessionLost on disconnectScratch pad, temporary context
episodicPer-agentPersisted across sessionsAgent-specific knowledge
semanticAll agentsPersisted, sharedCollective knowledge base

Protocol Flow ​

Message Types (8) ​

memory/init/req — MemoryInitRequest ​

Agent → Host. Initialize a memory session. Returns a memory_id that must be passed to all subsequent store/retrieve/forget requests.

FieldTypeRequiredDefaultDescription
typestrYes"memory/init/req"Message type identifier
idstrYesauto UUIDMessage UUID
versionstrYes"1.0"Protocol version
tsfloatYesautoUnix epoch timestamp
namespacestrYes—Logical namespace for the memory session
scopedictYes{}Scope metadata (e.g., agent identity, environment)
metadatadictNo{}Additional init parameters

memory/init/resp — MemoryInitResponse ​

Host → Agent. Confirms session creation and returns the memory_id.

FieldTypeRequiredDefaultDescription
typestrYes"memory/init/resp"Message type identifier
idstrYesauto UUIDMessage UUID
versionstrYes"1.0"Protocol version
tsfloatYesautoUnix epoch timestamp
req_idstrYes""Echoes request ID
memory_idstrYes—Unique session identifier for all subsequent memory operations
namespacestrYes—Echoes the requested namespace

memory/store/req — MemoryStoreRequest ​

Agent → Host. Write one or more memory entries.

FieldTypeRequiredDefaultDescription
typestrYes"memory/store/req"Message type identifier
idstrYesauto UUIDMessage UUID
versionstrYes"1.0"Protocol version
tsfloatYesautoUnix epoch timestamp
memory_idstrYes—Session identifier from init
entrieslist[dict]Yes[]List of MemoryEntry dicts

memory/store/resp — MemoryStoreResponse ​

Host → Agent. Confirms which entries were stored.

FieldTypeRequiredDefaultDescription
typestrYes"memory/store/resp"Message type identifier
idstrYesauto UUIDMessage UUID
versionstrYes"1.0"Protocol version
tsfloatYesautoUnix epoch timestamp
req_idstrYes""Echoes request ID
storedlist[dict]Yes[]Keys that were successfully written
errorslist[str]Yes[]Errors for entries that failed

memory/retrieve/req — MemoryRetrieveRequest ​

Agent → Host. Retrieve memory entries. Supply keys for exact lookup, query for similarity search, or tags to filter. All fields are ANDed when multiple are set.

FieldTypeRequiredDefaultDescription
typestrYes"memory/retrieve/req"Message type identifier
idstrYesauto UUIDMessage UUID
versionstrYes"1.0"Protocol version
tsfloatYesautoUnix epoch timestamp
memory_idstrYes—Session identifier from init
keyslist[dict]No[]Exact key lookup
querystrNo""Semantic similarity search query
tagslist[str]No[]Filter by tag
tierstrNo""Filter by tier (empty = all)
limitintNo10Maximum entries to return
min_scorefloatNo0.0Minimum relevance score threshold

memory/retrieve/resp — MemoryRetrieveResponse ​

Host → Agent. Returns matching memory entries.

FieldTypeRequiredDefaultDescription
typestrYes"memory/retrieve/resp"Message type identifier
idstrYesauto UUIDMessage UUID
versionstrYes"1.0"Protocol version
tsfloatYesautoUnix epoch timestamp
req_idstrYes""Echoes request ID
entrieslist[dict]Yes[]List of MemoryEntry dicts
totalintYes0Total matching entries (before limit)

memory/forget/req — MemoryForgetRequest ​

Agent → Host. Delete memory entries by key or tag.

FieldTypeRequiredDefaultDescription
typestrYes"memory/forget/req"Message type identifier
idstrYesauto UUIDMessage UUID
versionstrYes"1.0"Protocol version
tsfloatYesautoUnix epoch timestamp
memory_idstrYes—Session identifier from init
keyslist[dict]No[]Keys to delete
tagslist[str]No[]Delete all entries matching these tags
tierstrNo"episodic"Tier to operate on

memory/forget/resp — MemoryForgetResponse ​

Host → Agent. Confirms deletion.

FieldTypeRequiredDefaultDescription
typestrYes"memory/forget/resp"Message type identifier
idstrYesauto UUIDMessage UUID
versionstrYes"1.0"Protocol version
tsfloatYesautoUnix epoch timestamp
req_idstrYes""Echoes request ID
deletedintYes0Number of entries deleted

Data Models ​

MemoryEntry ​

FieldTypeRequiredDefaultDescription
keydictYes—Composite key for the entry
contentAnyYes—JSON-serializable content
tierstrYes—Memory tier: working, episodic, semantic
tagslist[str]No[]Classification tags
sourcestrNo""Source identifier (e.g., "turn-42", "skill:text_summarizer")
scorefloatNo1.0Relevance/importance weight (0.0-1.0)
ttlintNo0Time-to-live in seconds; 0 = no expiry
created_atfloatNoautoCreation timestamp
updated_atfloatNoautoLast update timestamp

MemoryTier ​

ValueDescription
workingIn-session, lost on disconnect. Scratch pad.
episodicPersisted per-agent across sessions. Agent-specific knowledge.
semanticShared across all agents. Collective knowledge base.

Error Codes — MemoryErrorCode ​

CodeEnum ValueDescriptionRetryable
memory_fullMEMORY_FULLStorage limit reachedNo
memory_not_foundMEMORY_NOT_FOUNDRequested key not foundNo

Wire Examples ​

Initialize Memory Session ​

json
{"type":"memory/init/req","id":"m0a","version":"1.0","ts":1716123456.500,"namespace":"agent-session-1","scope":{"agent":"assistant"},"metadata":{"version":"1.0"}}
json
{"type":"memory/init/resp","id":"m0b","version":"1.0","ts":1716123456.550,"req_id":"m0a","memory_id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","namespace":"agent-session-1"}

Store Memory ​

json
{"type":"memory/store/req","id":"m1","version":"1.0","ts":1716123456.789,"memory_id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","entries":[{"key":{"agent":"a1","topic":"prefs"},"content":{"language":"python","style":"concise"},"tier":"episodic","tags":["preferences"],"source":"turn-1","score":0.9,"ttl":0}]}
json
{"type":"memory/store/resp","id":"m2","version":"1.0","ts":1716123456.800,"req_id":"m1","stored":[{"agent":"a1","topic":"prefs"}],"errors":[]}
json
{"type":"memory/retrieve/req","id":"m3","version":"1.0","ts":1716123457.100,"memory_id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","keys":[],"query":"user coding preferences","tags":[],"tier":"","limit":5,"min_score":0.5}

Forget by Tag ​

json
{"type":"memory/forget/req","id":"m4","version":"1.0","ts":1716123458.100,"memory_id":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","keys":[],"tags":["temp"],"tier":"working"}
json
{"type":"memory/forget/resp","id":"m5","version":"1.0","ts":1716123458.200,"req_id":"m4","deleted":3}

Security Considerations ​

  1. Tier isolation: Working memory is agent-scoped; semantic memory is shared — access control needed
  2. TTL enforcement: Expired entries must be garbage-collected by the host
  3. Storage limits: memory_full error prevents unbounded storage
  4. Content size limits: Host should enforce per-entry size limits
  5. Embedding privacy: Vector embeddings for similarity search must not leak sensitive content

A2E Protocol v1.0 — Released under the MIT License.