active-memory

Retrieve semantically similar fragments from active memory

Embed body.query_text, then query the Cloudflare Worker for the top-k most similar fragments. The Worker performs cosine similarity over the Durable Object's SQLite vector store and hydrates fragment texts from Workers KV.

If episode_id is omitted, all open episodes for agent_id are searched.

post/active-memory/retrieve

Request

Request body

agent_idstring required

Agent identifier

user_hashstring nullable

Hashed user ID. If omitted, backend derives it from authenticated org_id + effective user scope.

episode_idstring nullable

Scope search to one episode; None = all open episodes for agent

scope_user_idstring nullable

Optional effective user_id for agent/service tokens. If provided, user_hash must match server-derived hash for this user.

query_textstring required

Text to embed and search

top_kinteger

Max hits to return

scopestring nullable

Optional scope "<kind>:<value>" to narrow the read to. Must be in the caller's visible scopes (403 otherwise); omitted = every visible scope.

Response

Successful Response

total_scannedinteger required
active_episodes_searchedinteger required

Changes

No recorded changes to this operation across all 1 revision of this API.