As conversations grow, long-term memories accumulate duplicates, inconsistent phrasing, mergeable entries, and outdated items. Memory Dream refines, merges, and deduplicates stored memories and raw messages in the background, producing actionable operations that keep the memory store concise and consistent. Choose between proposal-first review and confidence-gated auto-apply.
Key concepts
Memory Dream reads from the memory store and produces consolidation actions in the background. Consolidation tasks come in three types, distinguished by their target. Actions from memory tasks write back to the memory store; actions from skill and profile tasks are emitted only as standalone events for the caller to consume.
|
taskType |
Consolidation target |
Action types emitted |
|
|
Long-term memories: rewrite, merge, deduplicate, or remove outdated entries. Applied actions update the memory store directly. |
|
|
|
Reusable skills extracted from historical interactions. Actions are emitted as events and do not write to the memory store. |
|
|
|
Structured user profiles distilled from interactions. Actions are emitted as events and do not write to the memory store. |
|
Choose an apply mode based on how much you trust the consolidation results:
|
applyMode |
Behavior |
|
|
Consolidation generates only |
|
|
Actions that meet the confidence threshold ( |
applyMode is supported only for taskType=memory. Passing skill or profile returns a 403 error (applyMode is not supported for taskType=skill|profile). Actions from skill and profile tasks (EMIT_SKILL / EMIT_PROFILE) are emitted as events for the caller to consume, with no apply workflow.
Quick start
In proposal mode, the end-to-end workflow uses four APIs in order: create a task, poll its status, list proposed actions, and apply them. Task status transitions: queued → running → planning → (optional applying) → completed. Other terminal states include completed_with_failures, failed, and cancelled.
Step 1: Create a consolidation task
POST /CreateMemoryDreamTask
{
"memoryStoreName": "agent_memory",
"scopes": [ { "appId": "app-001", "tenantId": "user-001" } ],
"taskType": "memory",
"applyMode": "proposal"
}
Response:
{
"memoryStoreName": "agent_memory",
"dreamId": "2a528008111f5dc3500c73fd965089f7",
"status": "queued",
"createdAt": "2026-06-17T07:21:25.329Z"
}
Step 2: Poll the task status
POST /GetMemoryDreamTask
{ "memoryStoreName": "agent_memory", "dreamId": "2a528008111f5dc3500c73fd965089f7" }
Right after a task is created, the consolidation task index may still be building. GetMemoryDreamTask may briefly return 409 (error message: dream task index is still building, please retry shortly). Retry after a short wait.
Response (completed):
{
"dreamId": "2a528008111f5dc3500c73fd965089f7",
"taskType": "memory",
"applyMode": "proposal",
"status": "completed",
"actions": { "total": 2, "proposed": 2, "applied": 0, "skipped": 0, "failed": 0 },
"input": { "sessionCount": 1, "messageCount": 1, "memoryCount": 2, "incremental": false },
"finishedAt": "2026-06-17T07:21:32.276Z"
}
Step 3: Review proposed actions
POST /ListMemoryDreamActions
{ "memoryStoreName": "agent_memory", "dreamId": "2a528008111f5dc3500c73fd965089f7", "limit": 20 }
Response:
{
"dreamId": "2a528008111f5dc3500c73fd965089f7",
"actions": [
{
"actionId": "968768529cdfde8d56686a71e1c28227",
"action": "UPDATE",
"status": "proposed",
"targetMemoryId": "d16fd038835d89ae8586f7814e5256c1",
"newMemory": { "text": "User prefers concise responses.", "unitType": "atomic_fact" },
"reason": "Rewrite as a more precise atomic_fact.",
"confidence": 0.95
}
]
}
Key action fields:
|
Field |
Description |
|
|
Action ID. Used when applying the action. |
|
|
Action type: |
|
|
Action status: |
|
|
Scope and target memory ID that the action operates on ( |
|
|
New memory content, including |
|
|
Model-provided reason for the action. |
|
|
Confidence score, from 0 to 1. |
Step 4: Apply actions
POST /ApplyMemoryDreamActions
{
"memoryStoreName": "agent_memory",
"dreamId": "2a528008111f5dc3500c73fd965089f7",
"actionIds": ["968768529cdfde8d56686a71e1c28227", "a0f4715245920ea7b6a34c1828c6f1ae"]
}
Response:
{
"dreamId": "2a528008111f5dc3500c73fd965089f7",
"applied": 2,
"failed": 0,
"results": [
{ "actionId": "968768529cdfde8d56686a71e1c28227", "status": "applied", "memoryId": "bd14a67ed215c114896325d912c8fa71" }
]
}
Key parameters
For parameter value ranges, see Limitations and notes.
|
Parameter |
Description |
|
|
Scopes to consolidate. Required. Up to 20 items. |
|
|
Action IDs to apply. Required for |
|
|
Auto-apply thresholds. Keys: |
|
|
Scope of the resulting memories: |
|
|
When set to |
|
|
Restricts the time range of messages included in the consolidation. |
|
|
Maximum number of sessions processed in a single consolidation run. |
|
|
Maximum number of messages processed in a single consolidation run. |
|
|
Maximum number of memories processed in a single consolidation run. |
|
|
Maximum number of scopes after expansion. |
|
|
Custom consolidation instructions, up to 4,000 characters. |
Best practices
Do not block the online request path while waiting for consolidation results. Consolidation runs in the background; poll
GetMemoryDreamTaskfor progress.Use
proposalmode in production and apply actions only after human or programmatic confirmation. When you trust the results, defineconfidenceThresholdsforadd,update, andmerge, and switch tosafe_automode.For scheduled consolidation, set
incremental=trueto avoid full reprocessing on each run.