Weaviate
Vector Database
An open-source vector database. Built-in ML models, GraphQL API, and hybrid search support.
Vector Database
An open-source vector database. Built-in ML models, GraphQL API, and hybrid search support.
Weaviate is an open-source vector database that originated in the Netherlands in 2019, designed for AI-native search and generative AI applications. Written in Go, it delivers high performance and supports both GraphQL and RESTful APIs. In particular, it has built-in vectorization modules, so it can automatically vectorize text and image data without a separate embedding pipeline.
Weaviate's key differentiator is its "modular architecture." Various vectorization modules such as text2vec-openai, text2vec-cohere, and img2vec-neural can be added like plugins, so you can choose the optimal embedding model according to the data type and purpose of use. In addition, it natively supports RAG (Retrieval-Augmented Generation) through the generative-openai module.
Technically, Weaviate supports vector indexing using the HNSW (Hierarchical Navigable Small World) algorithm, BM25-based keyword search, and hybrid search that combines the two. Through multi-tenancy, it can efficiently isolate the data of multiple users, and schema-based data modeling enables structured metadata filtering.
In practice, Weaviate can be self-hosted with Docker or Kubernetes, or used as a fully managed service through Weaviate Cloud (WCD). It is officially integrated with LangChain and LlamaIndex, which makes it easy to build RAG pipelines, and it is used in a variety of AI applications such as semantic search, Q&A systems, and recommendation engines.
import weaviate
from weaviate.classes.init import Auth
from weaviate.classes.config import Configure, Property, DataType
from weaviate.classes.query import MetadataQuery
# 1. Weaviate Cloud μ°κ²°
client = weaviate.connect_to_weaviate_cloud(
cluster_url="https://your-cluster.weaviate.network",
auth_credentials=Auth.api_key("your-weaviate-api-key"),
headers={"X-OpenAI-Api-Key": "your-openai-api-key"}
)
# 2. 컬λ μ
(μ€ν€λ§) μμ± - μλ 벑ν°ν μ€μ
collection = client.collections.create(
name="Document",
vectorizer_config=Configure.Vectorizer.text2vec_openai(
model="text-embedding-3-small"
),
generative_config=Configure.Generative.openai(
model="gpt-4o-mini"
),
properties=[
Property(name="title", data_type=DataType.TEXT),
Property(name="content", data_type=DataType.TEXT),
Property(name="category", data_type=DataType.TEXT)
]
)
# 3. λ°μ΄ν° μ½μ
(μλ 벑ν°ν)
documents = collection.data.insert_many([
{"title": "RAG κ°μ", "content": "RAGλ κ²μ μ¦κ° μμ±μ
λλ€.", "category": "llm"},
{"title": "Weaviate μκ°", "content": "Weaviateλ λ²‘ν° DBμ
λλ€.", "category": "database"},
{"title": "μλ² λ©μ΄λ", "content": "ν
μ€νΈλ₯Ό μ«μ 벑ν°λ‘ λ³νν©λλ€.", "category": "ml"}
])
print(f"μ½μ
λ λ¬Έμ μ: {len(documents.uuids)}")
# 4. μλ§¨ν± κ²μ (λ²‘ν° μ μ¬λ)
results = collection.query.near_text(
query="λ²‘ν° λ°μ΄ν°λ² μ΄μ€λ?",
limit=3,
return_metadata=MetadataQuery(distance=True)
)
print("\n=== μλ§¨ν± κ²μ κ²°κ³Ό ===")
for obj in results.objects:
print(f"- {obj.properties['title']} (거리: {obj.metadata.distance:.4f})")
# 5. νμ΄λΈλ¦¬λ κ²μ (λ²‘ν° + BM25)
hybrid_results = collection.query.hybrid(
query="λ²‘ν° DB",
alpha=0.5, # 0=BM25, 1=벑ν°κ²μ, 0.5=κ· ν
limit=3,
return_metadata=MetadataQuery(score=True)
)
print("\n=== νμ΄λΈλ¦¬λ κ²μ κ²°κ³Ό ===")
for obj in hybrid_results.objects:
print(f"- {obj.properties['title']} (μ μ: {obj.metadata.score:.4f})")
# 6. νν°λ§ κ²μ
from weaviate.classes.query import Filter
filtered = collection.query.near_text(
query="AI κΈ°μ ",
filters=Filter.by_property("category").equal("llm"),
limit=3
)
# 7. RAG: κ²μ + μμ± (Generative Search)
rag_result = collection.generate.near_text(
query="λ²‘ν° κ²μμ΄ λκ°μ?",
limit=2,
grouped_task="κ²μλ λ¬Έμλ₯Ό λ°νμΌλ‘ λ²‘ν° κ²μμ μ€λͺ
ν΄μ£ΌμΈμ."
)
print("\n=== RAG μλ΅ ===")
print(rag_result.generated)
# 8. μ°κ²° μ’
λ£
client.close()
Weaviate Cloud Pricing Plans as of October 2025 (New Pricing Model)
| Plan | Minimum Monthly Cost | Features | SLA |
|---|---|---|---|
| Free Trial | $0 (14 days) | Sandbox cluster, full feature trial | - |
| Shared Cloud (Flex) | From $45/month | High availability (HA) included by default, Pay-as-you-go | 99.5% |
| Shared Cloud (Plus) | Annual Contract | Commit discounts, backup/restore | 99.5% |
| Dedicated Cloud | Custom | Dedicated resources, private networking | 99.9% |
Billing Basis (from October 2025)
Self-Hosting Requirements
"We're evaluating Weaviate as the vector DB for our RAG system. It has built-in vectorization modules, so you can build it without a separate embedding server. It's open source, so self-hosting is also possible, and with hybrid search you can use keyword and semantic search together."
"What's the difference between Weaviate and Pinecone?" - "Pinecone is a fully managed SaaS, while Weaviate is open source and can be self-hosted. Weaviate's strengths are its built-in vectorization modules and GraphQL API, while Pinecone is easy to set up and has a low operational burden thanks to serverless."
"If you use Weaviate's generative-search module, you can generate LLM responses at the same time as searching. You can implement native RAG without LangChain, which simplifies the architecture."
Take a mock interview on this topic β WIA SOOM AI Interview Β· Start for free
If you don't set a vectorizer when creating a collection, you must provide vectors manually. You need to enable a module such as text2vec-openai in advance and include the API key in the header for automatic vectorization to work.
Once a collection is created, modifying its properties (Property) is restricted. In particular, if you change the vectorization target property later, it becomes incompatible with existing data. Decide on the schema carefully at the design stage.
Adjust the alpha value (0β1) of hybrid search to fit your data characteristics. It is effective to increase the weight of BM25 (alpha=0.3) when there is a lot of specialized terminology, and the weight of vector search (alpha=0.7) when there are many natural language queries.