pgvector
Vector similarity search in PostgreSQL - where the data physically lives across heap, TOAST and index, how HNSW and IVFFlat retrieve it, and how pgvector serves as the memory layer in a RAG or agent system.
Read the pgvector guideConcepts it implements
Relevant documents are retrieved at query time and supplied as context, so the model answers from evidence rather than parametric memory.
Vector searchText or images are embedded as vectors and compared by distance, so results are ranked by similarity rather than keyword match.
Context windowThe fixed number of tokens a model can attend to on one request, shared between the system prompt, tools, retrieved documents, history and the answer itself.
EmbeddingA fixed-length vector that represents the meaning of a piece of text, image or other input, positioned so that similar items are nearby in the vector space.
Vector databaseA store optimised for indexing and querying high-dimensional vectors, used to find semantically similar items for RAG and other retrieval tasks.
Where pgvector sits
How this component relates to the rest of the stack. Items without a link are not covered here yet.