Classic databases look for exact values: a customer number, a date, a word. A vector database looks for closeness. Each entry is an embedding, and the database calculates which stored vectors are most similar to the vector of the query.
How a vector database works
- Ingest: Documents are split into chunks and converted into embeddings.
- Store: Each vector is saved with metadata such as source, date and access rights.
- Search: The query is converted into a vector as well. Special index structures find the nearest neighbours without comparing every single entry.
- Filter: Metadata narrows the result, for example to documents a person is allowed to see.
Vector search is available as a standalone database or as an extension of existing systems such as relational databases.
Role in RAG
In RAG, the vector database is the memory: it supplies the passages a language model relies on for its answer. How good the answer is depends heavily on whether the search finds the right chunks.
Example
An IT service provider stores thousands of manual pages as vectors. When a technician asks “printer shows an error when scanning to a network drive”, the database returns the three most relevant sections, even if they talk about “scan-to-folder”.