feat(knowledge): HNSW vector search optimization#10
Merged
Conversation
Prevent Dependabot from auto-creating PRs for major version upgrades (e.g. Prisma 6→7, eslint 9→10, vitest 3→4). Major bumps require manual review and code updates before merging. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extend major-version ignore rule to GitHub Actions and Docker in addition to npm. This prevents PRs for Node Alpine upgrades (20→25) and major GitHub Actions version bumps since we use SHA-pinned actions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uning - Add HNSW indexes on KBChunk.embedding and AgentMemory.embedding (m=16, ef_construction=64) - Add GIN index for full-text keyword search on KBChunk.content - Add filtered B-tree index on KBChunk.sourceId for scoped vector queries - Implement dynamic SET LOCAL hnsw.ef_search per query complexity (40/60/100) - Add vector_query_ms and keyword_query_ms latency metrics for benchmarking - Document HNSW index configuration in CLAUDE.md - Include full implementation plan in docs/hnsw-implementation-plan.md Expected improvement: ~15-50x faster semantic search (O(n) seq scan → O(log n) HNSW) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
webdevcom01-cell
added a commit
that referenced
this pull request
May 24, 2026
Migration 20260604000000: TENANT_DIRECT RLS on ApprovalPolicy. Pre-auth lookups (loadPolicy, decisions pre-auth) use withAdminBypass — same pattern as loadDepartment/loadGoal from migrations #4/#5. CRUD routes use withOrgContext with org ID from loadPolicy result. checkPolicies gains optional organizationId param; requestApproval wraps the policy findUnique in withOrgContext. processTimeouts unchanged — cross-org cron relies on DATABASE_URL BYPASSRLS.
3 tasks
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.
Summary
vector_query_msandkeyword_query_msfor benchmarking pre/post improvementDatabase indexes created (already live on Supabase)
kbchunk_embedding_hnsw_idxagentmemory_embedding_hnsw_idxkbchunk_content_fts_idxkbchunk_source_embedding_ready_idxFiles changed
src/lib/knowledge/search.ts— ef_search tuning + latency metricssrc/lib/runtime/handlers/memory-read-handler.ts— ef_search for memory lookupsCLAUDE.md— documented HNSW index configurationdocs/hnsw-implementation-plan.md— full implementation planTest plan
pnpm precheck)pg_indexesquery on Supabasekb.search.vector_query_msmetric after deploy for latency improvement🤖 Generated with Claude Code