Weaviate
The AI-Native Vector Database with Integrated RAG & Hybrid Search
What is Weaviate?
Weaviate is an open-source, AI-native vector database that stores both objects and their vector embeddings. Built in Go for speed and reliability, it combines vector search with structured filtering, offering the fault tolerance and scalability of a cloud-native database. Weaviate stands out with its modular architecture, GraphQL API, and integrated RAG capabilities.
Key Advantage: Weaviate integrates vectorization, search, and generative AI (RAG) in a single query, eliminating the need for external orchestration. Its modular system lets you plug in transformers, OpenAI, Cohere, and more without code changes.
Weaviate powers these AI scenarios:
Built-in Generative
Vector + Keyword
Text + Image
Knowledge Bases
Architecture Overview
Weaviate exposes REST API, gRPC API, and GraphQL API for flexible communication. Its modular design allows plugging in vectorizers, generative models, and rerankers seamlessly.
GraphQL API
Precise query control
Nested data, filters, certainty scores
Modular System
Plug-and-play modules
Vectorizers, generators, rerankers
HNSW + BM25
Dual indexing
Vector + keyword search combined
Core Concepts
Data Model
Weaviate organizes data into Collections (formerly Classes) containing Objects with properties and vectors:
Schema definition for objects
Data entity with properties
Auto-generated or imported
Typed fields for filtering
Example collection schema:
{
"class": "Article",
"vectorizer": "text2vec-openai",
"moduleConfig": {
"generative-openai": {"model": "gpt-4"}
},
"properties": [
{"name": "title", "dataType": ["text"]},
{"name": "content", "dataType": ["text"]},
{"name": "category", "dataType": ["text"]},
{"name": "publishedAt", "dataType": ["date"]}
]
}
Vectorizer Module
Automatically generates vectors at import time using configured models (OpenAI, Cohere, HuggingFace, etc.) or accepts pre-computed vectors.
Generative Module
Enables RAG directly in queries - search results are passed to an LLM for generation without external orchestration.
Hybrid Search
Weaviate's hybrid search combines vector search (semantic) with BM25F keyword search (lexical) and fuses the results for superior accuracy.
Performance: Hybrid search boosts NDCG@10 by up to 42% over pure vector search, which is critical for RAG applications where both semantic understanding and exact term matching matter.
Vector Search
HNSW-based nearest neighbor search for semantic similarity.
Keyword Search (BM25F)
Traditional full-text search with term frequency scoring.
Fusion Algorithm
Combines results with configurable alpha weighting (0=keyword, 1=vector).
Integrated RAG (Generative Search)
Weaviate combines retrieval and generation in a single query, making RAG workflows simpler and more efficient:
RAG Query Flow
Search Query
Vector/Hybrid/Keyword
Retrieve Results
Context from Weaviate
Generate Response
LLM with context
Example RAG query (GraphQL):
{
Get {
Article(
nearText: {concepts: ["machine learning trends"]}
limit: 3
) {
title
content
_additional {
generate(
singleResult: {
prompt: "Summarize this article in 2 sentences: {content}"
}
) {
singleResult
}
}
}
}
}
Module Ecosystem
Weaviate's modular design lets you configure vectorizers, generators, and rerankers via schema without code changes:
| Module Type | Examples | Purpose |
|---|---|---|
| Vectorizers (text2vec) | openai, cohere, huggingface, transformers | Generate embeddings from text |
| Vectorizers (img2vec) | neural, clip | Generate embeddings from images |
| Generative | openai, cohere, palm, anthropic | RAG response generation |
| Reranker | cohere, transformers | Re-score search results |
| QnA | qna-transformers, qna-openai | Direct question-answering |
Deployment Options
Docker (Self-Hosted)
Full control, local development
docker run -p 8080:8080 \ semitechnologies/weaviate
Weaviate Cloud
Fully managed, free tier available
console.weaviate.cloud - Zero maintenance
Kubernetes / Helm
Production clusters
Horizontal scaling, multi-tenancy
Getting Started
Python SDK Example
# Install: pip install weaviate-client
import weaviate
from weaviate.classes.config import Configure, Property, DataType
# Connect to Weaviate
client = weaviate.connect_to_local() # or connect_to_wcs() for cloud
# Create collection with vectorizer
client.collections.create(
name="Article",
vectorizer_config=Configure.Vectorizer.text2vec_openai(),
generative_config=Configure.Generative.openai(model="gpt-4"),
properties=[
Property(name="title", data_type=DataType.TEXT),
Property(name="content", data_type=DataType.TEXT),
Property(name="category", data_type=DataType.TEXT)
]
)
# Insert data (vectors generated automatically)
articles = client.collections.get("Article")
articles.data.insert({
"title": "Introduction to RAG",
"content": "RAG combines retrieval with generation...",
"category": "AI"
})
# Hybrid search
response = articles.query.hybrid(
query="machine learning applications",
alpha=0.5, # Balance between vector and keyword
limit=5
)
# RAG query (generative search)
response = articles.generate.near_text(
query="explain transformers",
single_prompt="Summarize: {content}",
limit=3
)
GraphQL Query Example
# Hybrid search with filtering
{
Get {
Article(
hybrid: {
query: "vector databases"
alpha: 0.75
}
where: {
path: ["category"]
operator: Equal
valueText: "AI"
}
limit: 5
) {
title
content
_additional {
score
certainty
}
}
}
}
Weaviate Ecosystem
Weaviate Database
Open-source vector database storing both objects and vectors.
Weaviate Cloud
Fully managed cloud deployment with automatic scaling.
Weaviate Agents
Pre-built agentic services for cloud users (query, transformation).
Weaviate Embeddings
Managed embedding inference service for seamless vectorization.
Weaviate vs Other Vector DBs
| Feature | Weaviate | Pinecone | Qdrant |
|---|---|---|---|
| Open Source | Yes (BSD-3) | No | Yes (Apache 2.0) |
| Built-in RAG | Yes (generative modules) | No (external) | No (external) |
| Auto Vectorization | Yes (modules) | Yes (integrated) | No (external) |
| GraphQL API | Yes | No | No |
| Language | Go | Unknown | Rust |
Integrations
Vector Store
Index Backend
Document Store
Embeddings & Gen
Embeddings & Rerank
Transformers
Claude Models
PaLM / Gemini
Use Cases
Semantic Search
RAG Applications
Q&A Chatbots
Enterprise Knowledge
Image Search
Recommendations
Learn More
Essential Resources
Related Topics
Test Your Knowledge
Score 8/10 or higher to pass
You need to be logged in to take this quiz.
Login to Continue