pgvector
pgvector is a PostgreSQL extension for storing vectors and searching by similarity. It supports exact nearest-neighbor search and approximate search with HNSW or IVFFlat indexes, letting vector data live alongside other database records. [1]
What does pgvector mean in simple terms?
An embedding turns an item into a numerical vector. pgvector stores that vector in Postgres and finds nearby vectors according to a chosen distance measure. This can support semantic retrieval, but meaningful results depend on embeddings, data, filters, and evaluation. Adding an index changes performance and may trade recall for speed.
How can pgvector be explained with an analogy?
It adds a similarity shelf to an existing archive: you can retrieve related items while keeping their ordinary records in the same place.
Where is pgvector used?
A Postgres knowledge store
A hypothetical team stores document chunks, source identifiers, and embeddings together. It retrieves candidates and checks them before using the text as context for an answer. [1]
Supabase integration
Supabase documents an AI toolkit using Postgres and pgvector, including vector storage and semantic or hybrid search guidance. This is a managed option, not evidence that every workload should use one architecture. [2]
Comparing indexes
A hypothetical team measures exact search, HNSW, and IVFFlat on its data. The README describes their speed, recall, build-time, and memory tradeoffs. It chooses based on measured requirements. [1]
Filtered retrieval
The README explains that filtering after an approximate index scan can leave too few results and documents iterative scans from version 0.8.0. A team tests its own filters and recall, rather than assuming an index alone ensures complete results. [1]
Learning steps, limitations and developments
Check extension availability and version in the chosen Postgres environment. Match vector dimensions and embedding space between stored data and queries. Design access controls, backups, updates, and evaluation. Benchmark the real workload; there is no universal row-count threshold or guaranteed advantage over another database.
Which concepts are related to pgvector?
- Related conceptMilvusA related concept within the same category.
- Related conceptQdrantA related concept within the same category.
- Related conceptChromaA related concept within the same category.
Which sources explain pgvector?
- pgvector official README — https://github.com/pgvector/pgvector
- Supabase AI and Vectors — https://supabase.com/docs/guides/ai
Tell us what you think
Your feedback helps us improve the content.