Vector search
Store vectors and retrieve nearest records using SQL distance operators.
Example
Section titled “Example”CREATE TABLE docs_vectors (id BIGINT PRIMARY KEY, content TEXT, embedding VECTOR(3));INSERT INTO docs_vectors VALUES (1, 'First', '[1,0,0]'), (2, 'Second', '[0,1,0]');SELECT id, content FROM docs_vectorsORDER BY embedding <-> '[1,0,0]' LIMIT 2;Behavior
Section titled “Behavior”Record 1 is nearest under Euclidean distance. Stored and query vectors must use the same embedding model and dimensions. <-> is Euclidean distance and <=> is cosine distance. Approximate indexes trade retrieval quality against resources and latency; measure both. Use relational filters to scope candidates, with authorization enforced by the application.
Related
Section titled “Related”This site uses Google Analytics cookies to count visits. Privacy · License