Skip to content

fix: add DELETE /banks/{bank_id}/memories/{memory_id} endpoint and MCP delete_memory tool#2784

Open
handnewb wants to merge 7 commits into
vectorize-io:mainfrom
handnewb:fix/delete-memory-endpoint
Open

fix: add DELETE /banks/{bank_id}/memories/{memory_id} endpoint and MCP delete_memory tool#2784
handnewb wants to merge 7 commits into
vectorize-io:mainfrom
handnewb:fix/delete-memory-endpoint

Conversation

@handnewb

Copy link
Copy Markdown
Contributor

Summary

Previously the delete_memory_unit engine method existed but had no HTTP endpoint or MCP tool exposure, making single-memory deletion impossible via API. The only way to delete individual memories was through bulk operations or direct DB access.

Changes

  • HTTP endpoint: DELETE /v1/default/banks/{bank_id}/memories/{memory_id} returning DeleteResponse
  • MCP tool: delete_memory registered in both DEFAULT_TOOLS and _DESTRUCTIVE_TOOLS
  • Proper error handling: 404 when not found, 400 for invalid UUID, 500 for unexpected errors
  • Audited operation with @audited("delete_memory")

Verification

  • 14 static checks pass (endpoint present, MCP tool registered, error paths covered)
  • Follows existing patterns from delete_document endpoint and invalidate_memory MCP tool

Closes #2523

handnewb added 7 commits July 17, 2026 14:03
…P delete_memory tool

Previously the delete_memory_unit engine method had no HTTP endpoint
or MCP tool exposure, making single-memory deletion impossible via API.
This adds:

- DELETE /v1/default/banks/{bank_id}/memories/{memory_id} returning DeleteResponse
- MCP tool 'delete_memory' (hindsight_forget) registered in both DEFAULT_TOOLS and _DESTRUCTIVE_TOOLS
- Audited operation with proper 404/400/500 error handling

Closes vectorize-io#2523
…point

- Regenerated openapi.json from HTTP endpoint (DELETE /banks/{bank_id}/memories/{memory_id})
- Updated skills/hindsight-docs/references/openapi.json
- Regenerated Python client (memory_api.py) with delete_memory method
- Added Go client DeleteMemory API (api_memory.go)
- Updated Go OpenAPI YAML (openapi.yaml) with delete endpoint
- Added TypeScript SDK deleteMemory function (sdk.gen.ts)
- Added TypeScript DeleteMemoryData types (types.gen.ts)

Fixes CI verify-generated-files check.
…te Go YAML

- Regenerated Go OpenAPI YAML via Docker openapi-generator (exact CI match)
- Added DeleteMemoryData/Errors/Responses imports to TypeScript sdk.gen.ts
Generated via @hey-api/openapi-ts v0.88.0 with @hey-api/client-fetch and
@hey-api/typescript peer dependencies installed. The previous manual changes
did not match the auto-generator output format.
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.

DELETE/forget memory operation returns 404 for IDs that exist (get_memory succeeds)

1 participant