Create or update a memory

Introduced 2.12

Use this API to create or update a conversational memory for conversational search. A memory stores conversation history for the current conversation.

Once a memory is created, you’ll provide its memory_id to other APIs.

The POST method creates a new memory. The PUT method updates an existing memory.

When the Security plugin is enabled, all memories exist in a private security mode. Only the user who created a memory can interact with that memory and its messages.

Path and HTTP methods

  1. POST /_plugins/_ml/memory/
  2. PUT /_plugins/_ml/memory/<memory_id>

Path parameters

The following table lists the available path parameters.

ParameterData typeDescription
memory_idStringThe ID of the memory to be updated. Required for the PUT method.

Request body fields

The following table lists the available request fields.

FieldData typeRequired/OptionalDescription
nameStringOptionalThe name of the memory.

Example request

  1. POST /_plugins/_ml/memory/
  2. {
  3. "name": "Conversation for a RAG pipeline"
  4. }

copy

Example response

  1. {
  2. "memory_id": "gW8Aa40BfUsSoeNTvOKI"
  3. }