aboutsummaryrefslogtreecommitdiff
path: root/apps/mcp/src/client.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-01 08:19:27 -0800
committerFuwn <[email protected]>2026-02-01 08:19:27 -0800
commit320917d54248035f001bdec2146cf50a19f14cee (patch)
treef5137779b77e5ea63db737af55b2912d2099c017 /apps/mcp/src/client.ts
parentlangchain integration (#718) (diff)
downloadsupermemory-main.tar.xz
supermemory-main.zip
fix(mcp): Use search.documents for forgetMemory to get correct IDsHEADmain
Diffstat (limited to 'apps/mcp/src/client.ts')
-rw-r--r--apps/mcp/src/client.ts14
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)}"`,