13 lines
609 B
SQL
13 lines
609 B
SQL
-- 009_notes_embedding.sql
|
|
-- Adds vector embedding column to notes for semantic search.
|
|
-- Uses the same vector(3072) dimension as kb_chunks for uniformity.
|
|
|
|
ALTER TABLE notes ADD COLUMN IF NOT EXISTS embedding vector(3072);
|
|
|
|
-- NOTE: pgvector HNSW indexes are limited to 2000 dimensions.
|
|
-- For 3072-dim vectors, IVFFlat is the option but requires training
|
|
-- data (rows). The notes table is typically small enough that a
|
|
-- sequential scan is fast. If needed, create after data exists:
|
|
-- CREATE INDEX idx_notes_embedding ON notes
|
|
-- USING ivfflat (embedding vector_cosine_ops) WITH (lists = 100);
|