Repository navigation
Description
Summary
Re-adding a cloud project after delete_project(delete_notes=false) creates a new project record but does not index the retained note files, so the content remains inaccessible through MCP.
Discovered during the 2026-07-16 live acceptance run against basic_memory_development with Basic Memory revision b7142528752f1727056dba924b348abc84b407f9 deployed through Basic Memory Cloud revision 17810e7bd5ad0f41841308150b16acd233a3bf79.
Reproduction
- Create a cloud project and write two notes.
- Call
delete_projectwithdelete_notes=false. - Wait for the returned delete job to complete.
- Verify the project and graph rows are removed while both markdown objects remain in cloud storage.
- Call
create_memory_projectwith the same project name and path. - Poll
read_notefor the retained paths.
Observed project:
- original external ID:
c4fda783-40d8-4e0c-8eae-a8490f38061c - recreated external ID:
b8511385-3569-4a5b-aa24-fbd47c50e960 - path:
/acceptance-20260716-1558
Observed result
create_memory_projectreturnedcreated=trueimmediately.- The recreated project appeared in
list_memory_projectson every poll. - After 90 seconds and 13 attempts, both retained paths still returned null from
read_note. - Neon contained the recreated project row and zero entities for that project.
- Tigris still contained both retained markdown objects with their original content.
- No project-index workflow was enqueued for the recreated project.
This contradicts the delete_project(delete_notes=false) response, which says: Re-add the project to access its content again.
Root-cause investigation
This is owned by Basic Memory rather than the Cloud delete implementation:
create_memory_projectcallsProjectClient.create_project(...)and invalidates the workspace project cache.- It does not call the existing
ProjectClient.index(...)method after creation. - Basic Memory Cloud already implements
/v2/projects/{project_id}/indexby enqueueing the PGQueuer project-index workflow for S3-backed projects. - The Cloud retention and purge paths behaved correctly:
delete_notes=falseretained objects, anddelete_notes=truelater removed them.
Classification: indexing regression / incomplete project lifecycle contract in Basic Memory.
Suggested fix
After a successful create_memory_project, trigger project indexing using the newly returned external ID. In cloud/factory mode this should call the existing index endpoint and enqueue PGQueuer; for local projects it should run through the normal project-index path.
The returned result should expose the index acceptance or workflow/job identifier when indexing is asynchronous, rather than stating the project content is available before indexing has been accepted.
Add a regression test covering:
- delete a populated project with
delete_notes=false, - recreate the same name/path,
- assert an index is triggered,
- wait for completion,
- read/search the retained notes successfully.
Acceptance criteria
- Re-adding a retained project automatically triggers indexing.
- Retained notes become readable and searchable without an out-of-band API call.
- Cloud creation returns the indexing workflow/job identifier or an explicit indexing state.
- New empty projects remain idempotent and do not fail when the index finds zero files.
Activity
claude commentedon Jul 16, 2026
Claude finished @phernandez's task in 9m 0s —— View job
Claude ran into an environment issue while finishing up
Todo list:
create_memory_projectMCP tool andProjectClientProjectClient.index(...)/ index endpoint usageWhat was implemented
Root cause confirmed:
create_memory_project(src/basic_memory/mcp/tools/project_management.py) calledProjectClient.create_project(...)but never called the existingProjectClient.index(...)(src/basic_memory/mcp/clients/project.py), which hitsPOST /v2/projects/{id}/index. That route already works for local projects (LocalProjectIndexCommand, synchronous whenrun_in_background=False) and for cloud projects (PGQueuer enqueue, per the issue). Nothing else triggers indexing for a project created through this tool, so retained note files (fromdelete_project(delete_notes=false)) stayed invisible toread_note/search_notes.Changes (commit
f780024, onclaude/issue-1084-20260716-1658, not yet pushed — see below):src/basic_memory/mcp/tools/project_management.py: after a new project record is created, callproject_client.index(external_id, run_in_background=False)so local projects are indexed synchronously (immediately searchable/readable) and cloud can still enqueue its async workflow. The result (file counts locally, or a message/status/job id from cloud) is surfaced in both the JSON output ("indexing"key) and the text output (Indexing:section). Idempotent "already exists" responses are unaffected.test-int/mcp/test_project_management_integration.py: new regression testtest_recreate_project_after_delete_notes_false_indexes_retained_notes— creates a project, writes a note, deletes withdelete_notes=false, re-adds the same name/path, and asserts the retained note is immediately readable viaread_noteand discoverable viasearch_noteswith no extra index call. Also addedtest_create_project_indexing_is_idempotent_for_empty_projectscovering the "0 files found" case per the acceptance criteria.tests/mcp/test_tool_project_management.py: three existing unit tests that mockProjectClient.create_projectagainst a bare (non-ASGI-backed) fake HTTP client now also mockProjectClient.index, since the fix now calls it unconditionally on project creation.Blocked steps
uv run ...,just ...,python3 ...), and no approval was available in this run. I was not able to runjust fast-check,just fast-test, or the new tests. I traced the change carefully by hand (including howrun_in_background=Falsebehaves inLocalProjectIndexCommand.index_projectand the existingbm doctorcommand, which already exercises this exact synchronous index → search → status pattern), but this needs an actual test run before merging. Please runjust fast-checkanduv run pytest test-int/mcp/test_project_management_integration.py tests/mcp/test_tool_project_management.py -v(or update my--allowedToolsto permituv/just/python3) to confirm.git pushfailed with a permissions error —remote: Permission to basicmachines-co/basic-memory.git denied to github-actions[bot](403), on two attempts. The commit exists locally onclaude/issue-1084-20260716-1658but is not on the remote, so I can't provide a PR link yet. This looks like a repo/App permission issue unrelated to the code change — someone with push access may need to look at it, or re-run me once that's resolved.phernandez commentedon Jul 16, 2026
@claude make a PR the issue triage got stuck
claude commentedon Jul 16, 2026
Claude finished @phernandez's task in 6m 10s —— View job
Claude ran into an environment issue again while finishing up
Todo list:
create_memory_projectMCP tool andProjectClient.index(...)ProjectClient.create_projectWhat was implemented
Same root cause as diagnosed previously:
create_memory_project(src/basic_memory/mcp/tools/project_management.py) calledProjectClient.create_project(...)but never called the existingProjectClient.index(...)(src/basic_memory/mcp/clients/project.py), which hitsPOST /v2/projects/{id}/index. That route already works for local projects (LocalProjectIndexCommand, synchronous whenrun_in_background=False, matching the pattern already used bybasic-memory doctor) and, per this issue, for cloud projects via a PGQueuer enqueue. Nothing else triggered indexing for a project created through this tool, so retained note files fromdelete_project(delete_notes=false)stayed invisible toread_note/search_notes.Changes (commit
09d92fe, onclaude/issue-1084-20260716-1732, not yet pushed — see below):src/basic_memory/mcp/tools/project_management.py: after a new project row is created,create_memory_projectnow callsproject_client.index(external_id, run_in_background=False). Local projects index synchronously so retained content is immediately readable/searchable; cloud can still enqueue its async workflow. The outcome (file counts, a scheduled/async status, or an error) is surfaced via a new"indexing"key in JSON output and anIndexing:section in text output, instead of implying the content is already available before indexing happened. Indexing failures are reported rather than raised, since the project record was already created successfully either way.test-int/mcp/test_project_management_integration.py: addedtest_recreate_project_after_delete_notes_false_indexes_retained_notes(creates a project, writes a note, deletes withdelete_notes=false, re-adds the same name/path, asserts the retained note is immediately readable viaread_noteand discoverable viasearch_noteswith no extra index call) andtest_create_project_indexing_is_idempotent_for_empty_projects(asserts a brand-new empty project directory indexes cleanly with 0 files, per the acceptance criteria).tests/mcp/test_tool_project_management.py: the three existing unit tests that mockProjectClient.create_projectagainst a bare (non-ASGI-backed) fake HTTP client now also mockProjectClient.index, since the fix calls it unconditionally after project creation.Blocked steps
just ...,ruff ...,python3 ...) or does network I/O (git fetch), and no approval was available in this run — same restriction as the prior attempt. I traced the change carefully by hand against the existing synchronous local-index pattern indoctor.py/command_utils.py, but this needs an actual run before merging. Please runjust fast-checkanduv run pytest test-int/mcp/test_project_management_integration.py tests/mcp/test_tool_project_management.py -v(or update the allowed tools to permituv/just/python3/ruff) to confirm.git push(via the providedgit-push.shhelper) failed again withremote: Permission to basicmachines-co/basic-memory.git denied to github-actions[bot](403). The commit exists locally onclaude/issue-1084-20260716-1732but is not on the remote, so I can't provide a working compare/PR link — the branch doesn't exist on GitHub yet. This is a repo/App installation permission issue, not something fixable from within this sandbox. Someone with push access (or an updated App permission) will need to either push this branch or re-run me once that's resolved.