LearnNewsExamplesServices
Frontmatter
id12156
titledefragChromaDB: two targets become collection-groups over one store
stateClosed
labels
enhancementairefactoringarchitecture
assigneesneo-gpt
createdAtMay 29, 2026, 1:43 AM
updatedAtJun 1, 2026, 12:26 AM
githubUrlhttps://github.com/neomjs/neo/issues/12156
authorneo-opus-ada
commentsCount1
parentIssue12153
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[x] 12155 Rename Chroma store to unified; migrate + drop stale memory-core
blocking[]
closedAtJun 1, 2026, 12:26 AM

defragChromaDB: two targets become collection-groups over one store

Closed v13.0.0/archive-v13-0-0-chunk-14 enhancementairefactoringarchitecture
neo-opus-ada
neo-opus-ada commented on May 29, 2026, 1:43 AM

Context

Sub of #12153. Post one-flat-store, defragChromaDB.mjs's two TARGETS (knowledge-base, memory-core) must operate as two collection-groups over the single unified store, not two folders.

The Architectural Reality

ai/scripts/maintenance/defragChromaDB.mjs TARGETS (:67-86): each target carries path + collections. With one store, both targets' path converges on the unified SSOT; the nuke-and-pave ETL is scoped by collections; the step-5 orphan-cleanup keep-set already spans the whole store (#12140/#12141 — "the keep-set is the segment registry… never a single target's collection ids").

The Fix

  • Both targets' path → the unified SSOT (engines.chroma.dataDir). KB target collections: [neo-knowledge-base]; memory-core target collections: [memory, session] (confirm whether the graph collection belongs here).
  • Verify the keep-set spans all live segments across collections — defragging one realm preserves the others' segment dirs.
  • Update the usage docstring to drop per-folder framing.

Contract Ledger

Surface Authority Behavior Fallback Docs Evidence
defrag TARGETS[*].path defragChromaDB.mjs both → unified SSOT n/a defrag docs #12152, #12140

Acceptance Criteria

  • Both targets operate on the one unified store, scoped by collection.
  • Negative test: defragging one realm preserves the others' live segments.
  • Depends-on parent sub 2 (unified path) + #12152.

Out of Scope

The rename itself (parent sub 2); shadow-swap MC-defrag robustness (separately tracked).

Related

#12153 (parent), #12152, #12140, #12142.

Origin Session ID: efd8dc2e-2052-4089-814a-ab22cd8c6a62

tobiu referenced in commit 7cedc3b - "docs(ai): ADR 0017 — single flat unified Chroma store + dev/prod parity (#12154) (#12159) on May 29, 2026, 3:18 AM
tobiu referenced in commit dfc4006 - "feat(ai): defrag chroma collection groups (#12156) (#12275) on Jun 1, 2026, 12:26 AM
tobiu closed this issue on Jun 1, 2026, 12:26 AM
tobiu referenced in commit 8b619ff - "fix(ai): register local Chroma embedding functions (#12156) (#12405) on Jun 3, 2026, 3:23 PM