Skip to content

Fix Chroma HNSW crash after \\reset - #104

Merged
milljm merged 3 commits into
mainfrom
fix/chroma-hnsw-reset
Sep 5, 2026
Merged

milljm merged 3 commits into
mainfrom
fix/chroma-hnsw-reset

Conversation

@milljm

@milljm milljm commented Sep 5, 2026

Copy link
Copy Markdown
Owner

\\reset wipes the branch user/AI collections. The next turn retrieves before it stores, so Chroma get-or-creates an empty HNSW segment and similarity_search raises:

Error executing plan: Internal error: Error creating hnsw segment reader: Nothing found on disk

That is especially easy to hit after branching (clone creates the named collections) then resetting them.

Fix (rag_manager.py):

  • Skip similarity search when the collection count is 0. store_data fills the index later this turn.
  • If HNSW is already corrupt, drop the collection instead of failing the plan.
  • delete_collection no longer opens-to-delete via a query path.

After merge: \\reset then hello! should just chat.

\\reset deletes the branch user/AI collections. The next turn retrieves
before it stores, so Chroma get-or-creates an empty HNSW segment and
similarity_search raises:

  Error creating hnsw segment reader: Nothing found on disk

Skip the search when count is 0 (store_data fills the index later this
turn). If HNSW is already corrupt, drop the collection instead of
crashing the plan.
Assistant retrieve always used the shared assistant_* collections, while
store/clone/reset used {branch}_*. After \\branch then \\reset, hello
still pulled the parent's RAG.

User/AI collections now follow the branch name. Gold stays shared
(assistant_gold_documents). \\reset / delete-branch call wipe_branch_stores
so they destroy those two collections and their parent docstores, and
never glob {branch}* (that would delete gold when resetting assistant).
Adds a workflow that installs Python deps (minus the conda-only
nodejs line) and runs test_harness.py on push to main and every PR.

Also documents that wipe_branch_stores('branch_x') leaves branch_y
and gold alone.
@milljm
milljm merged commit 0202d19 into main Sep 5, 2026
1 check passed
@milljm
milljm deleted the fix/chroma-hnsw-reset branch September 5, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant