diff options
| author | Fuwn <[email protected]> | 2026-02-01 08:19:27 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-01 08:19:27 -0800 |
| commit | 320917d54248035f001bdec2146cf50a19f14cee (patch) | |
| tree | f5137779b77e5ea63db737af55b2912d2099c017 /apps | |
| parent | langchain integration (#718) (diff) | |
| download | supermemory-320917d54248035f001bdec2146cf50a19f14cee.tar.xz supermemory-320917d54248035f001bdec2146cf50a19f14cee.zip | |
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/mcp/src/client.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/mcp/src/client.ts b/apps/mcp/src/client.ts index ce88be33..678d19b5 100644 --- a/apps/mcp/src/client.ts +++ b/apps/mcp/src/client.ts @@ -98,8 +98,12 @@ export class SupermemoryClient { content: string, ): Promise<{ success: boolean; message: string; containerTag: string }> { try { - // First search for the memory - const searchResult = await this.search(content, 5) + // First search for the document + const searchResult = await this.client.search.documents({ + q: content, + limit: 5, + containerTags: [this.containerTag], + }) if (searchResult.results.length === 0) { return { @@ -110,10 +114,10 @@ export class SupermemoryClient { } // Delete the most similar match - const memoryToDelete = searchResult.results[0] - await this.client.memories.delete(memoryToDelete.id) + const documentToDelete = searchResult.results[0] + await this.client.memories.delete(documentToDelete.documentId) - const memoryText = memoryToDelete.memory || memoryToDelete.content || "" + const memoryText = documentToDelete.title || documentToDelete.content || "" return { success: true, message: `Forgot: "${limitByChars(memoryText, 100)}"`, |