home/glossary/Vector Databases
Memory and Knowledge

Vector Databases

definition

Databases optimized for storing and searching over high-dimensional vector embeddings using similarity metrics like cosine distance, forming the backbone of most retrieval-augmented generation (RAG) systems. Vector databases enable semantic search that finds relevant documents based on meaning rather than exact keyword matches — allowing agents to query a codebase with "functions that handle authentication" rather than grep-style exact string searches.

Databases optimized for storing and searching over high-dimensional vector embeddings using similarity metrics like cosine distance, forming the backbone of most retrieval-augmented generation (RAG) systems. Vector databases enable semantic search that finds relevant documents based on meaning rather than exact keyword matches — allowing agents to query a codebase with "functions that handle authentication" rather than grep-style exact string searches. Key options include Pinecone, Weaviate, Chroma, Qdrant, and pgvector for Postgres, each with different trade-offs around managed vs self-hosted, scale, and query performance. Understanding vector databases is essential because they are the primary infrastructure for giving agents long-term memory and access to knowledge that doesn't fit within a single context window. This concept connects to embedding models for understanding how text is converted to vectors, RAG patterns for the retrieval architecture built on top of vector databases, and graph-vs-vector RAG for understanding when graph databases are a better choice.