ParadeDB extends PostgreSQL with lightning-fast vector similarity search, letting you blend AI-powered semantic queries with standard SQL filters.
ParadeDB adds approximate-nearest-neighbor (ANN) indexing, hybrid BM25+vector ranking, and GPU support directly inside PostgreSQL. You keep ACID compliance, schema, and SQL while unlocking ChatGPT-style relevance for product catalogs or support docs.
Run CREATE EXTENSION paradedb;
after adding the ParadeDB binaries to $PGHOME/lib
or using the prebuilt Docker image. No external service is required; everything stays inside your existing cluster.
Add a vector
column sized to your embedding length (e.g., 384). Populate it with your favorite model offline or use paradedb.embed()
for on-the-fly generation.
ALTER TABLE Products ADD COLUMN embedding vector(384);
UPDATE Products
SET embedding = paradedb.embed(name || ' ' || coalesce(description,''));
Create a ParadeDB ivfflat
index. Choose a reasonable number of lists (√rows is a rule of thumb).
CREATE INDEX products_embedding_idx
ON Products USING ivfflat (embedding vector_l2_ops)
WITH (lists = 100);
Pass the query embedding to <->
(L2 distance) or <#>
(cosine). Limit for speed.
SELECT id, name, price
FROM Products
ORDER BY embedding <#> $1 -- $1 = 384-dim array
LIMIT 10;
Filter first, then order by distance to avoid scanning unnecessary rows.
SELECT id, name
FROM Products
WHERE stock > 0 AND price < 50
ORDER BY embedding <#> $1
LIMIT 5;
Product recommendations: find similar SKUs by embedding names and descriptions.
Semantic customer support: embed FAQs and fetch the closest answers.
Hybrid ranked search: combine BM25 text relevance with vectors for better recall.
AI chat memory: store conversation chunks as vectors for retrieval-augmented generation.
1. Deduplicate embeddings with a materialized view to avoid recomputation.
2. Use ANALYZE
after bulk loads so the planner respects your indexes.
3. Benchmark list counts and probes
per workload; there is no one-size-fits-all.
4. Keep embeddings in smaller tables or partitions when possible for cache locality.
Yes. ParadeDB builds on pgvector and keeps the same data type and operators, so existing code keeps working.
ParadeDB offers CUDA builds that offload ANN search to GPUs. Enable the GPU flag at compile time or use the official Docker image.
The vector
type supports up to 16,000 dimensions, but most models use 256–1536. Larger vectors increase storage and query time.