You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The per-entity delete endpoint returns 500 Internal Server Error for entities whose note_type is file (non-.md: .qmd, .csv, .py, .txt, .yml, sync-conflict files, etc.). Markdown note-entities delete cleanly. POST .../knowledge/delete-directory deletes the same file-type entities without error, so the data model supports their deletion — only the per-entity endpoint fails.
Steps To Reproduce
Install version 0.20.3 (pip install basic-memory) and authenticate a cloud tenant.
Identify a file-type entity (e.g. a .qmd or .csv) and confirm it exists: GET /v2/projects/<project_id>/knowledge/entities/<entity_id> → 200.
Delete it: DELETE /v2/projects/<project_id>/knowledge/entities/<entity_id> → 500 Internal Server Error (repeatable, not transient — same entity 500s on retry).
Delete its parent directory instead: POST /v2/projects/<project_id>/knowledge/delete-directory with {"directory": "<parent/dir>"} → 200, deletes it and its siblings successfully.
Expected Behavior
DELETE .../entities/{id} should delete file-type entities the same way delete-directory does — or at minimum return a meaningful error rather than a 500.
Actual Behavior
500 Internal Server Error for every non-.md entity. Observed at scale: in a bulk removal of ~910 entities via the per-entity endpoint, all 571 .md succeeded and all 339 non-.md returned 500. A subsequent delete-directory pass cleared 100% of the 339 with zero failures.
Environment
OS: Windows 11 (10.0.26220)
Python version: 3.13.2
Basic Memory version: 0.20.3
Installation method: pip (--user)
Claude Desktop version (if applicable): N/A (reproduced via cloud REST API)
Additional Context
The 500 body carries no detail (Internal Server Error).
Related (checked — distinct):Add delete-note CLI command (bm tool delete-note) #879 (add delete-note CLI) documents these same DELETE .../entities/{id} and delete-directory endpoints as fully working; it does not cover this file-type 500. No existing issue found for the 500-on-non-markdown behavior.
Possible Solution
The per-entity delete path likely assumes markdown structure during post-delete cleanup (search-index removal / relation / embedding cascade) and throws on file-type (note_type: file) entities, whereas entity_service.delete_directory() uses a path that handles them. Aligning the single-entity delete with the directory-delete code path is the likely fix.
Bug Description
The per-entity delete endpoint returns 500 Internal Server Error for entities whose
note_typeisfile(non-.md:.qmd,.csv,.py,.txt,.yml, sync-conflict files, etc.). Markdown note-entities delete cleanly.POST .../knowledge/delete-directorydeletes the same file-type entities without error, so the data model supports their deletion — only the per-entity endpoint fails.Steps To Reproduce
0.20.3(pip install basic-memory) and authenticate a cloud tenant..qmdor.csv) and confirm it exists:GET /v2/projects/<project_id>/knowledge/entities/<entity_id>→ 200.DELETE /v2/projects/<project_id>/knowledge/entities/<entity_id>→ 500 Internal Server Error (repeatable, not transient — same entity 500s on retry).POST /v2/projects/<project_id>/knowledge/delete-directorywith{"directory": "<parent/dir>"}→ 200, deletes it and its siblings successfully.Expected Behavior
DELETE .../entities/{id}should delete file-type entities the same waydelete-directorydoes — or at minimum return a meaningful error rather than a 500.Actual Behavior
500 Internal Server Error for every non-
.mdentity. Observed at scale: in a bulk removal of ~910 entities via the per-entity endpoint, all 571.mdsucceeded and all 339 non-.mdreturned 500. A subsequentdelete-directorypass cleared 100% of the 339 with zero failures.Environment
--user)Additional Context
Internal Server Error).delete-noteCLI command (bm tool delete-note) #879 (adddelete-noteCLI) documents these sameDELETE .../entities/{id}anddelete-directoryendpoints as fully working; it does not cover this file-type 500. No existing issue found for the 500-on-non-markdown behavior.Possible Solution
The per-entity delete path likely assumes markdown structure during post-delete cleanup (search-index removal / relation / embedding cascade) and throws on file-type (
note_type: file) entities, whereasentity_service.delete_directory()uses a path that handles them. Aligning the single-entity delete with the directory-delete code path is the likely fix.