Consolidate Memories
API Reference
Consolidate Memories
POST /v1/memories/consolidate — Auto-merge similar memories to reduce redundancy.
POST
Consolidate Memories
Price: $0.01 USDC
Consolidate automatically finds and merges semantically similar memories. It uses vector similarity to identify clusters of redundant memories and merges them via rule-based or LLM-powered strategies.
Request Body
All fields are optional. The API auto-discovers similar memory pairs.Minimum cosine similarity threshold for clustering (0.5–1.0). Default:
0.85. Higher = stricter matching.Merge strategy:
rule(default): Keep highest-importance memory, merge tags, soft-delete rest. Createssupersedesrelationships.llm: Synthesize a new memory from the cluster via LLM. Createsderived_fromrelationships.
Only consolidate memories in this namespace.
If
true, return clusters that would be merged without actually merging. Default: false.Response (200 OK)
Number of similar memory clusters found.
Number of memories that were soft-deleted (merged into others).
Number of new synthesized memories (LLM mode only).
Details of each cluster.
Example
Response
In
rule mode, the highest-importance memory survives and inherits tags from all merged memories. In llm mode, a new memory is synthesized that combines all unique information from the cluster.