Remember a session memory
- Base URL
-
https://{kibana_url}
- POST /api/context_engine/memory/_remember
- POST /s/{space_id}/api/context_engine/memory/_remember
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_idstringoptional -
An identifier for the space. If
space_idis not provided in the URL, the default space is used. Refer to Spaces for more information.
Request body
-
ai_index_idsstring[] · max items: 100 -
The AI indices that dreaming promotes the memory into. Each must exist in this space, and the caller requires the Elasticsearch
writeprivilege on its backing index. -
attributesmap 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 propertystring · max length: 1024 -
contentstring · min length: 1 · max length: 65536required -
The memory text. Elasticsearch indexes this field for semantic search.
Responses
The route accepted the memory and is writing it in the background. It becomes searchable after the write completes.
user_id is missing and the caller has no user profile, user_id names another user and the caller lacks contextEngine:manage_memory, or the caller cannot write to one of the AI indices.