A vector database stores embeddings and allows us to search for data based on semantic similarity.
In a RAG system:
Documents → Embeddings → Vector Database → Retrieval → LLM
Two popular choices are ChromaDB and Weaviate.
ChromaDB is an open-source vector database that is simple and easy to use.
It can store documents, embeddings, and metadata, and can automatically generate embeddings when an embedding function is configured.
collection.add(documents=["This is a document."],ids=["1"])
It is a great choice for learning, prototypes, and small RAG applications.
Weaviate is also an open-source vector database. It stores objects together with their properties, metadata, and vectors.
It supports different types of search, including:
near_texthybridnear_objectThis makes Weaviate useful for applications such as RAG, recommendations, and semantic search.
| ChromaDB | Weaviate | |
|---|---|---|
| Easy to use | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
| Open source | ✅ | ✅ |
| Vector search | ✅ | ✅ |
| Semantic search | ✅ | ✅ |
| Hybrid search | — | ✅ |
| Local / Cloud | ✅ | ✅ |
| RAG | ✅ | ✅ |
For beginners and small RAG projects, ChromaDB is a simple choice.
For applications that need more advanced search capabilities and scalability, Weaviate is worth considering.
The important thing is to understand the overall RAG flow first:
Documents↓Chunking↓Embeddings↓ChromaDB / Weaviate↓Retrieve relevant chunks↓LLM↓Answer