/weaviate:weaviate-best-practicesfrom weaviate
Provides best practices for building, migrating, and scaling Weaviate vector databases including schema design, bulk ingestion, async indexing, hybrid search, and RAG patterns.
Ships in weaviate. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Example versions: Weaviate 1.40.7 and Python weaviate-client==4.24.1.
Examples use Python v4 with no Cloud or model-provider credentials. Load references only as needed:
data.ingest / batch.stream), pre-embedded vectors, async queue drain, local Compose example and LIMIT_RESOURCESexplain_score, cursors, local reranker/OllamaNot covered here: Cluster/ops configuration—including RBAC, OIDC/API-key user management, replication, backups, and cluster monitoring. Weaviate supports native RBAC and OIDC; consult the deployment & configuration docs or Hosted Docs MCP when you need them.
8080 and 50051; managed endpoints can differ. Do not add new GraphQL queries: the API is deprecated and scheduled for removal. Use SDK queries over gRPC. If gRPC is unavailable, check whether REST Search supports the operation on your server version. REST Search is a preview in 1.40.The snippets assume an open client. In a local script, run them inside with weaviate.connect_to_local() as client: so the client stays open through the last operation. articles = client.collections.use("Article") returns a lazy handle; use client.collections.exists("Article") if you need to check existence.
DEFAULT_VECTORIZER_MODULE. Always configure vectors per collection via vector_config=Configure.Vectors.*(...)—never legacy vectorizer_config / Configure.Vectorizer.AUTOSCHEMA_ENABLED=false. On DataType.TEXT, index_filterable and index_searchable default to True: use tokenization=Tokenization.FIELD for whole-value filters and set index_searchable=False only if the field is not used by BM25. index_range_filters defaults to False—explicitly set index_range_filters=True on scalar INT/NUMBER/DATE properties used in range filters.nomic-embed-text for embeddings. Other model integrations are available. Set api_endpoint and inference service URLs in trusted deployment configuration, never from end-user input.from weaviate.classes.config import Configure, DataType, Property, Tokenization
client.collections.create(
"Article",
vector_config=Configure.Vectors.text2vec_ollama(
name="body_vector",
api_endpoint="http://ollama:11434",
model="nomic-embed-text",
source_properties=["body"],
vector_index_config=Configure.VectorIndex.hnsw(
quantizer=Configure.VectorIndex.Quantizer.rq(bits=8),
),
),
properties=[
Property(name="body", data_type=DataType.TEXT),
Property(
name="article_key",
data_type=DataType.TEXT,
tokenization=Tokenization.FIELD,
index_searchable=False,
),
Property(
name="category",
data_type=DataType.TEXT,
tokenization=Tokenization.FIELD,
index_searchable=False,
),
Property(name="created_at", data_type=DataType.DATE, index_range_filters=True),
],
)
For the reranked query in §5, enable reranker-transformers and point RERANKER_INFERENCE_API at its sidecar. Add reranker_config=Configure.Reranker.transformers() to the creation call above, or configure an existing collection once during schema setup:
from weaviate.classes.config import Reconfigure
articles.config.update(reranker_config=Reconfigure.Reranker.transformers())
Flat for small collections/tenants; HNSW for fast in-RAM reads; HFresh (GA 1.38, disk postings + 1-bit RQ + 8-bit RQ centroids) when RAM is constrained and SSD I/O is available.DEFAULT_QUANTIZATION defaults to none; Weaviate Cloud Free tier enforces 1 collection and HFresh.ACORN is the default since 1.34. On 1.40+, benchmark PathSeer (VectorFilterStrategy.PATHSEER, switchable without reindexing) for heavy or low-selectivity filtered workloads.collection.data.ingest(iterable) for one-shot imports; check result.errors. For incremental writes, use collection.batch.stream(). Monitor batch.number_errors during the batch and read collection.batch.failed_objects after exit, before the next batch resets it. Run one batch workflow at a time per client.vector={"body_vector": vec}).ASYNC_INDEXING=true, wait for every expected shard replica to report loaded, READY, and an empty vector queue. Missing reports do not establish readiness.from weaviate.util import generate_uuid5
with articles.batch.stream() as batch:
for row in rows:
batch.add_object(
properties=row,
uuid=generate_uuid5(row["article_key"]),
# vector={"body_vector": vec}, # named dict for pre-embedded rows
)
failed = articles.batch.failed_objects
if failed:
raise RuntimeError(f"{len(failed)} writes failed: {failed[0].message}")
self_provided vector, the application supplies vector=query_embedding for similarity and the text query for BM25.The examples below are alternatives: the first fetches a page (offset + limit is bounded by QUERY_MAXIMUM_RESULTS); the second reranks 20 candidates and keeps six for RAG. Reranking or applying MMR independently to each page cannot compare candidates across pages.
from weaviate.classes.query import Filter, Rerank
eligible = Filter.by_property("category").equal("guides")
page = articles.query.hybrid(
text, target_vector="body_vector", filters=eligible, limit=10, offset=20
)
# Requires the collection reranker configured in §2.
passages = articles.query.hybrid(
question,
target_vector="body_vector",
filters=eligible,
limit=20,
rerank=Rerank(prop="body", query=question),
).objects[:6]
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
weaviate, vector-database, rag, hybrid-search, schema-design
3 skills in this plugin
/weaviateSearch, query, and manage Weaviate vector database collections. Use for semantic search, hybrid search, keyword search, natural language queries with AI-generated answers, collection management, data exploration, filtered fetching, data imports from PDF/CSV/JSON/JSONL files, create example data and collection creation./weaviate-cookbooksUse this skill when the user wants to build AI applications with Weaviate. It contains a high-level index of architectural patterns, 'one-shot' blueprints, and best practices for common use cases. Currently, it includes references for building a Query Agent Chatbot, Data Explorer, Multimodal PDF RAG (Document Search), Basic RAG, Advanced RAG, Basic Agent, Agentic RAG, and optional guidance on how to build a frontend for each of them.npx claudepluginhub weaviate/agent-skills --plugin weaviateOther plugins' skills for the same job