---
title: "What is pgvector?"
description: "pgvector is an open-source PostgreSQL extension that adds vector storage, indexing, and similarity search for embeddings alongside relational application data. It supports semantic search, recommendations, retrieval-augmented generation (RAG), image similarity, anomaly detection, and deduplication without requiring a separate vector database for many workloads. The extension uses the vector data type and distance metrics including L2, cosine similarity, and inner product, with HNSW and IVFFlat indexes offering different speed and memory trade-offs. Vector queries can also combine relational filters with Postgres full-text search for hybrid retrieval. pgvector is positioned as a practical choice for existing Postgres deployments, while pgvectorscale can extend its usefulness as data and query demands grow; dedicated vector databases become more relevant at larger scales, and Databricks AI Search serves complementary lakehouse workloads."
---

# What is pgvector?

[Databricks](https://yomu.fyi/company/databricks) · Databricks Staff · Apr 17, 2026

**Type:** Explainer

## Summary

pgvector is an open-source PostgreSQL extension that adds vector storage, indexing, and similarity search for embeddings alongside relational application data. It supports semantic search, recommendations, retrieval-augmented generation (RAG), image similarity, anomaly detection, and deduplication without requiring a separate vector database for many workloads. The extension uses the vector data type and distance metrics including L2, cosine similarity, and inner product, with HNSW and IVFFlat indexes offering different speed and memory trade-offs. Vector queries can also combine relational filters with Postgres full-text search for hybrid retrieval. pgvector is positioned as a practical choice for existing Postgres deployments, while pgvectorscale can extend its usefulness as data and query demands grow; dedicated vector databases become more relevant at larger scales, and Databricks AI Search serves complementary lakehouse workloads.

## Context

Many AI applications need semantic retrieval rather than exact keyword matching, while teams may want to keep embeddings and application data in an existing Postgres system. The source frames the choice between pgvector and dedicated vector databases around scale, performance requirements, and operational complexity.

## Approach / What changed

pgvector adds a Postgres vector data type, similarity metrics, HNSW and IVFFlat indexes, filtered search, and hybrid search with full-text search. Embeddings are stored alongside relational data, then compared with a query embedding at runtime. pgvectorscale is presented as an intermediate scaling option before adopting a dedicated vector database.

## Takeaways

- HNSW favors faster queries but uses more memory, while IVFFlat is more memory-efficient and relies on clustering through a training step.
- pgvector supports filtered and hybrid retrieval, allowing semantic similarity to be combined with relational constraints and Postgres full-text search.
- The source says performance can decline at very high vector counts, and Postgres lacks built-in sharding for vector workloads, making additional tooling or infrastructure relevant as systems grow.

**Tags:** [pgvector](https://yomu.fyi/topic/pgvector), [Postgres](https://yomu.fyi/topic/postgres), [Retrieval-Augmented Generation](https://yomu.fyi/topic/retrieval-augmented-generation), [Search](https://yomu.fyi/topic/search)

- Source: [Databricks](https://www.databricks.com/blog/what-is-pgvector)
- Source URL: https://www.databricks.com/blog/what-is-pgvector
- Ingested by Yomu: 2026-08-31T03:42:42.742Z

[Read original post](https://www.databricks.com/blog/what-is-pgvector)
