Skip to content

feat(ts-client): support batch memory delete#1266

Merged
sscargal merged 3 commits intoMemMachine:mainfrom
yaleMemVerge:mem-ts-client
Apr 17, 2026
Merged

feat(ts-client): support batch memory delete#1266
sscargal merged 3 commits intoMemMachine:mainfrom
yaleMemVerge:mem-ts-client

Conversation

@yaleMemVerge
Copy link
Copy Markdown
Contributor

@yaleMemVerge yaleMemVerge commented Mar 25, 2026

Purpose of the change

Support deleting multiple memories in a single API call from the TypeScript client, aligning with the existing server-side batch delete capability.

Description

The server's DeleteEpisodicMemorySpec and DeleteSemanticMemorySpec already accept both a single ID (episodic_id/semantic_id) and a list (episodic_ids/semantic_ids). This PR updates the TS client's MemMachineMemory.delete() to expose that capability.

Fixes/Closes

Fixes #1249

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Unit Test
  • Manual verification (list step-by-step instructions)
  1. Call memory.delete('id123', 'episodic') — single delete, backward compatible
  2. Call memory.delete(['id123', 'id456'], 'episodic') — batch delete, sends episodic_ids array in payload
  3. Call memory.delete([], 'episodic') — throws MemMachineAPIError client-side before any request is sent

Test Results: Verified locally against a running MemMachine server instance.

Checklist

  • I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • Confirmed all checks passed
  • Contributor has signed the commit(s)
  • Reviewed the code
  • Run, Tested, and Verified the change(s) work as expected

Further comments

package-lock.json changes are from npm audit fix — upgrades flatted (3.3.3→3.4.2) and markdown-it (14.1.0→14.1.1) to address security advisories, along with peer dependency metadata corrections.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the TypeScript client’s MemMachineMemory.delete() API to support batch deletion of episodic/semantic memories in a single request, aligning the client with the server’s existing *_ids delete fields.

Changes:

  • Widen memory.delete() to accept either a single ID (string) or multiple IDs (string[]).
  • Update delete request payload construction to send episodic_ids / semantic_ids.
  • Apply npm audit fix updates in package-lock.json (notably flatted and markdown-it upgrades).

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/ts-client/src/memory/memmachine-memory.ts Exposes batch delete and adjusts delete payload format to use *_ids.
packages/ts-client/package-lock.json Lockfile updates from npm audit fix (dependency/security metadata changes).
Files not reviewed (1)
  • packages/ts-client/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ts-client/src/memory/memmachine-memory.ts
Comment thread packages/ts-client/src/memory/memmachine-memory.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • packages/ts-client/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ts-client/src/memory/memmachine-memory.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • packages/ts-client/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ts-client/src/memory/memmachine-memory.ts Outdated
Comment thread packages/ts-client/tests/memmachine-memory.spec.ts
- `delete()` now accepts `string | string[]` for bulk episodic/semantic deletion
- chore: run `npm audit fix` (flatted 3.3.3→3.4.2, markdown-it 14.1.0→14.1.1)

Signed-off-by: yaleMemVerge <yale.sun@memverge.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • packages/ts-client/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sscargal sscargal added this to the v0.3.4 milestone Mar 28, 2026
@sscargal sscargal requested a review from Copilot March 28, 2026 19:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • packages/ts-client/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • packages/ts-client/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ts-client/src/memory/memmachine-memory.ts Outdated
Comment thread packages/ts-client/src/memory/memmachine-memory.ts Outdated
sscargal and others added 2 commits April 17, 2026 12:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@sscargal sscargal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sscargal sscargal merged commit b857249 into MemMachine:main Apr 17, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: [Bug]: Typescript Client library to support deleting a list of memories

3 participants