Tool reference · Maintenance & performance
memory_consolidate
Finds groups of near-duplicate records and, when asked, keeps the longest one in each group and marks the others as consolidated.
local stdio server writes
Caution. dry_run defaults to true. With dry_run: false shorter duplicates get status "consolidated" and drop out of normal recall; review the preview first.
When to use
- Recall returns several copies of the same fact or solution.
- You want a preview of duplicates in one project before cleaning up.
- After a bulk import that may have repeated content.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
project | string | — | Consolidate only this project (optional) |
threshold | number | 0.75 | Similarity threshold 0.0-1.0 (default 0.75) |
dry_run | boolean | true | If true, only show what would be merged |
Example
Arguments
{
"project": "billing-api",
"threshold": 0.8,
"dry_run": true
} Result shape
{
"dry_run": true,
"groups_found": 1,
"total_mergeable": 1,
"groups": [
{
"group_size": 2,
"type": "solution",
"project": "billing-api",
"records": [
{
"id": 3990,
"content": "Use Decimal with ROUND_HALF_EVEN for invoice totals"
},
{
"id": 4102,
"content": "Invoice totals: Decimal + ROUND_HALF_EVEN"
}
]
}
]
} With dry_run: false the result is { consolidated, groups_merged, total_removed, details: [{ kept, merged }] }.
Values are illustrative; the keys follow the server's handler. MCP clients receive the result as JSON text content.
Server description
The description the server sends to your agent in tools/list, captured from the v14.7.0 source:
Find and merge duplicate/similar knowledge records. Keeps the longest version, supersedes shorter duplicates. Reduces noise in recall results.