Remember a session memory

Base URL
https://{kibana_url}
  • POST /api/context_engine/memory/_remember
  • POST /s/{space_id}/api/context_engine/memory/_remember
Auth

Writes one memory to the session memory store. Pass id to revise an existing memory. The revision replaces the memory in full.

Returns 202 with the memory id and writes the memory in the background, because semantic indexing runs inside the write. The memory becomes searchable after the background write completes.

Requires the contextEngine:write privilege. Without user_id, the route writes the memory for the caller's user profile, and a caller without a user profile gets a 403. Naming another user in user_id also requires contextEngine:manage_memory.

Each AI index in ai_index_ids must exist in this space, and the caller requires the Elasticsearch write privilege on its backing index. Otherwise, the route rejects the request and writes nothing.

After authorization, validation, and feature-flag checks pass, the route writes one memory_remember audit event per request, when the background write finishes or when it rejects the request. The route does not report a failed background write in the response. Instead, it logs the error to the Kibana logs and writes a failure audit event.

Returns a 404 response when Context Engine is turned off in this space (contextEngine:enabled), when memory is turned off (contextEngine:memoryEnabled), or when an AI index in ai_index_ids does not exist.

For more information, refer to the Context Engine documentation.

Required privileges

contextEngine:write. Extended privileges (optional, expand functionality when granted): contextEngine:manage_memory

Path parameters

space_id string optional

An identifier for the space. If space_id is not provided in the URL, the default space is used. Refer to Spaces for more information.

Header parameters

kbn-xsrf string required

A required header to protect against CSRF attacks

Request body

ai_index_ids string[] · max items: 100

The AI indices that dreaming promotes the memory into. Each must exist in this space, and the caller requires the Elasticsearch write privilege on its backing index.

attributes map string to string

String hints about the memory for dreaming. Accepts up to 50 entries, with non-blank keys of 1 to 256 characters.

property name* additional property string · max length: 1024
content string · min length: 1 · max length: 65536 required

The memory text. Elasticsearch indexes this field for semantic search.

id string · min length: 1 · max length: 256

The id of an existing memory to revise. The revision replaces the memory in full, and the route does not check whether the id exists. Omit this field to generate a new id.

session_id string · min length: 1 · max length: 256 required

The session the memory comes from.

user_id string · min length: 1 · max length: 1024

The Kibana user profile UID that the memory belongs to. Omit this field to use the caller's user profile. Naming another user requires contextEngine:manage_memory.

Responses

The route accepted the memory and is writing it in the background. It becomes searchable after the write completes.

application/json
id string required

The id of the memory. Pass it as id to revise the memory.

Base URL
https://{kibana_url}