# Vector database

> Canonical: https://skillalmanac.com/glossary/vector-database | Last verified: 2026-11-25 | Index status: index-eligible

A vector database stores numerical vectors and supports similarity search over them. Vectors can be embeddings of text, images or other data. Exact search and approximate indexes offer different speed and recall tradeoffs; similarity is not a guarantee of relevance.

Also called: vector databases, vector db, vector store, vector search database.

## In plain language

A vector database stores lists of numbers and finds stored vectors close to a query vector under a chosen similarity or distance measure. An embedding model can turn documents and a question into those vectors; some database services provide that step, while others expect vectors from your application. A support application can use the results to find candidate articles, but the nearest match can still be irrelevant or stale.

## Technical definition

Vector stores support similarity queries over vectors, often alongside metadata filters. Exact search can compare candidates directly. Approximate indexes such as HNSW and IVFFlat trade some recall for speed. The pgvector extension for Postgres performs exact nearest-neighbor search by default; adding an approximate index changes that tradeoff. Embedding generation, storage, retrieval and answer generation are separate responsibilities even when one service combines them.

## How it shows up when you use agents

A vector database is usually invisible in a coding session, but it sits behind several agent features: a chat app that answers questions about uploaded files, a documentation assistant, and a notes store an agent searches for earlier decisions. When you connect one to an agent, for example through an MCP server, the agent gets a tool such as a search call. The application can use returned vector matches to select associated passages and add them to a model prompt. That retrieval-and-generation pipeline is one implementation of [retrieval-augmented generation](/glossary/retrieval-augmented-generation).

What breaks when it is misunderstood: people treat the database as the answer instead of a retrieval step. The model can still write a wrong answer from the right passages, or from the wrong ones if the index is stale. Others reach for a separate vector service for a small set of documents, when searching the files directly may do. Some products add vector search to a database you already run, as pgvector does for Postgres, which can be a smaller step.

Next actions. Before choosing a product, write down how many documents you have, how often they change and whether exact matches matter. Test retrieval on real questions before wiring in a model. Re-embed documents when they change, and check what any hosted service does with your data. The [embedding](/glossary/embedding) entry explains what is being stored.

## Common confusions

- **Vector search versus other database queries.** Similarity search ranks vectors using a chosen measure. Databases can also support structured filters, text search and other query types; Postgres with pgvector combines relational and vector features.
- **Vector database versus embedding.** The embedding is a stored vector. The database is the system that holds many of them and searches them quickly.
- **Vector database versus memory.** A database can serve as an [agent memory](/glossary/agent-memory) store, but memory also involves what to write, when to read it and when to forget. Storage alone does not decide that.
- **Myth.** Approximate search finds the true closest matches. pgvector's README says an approximate index trades some recall for speed and changes results compared with exact search.

## Worked examples in this catalogue

### [What Is RAG? Retrieval-Augmented Generation Explained](https://skillalmanac.com/learn/what-is-rag)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The guide explains that a RAG index holds chunk embeddings stored with their source metadata, and that edited documents keep returning old text until they are embedded again.

Why it exercises the concept: Document RAG is one use of a vector database. The guide describes a concrete failure: a stale index can keep returning old document content.

### [rag-chunking-planner](https://skillalmanac.com/skills/skill-almanac/rag-chunking-planner)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Your documents split by three chunking strategies, with defects and offline recall reported for each, so chunk settings are chosen with numbers.

Why it exercises the concept: In document RAG, a vector database can store chunk embeddings with associated text or metadata. Chunk boundaries affect retrieval candidates; this skill uses an offline lexical proxy before indexing, not a measured vector-database retrieval test.

### [library-docs-lookup](https://skillalmanac.com/skills/skill-almanac/library-docs-lookup)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: An answer to a library question drawn from the installed package's own files, with file and line cited.

Why it exercises the concept: It is a contrast case: a coding agent that retrieves from the files already on disk. It shows that retrieval does not always need a vector database.

## Related terms

- [Embedding](https://skillalmanac.com/glossary/embedding.md)
- [Retrieval-augmented generation (RAG)](https://skillalmanac.com/glossary/retrieval-augmented-generation.md)
- [Semantic search](https://skillalmanac.com/glossary/semantic-search.md)
- [Agent memory](https://skillalmanac.com/glossary/agent-memory.md)
- [Large language model (LLM)](https://skillalmanac.com/glossary/large-language-model.md)
- [Milvus](https://skillalmanac.com/glossary/milvus.md)
- [pgvector](https://skillalmanac.com/glossary/pgvector.md)
- [Pinecone (vector database)](https://skillalmanac.com/glossary/pinecone.md)
- [Qdrant](https://skillalmanac.com/glossary/qdrant.md)
- [Chroma (vector database)](https://skillalmanac.com/glossary/chroma-db.md)

## Sources

- [What Is a Vector Database?](https://www.ibm.com/think/topics/vector-database), IBM (accessed 2026-11-23)
- [Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs](https://arxiv.org/abs/1603.09320), arXiv (Malkov and Yashunin) (accessed 2026-11-23)
- [pgvector: open-source vector similarity search for Postgres](https://github.com/pgvector/pgvector), pgvector (GitHub) (accessed 2026-11-23)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
