remote engine and full-text search also need a server setting.
Quickstart
Install the extension and search a table with a native index.
Storage engines
The pgvector, native, and remote engines, and when to use each.
Switch from pgvector to native
Replace a table’s pgvector index with a native index.
Switch from native to remote
Switch a table to the remote engine when it outgrows one server.
How it works
pg_pinecone has three engines for a table’s vector search:pgvector: Uses pgvector’s own index, the same one you’d run without pg_pinecone.native: The default. Runs the search engine Pinecone uses at scale, inside your Postgres database. It doesn’t call Pinecone.remote: Runs the search on an index in Pinecone’s cloud instead, for a table that outgrows one server.
native and remote with one SQL call. Every switch can be reversed. Postgres keeps every row on every engine, including remote, so switching back rebuilds an index from data already in your database.
Architecture
- HNSW (Hierarchical Navigable Small World): A graph index in pgvector. Each vector links to its nearest neighbors, and a search follows those links toward the query.
- IVFFlat: A clustered index in pgvector. It groups vectors into lists and compares the query with the full vectors in the lists nearest to it.
- IVF + RaBitQ: How the
nativeengine searches. IVF (inverted file) groups vectors into clusters the same way, and RaBitQ stores each vector as a short binary code, so the index is small and quick to scan. The closest matches are then rechecked against the full vectors.
Features
- Filtered search: With a filter column, the
nativeengine applies a filter, such as a tenant ID, during the search, so filtered queries return a full set of results. It runs in your database without an account or network access. - Scale: The
remoteengine moves a table’s vector search to a Pinecone index, and Postgres keeps the rows. - Unchanged queries: A pgvector query like
ORDER BY embedding <=> $1works the same on every engine. - Tenant isolation: With the
remoteengine, each tenant can have its own Pinecone namespace, so a query searches only that tenant’s data. - Full-text search: pg_pinecone keeps a Pinecone index for full-text search in sync with a table’s text columns, and you run BM25, vector, or hybrid searches on it from SQL.
- SQL functions: You can generate embeddings and rerank results in SQL. See the SQL reference.
Choose your path
- New to vector search: The quickstart creates a table with embeddings and searches it with a
nativeindex. - Already using pgvector: Switch from pgvector to native.
- Outgrowing one server: Switch from native to remote, so Pinecone serves the table’s vector search.
- Leaving Postgres: Migrate from pgvector moves your data into Pinecone Database.