Vector Database
A specialized database optimized for storing and semantically searching vectors - numerical representations of text.
What is a vector database?
A vector database is a special type of database designed for storing and quickly searching vectors - numerical representations of text created by an embedding model. Unlike traditional databases that search for exact word matches, a vector database searches for similarity of meaning.
How vector databases work in RAG
- Indexing: Documents are split into chunks, converted to vectors, and stored in the database.
- Query: The user's question is also converted to a vector.
- Search: The database finds vectors (chunks) closest to the question vector.
- Result: The most relevant chunks are passed to the LLM to generate an answer.
Popular vector databases
- Pinecone - cloud-based, managed service
- Qdrant - open-source, self-hostable
- Weaviate - open-source with hybrid search
- Chroma - lightweight, ideal for local development