Skip to main content
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.
min_similarity
number
Minimum cosine similarity threshold for clustering (0.5–1.0). Default: 0.85. Higher = stricter matching.
mode
string
Merge strategy:
  • rule (default): Keep highest-importance memory, merge tags, soft-delete rest. Creates supersedes relationships.
  • llm: Synthesize a new memory from the cluster via LLM. Creates derived_from relationships.
namespace
string
Only consolidate memories in this namespace.
dry_run
boolean
If true, return clusters that would be merged without actually merging. Default: false.

Response (200 OK)

clusters_found
number
Number of similar memory clusters found.
memories_merged
number
Number of memories that were soft-deleted (merged into others).
memories_created
number
Number of new synthesized memories (LLM mode only).
clusters
array
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.