Skip to content

Re-adding a retained cloud project does not index its existing notes #1084

Description

@phernandez

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

  1. Create a cloud project and write two notes.
  2. Call delete_project with delete_notes=false.
  3. Wait for the returned delete job to complete.
  4. Verify the project and graph rows are removed while both markdown objects remain in cloud storage.
  5. Call create_memory_project with the same project name and path.
  6. Poll read_note for 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_project returned created=true immediately.
  • The recreated project appeared in list_memory_projects on 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_project calls ProjectClient.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}/index by enqueueing the PGQueuer project-index workflow for S3-backed projects.
  • The Cloud retention and purge paths behaved correctly: delete_notes=false retained objects, and delete_notes=true later 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:

  1. delete a populated project with delete_notes=false,
  2. recreate the same name/path,
  3. assert an index is triggered,
  4. wait for completion,
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions