Pgvector
pgvector is a PostgreSQL extension that adds vector data types, similarity operations, and indexes for storing and searching vector data.
Just Use Postgres!
pgvector is a PostgreSQL extension that adds vector data types and similarity search capabilities.
- How it is used
- Supports recommendation services, semantic search, clustering, and RAG by storing embeddings and finding related vectors.
- How deep it goes
- Explains setup, distance operators, and index choices, but stops short of detailed index configuration or deployment administration.
- Examples
- Uses a movie recommendation service, Docker commands, extension SQL, cosine distance, and Star Wars and Jurassic Park descriptions.
- What you can do after
- Operate/configure PostgreSQL with pgvector, store embeddings, run similarity searches, and choose HNSW or IVFFlat indexes.
Designing AI Systems
pgvector is a PostgreSQL extension that provides vector data types, similarity operators, and indexes for storing and querying embeddings.
- How it is used
- Provides a PostgreSQL backend for searchable organizational knowledge indexes.
- How deep it goes
- Works through a chunk schema, IVFFlat indexing, and a Python search method that translates the vector-store interface into SQL.
- Examples
- Illustrates a 1,536-dimensional chunk table and a filtered cosine-similarity query.
- What you can do after
- Apply it via PostgreSQL to store and retrieve embedded chunks with index and metadata filters.
Also covered in
What to know first
- similarity searchSimilarity search is a retrieval technique that finds or ranks items by their similarity to a query, often by comparing feature or vector representations under a similarity or distance measure.
- SQLSQL is a standardized declarative language for defining, querying, and manipulating data in relational database systems.
- embeddingAn embedding is a numerical vector representation of an item in a feature space, encoding selected properties or relationships for computational tasks such as comparison or retrieval.
- vector spaceA vector space is a set equipped with vector addition and scalar multiplication over a field that satisfy the vector-space axioms.
Related concepts
- PostgreSQLuses · PostgreSQL is an open-source object-relational database management system that stores and queries data using SQL and supports extensible data types and operations.
- database extensionkind of · A database extension is an installable software package that adds data types, functions, operators, indexes, or other capabilities to a database system.
- container imageimplemented by · A container image is a packaged filesystem and metadata artifact from which a container can be created and run.
- generative modelinguses · Generative modeling is a machine-learning approach that learns patterns or a data distribution to generate new samples resembling the data.
- HNSWuses · HNSW is a graph-based approximate nearest-neighbor indexing and search method that organizes data points in a hierarchy of navigable proximity graphs.
- ivfflatuses · IVFFlat is an approximate nearest-neighbor vector index that partitions vectors into centroid-based inverted lists and compares vectors within selected lists.
Questions about pgvector
What is pgvector?
pgvector is a PostgreSQL extension that adds vector data types, similarity operations, and indexes for storing and searching vector data.
Which Manning books explain pgvector?
Just Use Postgres! and Designing AI Systems.
What should I know before learning pgvector?
Manning books that teach pgvector usually introduce similarity search, SQL, embedding and vector space first.
What is pgvector a kind of?
Pgvector is a kind of database extension. A database extension is an installable software package that adds data types, functions, operators, indexes, or other capabilities to a database system.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

