Skip to content

fix: add memory delete endpoint#794

Open
mturac wants to merge 1 commit into
rohitg00:mainfrom
mturac:fix/issue-739-delete-memory-endpoint
Open

fix: add memory delete endpoint#794
mturac wants to merge 1 commit into
rohitg00:mainfrom
mturac:fix/issue-739-delete-memory-endpoint

Conversation

@mturac
Copy link
Copy Markdown

@mturac mturac commented Jun 3, 2026

Summary

  • add DELETE /agentmemory/memories/:id with the same auth guard as the memory read endpoint
  • route deletion through mem::forget so the existing forget behavior owns the state change
  • cover registration and successful deletion with the existing memories API test file

Tests

  • git diff --check
  • npm test -- test/memories-pagination.test.ts
  • npm run build

Closes #739

Summary by CodeRabbit

  • New Features

    • Added a new API endpoint to delete agent memories.
  • Documentation

    • Updated API documentation to reflect the current number of REST API endpoints (126 total).

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

@mturac is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 897c34f4-69c9-49aa-85ef-b2380f7972f6

📥 Commits

Reviewing files that changed from the base of the PR and between d442fee and d16eb63.

📒 Files selected for processing (5)
  • AGENTS.md
  • README.md
  • src/index.ts
  • src/triggers/api.ts
  • test/memories-pagination.test.ts

📝 Walkthrough

Walkthrough

This PR adds a DELETE endpoint for individual memory records at /agentmemory/memories/:id, authenticates requests, validates the ID, checks existence in KV storage, and delegates deletion to the existing mem::forget function. Accompanying tests and documentation are added to reflect the new 126-endpoint count.

Changes

Memory deletion feature

Layer / File(s) Summary
Memory deletion endpoint and test coverage
src/triggers/api.ts, test/memories-pagination.test.ts
New authenticated DELETE /agentmemory/memories/:id endpoint validates the :id parameter, checks memory existence via KV, and delegates deletion to mem::forget with the memory ID. Test file adds mockKV() and mockSdk() utilities, then verifies the endpoint is registered correctly and performs a seeded-to-deleted flow with HTTP 200 assertion.
Documentation and startup log endpoint count update
AGENTS.md, README.md, src/index.ts
Endpoint count incremented from 125 to 126 in documentation files and the startup boot log message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A memory to forget, now just a DELETE away,
No more forgotten records haunting the fray!
One-twenty-six endpoints, all shiny and new,
Authenticated, validated, and tested too. 🗑️

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly describes the main change: adding a memory delete endpoint. It directly reflects the primary objective from the changeset.
Linked Issues check ✅ Passed The PR implements the primary objective from issue #739: adding DELETE /agentmemory/memories/:id endpoint with authentication and proper handling through mem::forget.
Out of Scope Changes check ✅ Passed All changes are scoped to implementing the DELETE endpoint and updating documentation/tests. Optional endpoints (PUT, bulk DELETE) from #739 are not implemented, which is acceptable as they were marked optional.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

The memories endpoint GET /agentmemory/memories returns entries with an id field, so the data model already supports individual records.

1 participant