fix(tools): keep 2.x Claude memory files visible after the upgrade

The 3.0 Claude memory tool required a new metadata.source marker that files written by 2.x do not have, so an upgraded user saw an empty memory directory. Files are now matched by claude_memory_type and file_path, which both versions write; new files still get the source marker.
This commit is contained in:
Mahesh Sanikommu 2026-10-06 10:06:19 -07:00
parent 5c24e67d60
commit 7bbe680c6a
2 changed files with 3 additions and 3 deletions

View file

@ -33,7 +33,7 @@ Requires Node 18 or later and a `SUPERMEMORY_API_KEY` from [console.supermemory.
- **`getProfile`** returns v5 profile entries (`{ id, memory }`), so profile IDs can be passed to `memoryForget`. With a `query`, `searchResults` is the v5 search `results` array.
- **`documentList`** returns v5 documents; status is under `system.status`.
- **Conversations** saved by the middlewares are stored as one document per conversation (document `id` = the `id` you pass), instead of through `/v4/conversations`.
- **Claude memory tool** drops `memoryContainerTag`. Its files live in the configured namespace and are marked with `metadata.source = "claude-memory"`. Files written by 2.x are not migrated.
- **Claude memory tool** drops `memoryContainerTag`. Its files live in the configured namespace. New files are marked with `metadata.source = "claude-memory"`; files written by 2.x are still found, because both versions stamp `claude_memory_type` and `file_path`.
- **VoltAgent** search options use v5 shapes: `filters` → typed `filter`, `rerank` is `"none" | "order" | "aggregate"`, `searchMode: "documents"` → `"chunks"`, `include` keys are `documents`, `related`, `forgotten`, and `entityContext` → `supportingContext`.
## Usage

View file

@ -194,7 +194,7 @@ export class ClaudeMemoryTool {
filter: {
operator: "and",
operands: [
{ field: "source", operator: "eq", value: CLAUDE_MEMORY_SOURCE },
// 2.x files have no `source`; claude_memory_type + file_path identify files in both versions
{ field: "claude_memory_type", operator: "eq", value: "file" },
{ field: "file_path", operator: "contains", value: dirPath },
],
@ -572,7 +572,7 @@ export class ClaudeMemoryTool {
// Different paths can normalize to the same ID; only the exact file counts.
if (
document.metadata?.source !== CLAUDE_MEMORY_SOURCE ||
document.metadata?.claude_memory_type !== "file" ||
this.getDocumentFilePath(document) !== filePath
) {
return { success: false, error: `File not found: ${filePath}` }