Skip to content
ParticleDB
Release candidateParticleDB 1.1.19-rc.17 is not yet GA or ready for production data.Release status →

Vector search

Store vectors and retrieve nearest records using SQL distance operators.

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_vectors
ORDER BY embedding <-> '[1,0,0]' LIMIT 2;

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.

SQL reference · Application guide · Troubleshooting