What Is a Vector Database?
Vector databases store data as mathematical representations, enabling AI to find semantically similar content. The infrastructure behind modern AI search.
Key Takeaways
- A vector database stores data as numerical vectors (embeddings) rather than as text or structured records
- It enables similarity search — finding content that is semantically similar, not just keyword-matching
- Vector databases are the storage layer behind RAG systems and semantic search
- Pinecone, Weaviate, Chroma, and pgvector are common vector database options
What a vector database is
A vector database is a specialised database that stores data not as text or numbers in rows and columns, but as vectors — lists of floating-point numbers (embeddings) that represent the semantic meaning of the data. Two pieces of text with similar meaning will have similar vectors even if they use different words. This allows the database to find content that is conceptually similar rather than just keyword-matching.
What an embedding is
An embedding is a numerical representation of a piece of content — a word, a sentence, a product description, a customer review — produced by an AI model. The embedding captures the meaning of the content in a high-dimensional mathematical space. Similar meanings cluster together in this space. The word king and the word queen will have similar embeddings. A product description for running shoes will have a similar embedding to a customer query looking for jogging footwear.
Similarity search
Traditional databases search for exact matches or range conditions — find all records where city equals London. Vector databases search for similarity — find the 10 records whose embeddings are closest to this query embedding. This enables semantic search: a customer support bot that finds relevant documentation even when the user's question uses different words than the documentation. A product search that returns running shoes when a customer types athletic footwear.
How it fits into RAG
In a Retrieval-Augmented Generation (RAG) system, the knowledge base is typically stored in a vector database. When a user asks a question, the question is converted to an embedding and the vector database retrieves the document chunks with the most similar embeddings. These retrieved chunks are then passed to the language model to generate the answer. The vector database is what makes retrieval fast and semantically accurate at scale.
When you encounter vector databases
Most users encounter vector databases indirectly — through AI tools that use them under the hood. Semantic search in an eCommerce site, an AI customer service bot that finds relevant FAQ answers, or a document Q&A tool that answers questions from your business documents are all likely using vector databases. Understanding what they are helps you evaluate AI infrastructure choices and understand the capabilities and limits of AI search tools you might buy or build.