Quickstart
Enable memory on an agent to remember end-user facts across conversations
Enable memory on an agent, have a conversation, then read the facts the agent extracted.
Enable memory on an agent
Update an existing agent to turn on memory extraction. Set scope to "user" (default) to share memory across all agents, or "agent" to isolate it to this agent.
curl -X PATCH "https://api.d-id.com/agents/<YOUR_AGENT_ID>" \
-H "Authorization: Basic <YOUR_KEY>" \
-H "Content-Type: application/json" \
-d '{
"memory": {
"enabled": true,
"scope": "user"
}
}'{
"id": "agt_abc123",
"preview_name": "My Agent",
"memory": {
"enabled": true,
"scope": "user"
}
}Have a conversation
Start a session with your agent and exchange at least 4 messages. Memory extraction triggers only when the session ends and the minimum message count is met.
After the session ends, the extractor runs in the background — no action needed on your end.
Read the extracted memory
Wait 5 minutes before fetching the memory document for the end-user. Use the end-user's ID as the memory ID (e.g. your internal user identifier). If you set scope: "agent", use <END_USER_ID>~<AGENT_ID> instead.
curl -X GET "https://api.d-id.com/memories/<END_USER_ID>" \
-H "Authorization: Basic <YOUR_KEY>"{
"items": [
{
"id": "mi_abc123def456",
"data": "User prefers morning meetings.",
"priority": 3,
"created_at": "2024-06-15T09:30:00Z"
},
{
"id": "mi_xyz789ghi012",
"data": "User is training for a half-marathon in May.",
"priority": 4,
"created_at": "2024-06-15T09:30:01Z"
}
]
}Each item in items is a durable fact extracted from the conversation. These facts are automatically injected into the agent's context at the start of the next session.
Updated 3 months ago
