Skip to content

feat(storage): HNSW approximate nearest neighbor index - #50

Merged
Patel230 merged 6 commits into
mainfrom
feat/storage-hnsw
Aug 15, 2026
Merged

feat(storage): HNSW approximate nearest neighbor index#50
Patel230 merged 6 commits into
mainfrom
feat/storage-hnsw

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Phase 1 SQLite hardening (4/5). Merges after #49.

  • Add HNSWIndex: multi-level graph with greedy entry-point descent, heap-based best-first layer search, neighbor pruning (efConstruction=200, m=16, efSearch=50)
  • BuildHNSWIndex/SearchHNSW on the Storage interface; per-model indexes held on the Store, built on demand
  • embeddings_hnsw table persists the graph (also added via this branch's schema so it works standalone)
  • Transaction stores report HNSW ops as unsupported
  • Mocks updated; TestHNSWIndex covers ranking, ordering, and per-model isolation

Note: includes storage/lock.go re-added for compilation since it branched from main ahead of #47; expected to reconcile when #47 lands first.

Merge order: after pragma/metrics (#49).

…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
CI triage on PR #50. lock.go carries the process-lock branch fix.
Brings PR #47's lock wiring forward so this branch is self-contained
and merges trivially once #47 lands. CI triage on PR #50.
lock_unix.go/lock_windows.go carried over from the process-lock PR.
CI triage on PR #50.
# Conflicts:
#	storage/sqlite.go
#	storage/sqlite_test.go
@Patel230
Patel230 merged commit 5c7651e into main Aug 15, 2026
12 checks passed
@Patel230
Patel230 deleted the feat/storage-hnsw branch August 15, 2026 17:11
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