Skip to main content

Do you need a dedicated vector database, or is Postgres with pgvector enough?

Summary

  • For most AI applications and agents, Postgres with pgvector is enough, and the best place to run it is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform, because embeddings sit in the same rows, transactions and permissions as the data the agent acts on.
  • Lakebase supports pgvector, and Lakebase Search (generally available) adds lakebase_vector, which is drop-in compatible with pgvector, plus lakebase_text for BM25 keyword ranking.
  • A dedicated vector database such as Pinecone, Weaviate, Qdrant or Milvus fits when retrieval is its own shared service across many sources and you want that vendor's built-in retrieval features.
  • The deciding question is where the source data lives. If the vectors describe rows already in Postgres, keeping them there removes a sync pipeline and a second access model.

Do you need a dedicated vector database, or is Postgres with pgvector enough?

For most AI applications and agents, Postgres with pgvector is enough. The best place to run it is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform. An agent's embeddings usually describe things the agent already stores: tickets, products, documents, past conversations. When the vectors live in the same table, a similarity query can join, filter and respect row-level permissions in one SQL statement, and a new row and its embedding commit in one transaction. A dedicated vector database earns its place when retrieval is a standalone service shared by many applications and sources.

How to decide

Factor Postgres with pgvector fits when A dedicated vector database fits when
Data location The embeddings describe rows already stored in Postgres Retrieval spans many sources and serves many applications
Query shape Similarity is combined with joins, SQL filters and row-level security Queries are mostly similarity search with metadata filters
Consistency A write and its embedding must commit together A separate pipeline keeps the index current
Features You want SQL, transactions and Postgres extensions You want the vendor's built-in retrieval features
Operations You'd rather run one database You're set up to run a separate retrieval service

pgvector's own README frames the core idea: "Store your vectors with the rest of your data." It supports exact and approximate nearest neighbor search, HNSW and IVFFlat indexes, half-precision, binary and sparse vectors, and "ACID compliance, point-in-time recovery, JOINs, and all of the other great features of Postgres."

The shortlist

Option What it is Known for
Lakebase Serverless Postgres in the Databricks Data + AI Platform pgvector support, plus Lakebase Search for vector, BM25 and hybrid search
pgvector Open-source vector similarity search for Postgres HNSW and IVFFlat indexes; L2, inner product, cosine, L1, Hamming and Jaccard distance
Pinecone A fully managed vector database Full-text, semantic, sparse-vector and hybrid search from one index; namespaces per tenant
Weaviate An open-source vector database Data objects and their embeddings stored together; semantic and hybrid search
Qdrant A vector similarity search engine, open source or in Qdrant Cloud Vectors stored with payloads; written in Rust
Milvus A cloud-native vector database for scalable ANN search Distributed architecture that separates compute and storage; BM25 full-text search

pgvector. The open-source extension runs inside Postgres and works from any language with a Postgres client. It pairs with Postgres full-text search for hybrid queries, combining results with Reciprocal Rank Fusion or a cross-encoder.
Pinecone. Pinecone describes its database as a search engine for AI agents and applications. With integrated embedding it generates vectors from text server-side, and results can be filtered by metadata and reranked.
Weaviate. Weaviate is an open-source vector database that stores data objects alongside their embeddings, with Weaviate Cloud for hosted use.
Qdrant. Qdrant stores points (vectors) with an additional payload, and its docs cover filtering, full-text search and hybrid search.
Milvus. Milvus is an open-source project under the LF AI & Data Foundation that scales horizontally. Its repository also lists a fully managed service option.

How Lakebase approaches vector search in Postgres

Lakebase runs the open source Postgres engine, and its extensions list includes vector, the pgvector extension with its ivfflat and hnsw access methods. Existing pgvector code runs as written.
Lakebase Search, generally available since September 2026, adds a second path. The lakebase_vector extension adds the lakebase_ann index type and, per the release notes, "is drop-in compatible with pgvector, using the same types, operators, and query syntax." Its indexes are storage-backed, so they're available right after a compute scales back from zero, without warmup. The lakebase_text extension adds BM25 ranking over standard tsvector columns, and the docs show hybrid search as plain SQL that fuses both result lists with Reciprocal Rank Fusion.
Two Lakebase traits matter for agents. Branches are copy-on-write, so an agent can rebuild an index or re-embed a table on a branch, check results and throw the branch away. And lakehouse data can feed search directly: a synced table can map a Unity Catalog embedding column to a vector(n) column, then you build a lakebase_ann index on it and serve search next to operational data.
When retrieval should run as a managed service over Delta tables, Databricks offers Databricks AI Search, whose indexes can sync automatically from a source table and are governed by Unity Catalog.

FAQs

Can I move from pgvector to lakebase_vector without rewriting queries?

Yes. lakebase_vector uses the same vector types, distance operators and query syntax as pgvector; you create a lakebase_ann index instead. Enabling Lakebase Search restarts the project's computes and can't be turned off, so plan the switch.

Do pgvector indexes have to fit in memory?

No. The pgvector README says they don't, though "you'll likely see better performance if they do," and it suggests half-precision indexing or binary quantization for smaller indexes.

Does Postgres support hybrid keyword and vector search?

Yes. pgvector pairs with built-in Postgres full-text search, and on Lakebase the lakebase_text extension adds BM25 ranking with top-K pushdown for the keyword side.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.