feat(storage): HNSW approximate nearest neighbor index - #50
Merged
Conversation
…ings - Add HNSWIndex with proper multi-level graph construction, greedy entry-point descent, and heap-based best-first layer search - Add BuildHNSWIndex/SearchHNSW to the Storage interface, with per-model indexes held on the Store and built on demand - Add embeddings_hnsw table for persisting the graph alongside embeddings - Transaction stores report HNSW ops as unsupported (index is rebuilt outside the transaction) - Update mocks and add TestHNSWIndex covering ranking, ordering, and per-model isolation
This was referenced Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 1 SQLite hardening (4/5). Merges after #49.
HNSWIndex: multi-level graph with greedy entry-point descent, heap-based best-first layer search, neighbor pruning (efConstruction=200, m=16, efSearch=50)BuildHNSWIndex/SearchHNSWon the Storage interface; per-model indexes held on the Store, built on demandembeddings_hnswtable persists the graph (also added via this branch's schema so it works standalone)TestHNSWIndexcovers ranking, ordering, and per-model isolationNote: includes
storage/lock.gore-added for compilation since it branched from main ahead of #47; expected to reconcile when #47 lands first.Merge order: after pragma/metrics (#49).