POST
/
user-memories
Python
from datagrid_ai import Datagrid

client = Datagrid(
    api_key="My API Key",
)
user_memory = client.memory.user.create(
    agent_id="agent_id",
    memory="memory",
)
print(user_memory.id)
{
  "object": "user_memory",
  "id": "<string>",
  "updated_at": "<string>",
  "created_at": "<string>",
  "user_prompt": "<string>",
  "context": [
    "<string>"
  ],
  "agent_id": "<string>",
  "user_id": "<string>",
  "memory": [
    "<string>"
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
agent_id
string
required

The agent ID of the user memory.

memory
string
required

The memory of the user memory.

user_prompt
string | null

The user prompt of the user memory.

context
string | null

The context of the user memory.

Response

201 - application/json

Successfully created user memory

object
enum<string>
required

The object type, which is always user_memory.

Available options:
user_memory
id
string
required

The ID of the user memory.

updated_at
string
required

The updated at of the user memory.

created_at
string
required

The created at of the user memory.

user_prompt
string
required

The user prompt of the user memory.

context
string[]
required

The context of the user memory.

agent_id
string
required

The agent ID of the user memory.

user_id
string
required

The user ID of the user memory.

memory
string[]
required

The memory of the user memory.