Skip to content

Indexing consolidation: unify vector planners, clarify reindex mechanisms, micro-batching #1110

Description

@phernandez

From the 2026-07 architecture review (basic-memory-cloud docs/architecture-review-2026-07.md, diagram 4). Lower priority — comprehension debt plus modest wins, not a live bottleneck.

Important constraint first: both runtimes run FastEmbed (CPU); semantic_embedding_sync_batch_size = 2 is the deliberately benchmarked local default and cloud overrides to 64 via env. Do not change flush behavior without re-running those benchmarks.

  • Three overlapping vector planners: indexing/embedding_index_planning.py, indexing/vector_sync_planning.py, plus the batch path — unify to one planner with single + batch entry points
  • Three "reindex" mechanisms with easily-confused semantics: reindex_all_tenants (FTS + vectors, cloud), reindex_search -> search_service.reindex_all() (FTS-only, sequential per entity), reindex_vectors — operator guidance documented in basic-memory-cloud docs/architecture-review-2026-07.md
  • Incremental path enqueues one INDEX_EMBEDDINGS PGQ job per entity (file_followup_jobs.py) — coalesced into bounded embedding batches in basicmachines-co/basic-memory-cloud#1572
  • Vector prepare opens one write transaction per entity (search_repository_base.py:1421-1558) — batch
  • Relation resolution opens a new session per relation and per affected entity (indexing/relation_resolution.py:150-205) — batch into set-based updates + one multi-entity reindex

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-review2026-07 architecture review cleanup (cloud tracker basic-memory-cloud#1558)cloudBasic Memory CloudenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions