Weaviate Cookbooks
WeaviateOfficialPublished by Weaviate
- Skill
- Tool integration
- Data and AI
- BSD-3-Clause
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The Weaviate Cookbooks skill serves as a central repository for developers building AI-powered applications using the Weaviate vector database. It provides structured guidance on architectural patterns, ranging from basic RAG implementations to complex agentic workflows. The skill emphasizes best practices for project setup, environment management, and integration, offering specific blueprints for chatbots, data explorers, and multimodal document search systems. It is designed to help developers scaffold full-stack applications efficiently by providing modular references and standardized implementation strategies.
What it does
- Provides architectural blueprints for building RAG and agentic systems.
- Offers standardized project setup and environment configuration guidelines.
- Includes specific implementation guides for chatbots, data explorers, and multimodal search.
- Provides best practices for using the Weaviate Python async client in production.
- Offers guidance on integrating frontend interfaces with Weaviate backends.
- Directs users to official resources for Weaviate Cloud instance management.
When to use it
- When you need to build an AI application powered by Weaviate.
- When you are looking for architectural patterns for RAG or agentic workflows.
- When you need to set up a new Weaviate-based project with industry best practices.
- When you need guidance on implementing advanced features like re-ranking or query decomposition.
- When you are building a frontend interface to interact with a Weaviate backend.
Advantages
- Reduces development time with ready-to-use architectural blueprints.
- Ensures consistent project structure and dependency management.
- Provides clear paths for scaling from basic RAG to advanced agentic systems.
- Offers modular, reference-based learning for specific Weaviate features.
- Promotes the use of modern development tools like uv for dependency management.
Usage examples
- “How do I build a basic RAG system with Weaviate?”
- The agent will provide the steps from the Basic RAG cookbook, including project setup, environment requirements, and the core retrieval logic.
- “I need to build an agent that uses RAG to answer questions. Where should I start?”
- The agent will guide you through the Agentic RAG cookbook, explaining how to implement naive RAG tools or hierarchical RAG with LLM-created filters.
- “How can I improve my RAG system's performance?”
- The agent will reference the Advanced RAG cookbook, suggesting techniques like query re-writing, decomposition, and re-ranking.
- “I want to build a frontend for my Weaviate data explorer.”
- The agent will provide the Frontend Interface reference, detailing how to connect a Next.js frontend to your Weaviate backend.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/weaviate/weaviate-cookbooks/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip weaviate-cookbooks.zip -d .agents/skills
Documentation by Weaviate
Weaviate Cookbooks
Overview
This skill provides an index of implementation guides and foundational requirements for building Weaviate-powered AI applications. Use the references to quickly scaffold full-stack applications with best practices for connection management, environment setup, and application architecture.
Weaviate Cloud Instance
If the user does not have an instance yet, direct them to the cloud console to register and create a free sandbox. Create a Weaviate instance via Weaviate Cloud.
Before Building Any Cookbook
Follow these shared guidelines before generating any cookbook app:
Then proceed to the specific cookbook reference below.
Cookbook Index
Query Agent Chatbot: Build a full-stack chatbot using Weaviate Query Agent with streaming and chat history support.
Data Explorer: Build a full-stack data explorer app including sorting, keyword search and tabular view of weaviate data.
Multimodal RAG: Building Document Search: Build a multimodal Retrieval-Augmented Generation (RAG) system using Weaviate Embeddings (ModernVBERT/colmodernvbert) and Ollama with Qwen3-VL for generation.
Basic RAG: Implement basic retrieval and generation with Weaviate. Useful for most forms of data retrieval from a Weaviate collection.
Advanced RAG: Improve on basic RAG by adding extra features such as re-ranking, query decomposition, query re-writing, LLM filter selection.
Basic Agent: Build a tool-calling AI agent with structured outputs using DSPy. Covers AgentResponse signatures, RouterAgent, tool design, and sequential multi-step loops.
Agentic RAG: Build RAG-powered AI agents with Weaviate. Covers naive RAG tools, hierarchical RAG with LLM-created filters, vector DB memory, Weaviate Query Agent, and Elysia integration.
Interface (Optional)
Use this when the user explicitly asks for a frontend for their Weaviate backend.
Frontend Interface: Build a Next.js frontend to interact with the Weaviate backend.
Client Usage
Async Client: Guide for using the Weaviate Python async client in production applications (FastAPI, async frameworks). Covers connection patterns, lifecycle management, common pitfalls, and multi-cluster setups.
Files
- ATTRIBUTION.mdAdded by AutoGineer874 B
- LICENSELicence file added by AutoGineer1.5 KiB
- SKILL.md3.1 KiB
- references/advanced_rag.md10.4 KiB
- references/agentic_rag.md13.3 KiB
- references/async_client.md14.6 KiB
- references/basic_agent.md10.3 KiB
- references/basic_rag.md6.3 KiB
- references/data_explorer.md11.3 KiB
- references/environment_requirements.md2.6 KiB
- references/frontend_interface.md4.7 KiB
- references/pdf_multimodal_rag.md19.7 KiB
- references/project_setup.md1.4 KiB
- references/query_agent_chatbot.md5.8 KiB
references/data_explorer.md
Build Data Explorer App
Overview
Build a full-stack Data Explorer App for Weaviate Collections with FastAPI.
Read first:
Search patterns and basics in Weaviate: https://docs.weaviate.io/weaviate/search/basics
Filters in Weaviate: https://docs.weaviate.io/weaviate/search/filters
Instructions
Core Rules
Use a virtual environment via
venvUse
uvfor Python project/dependency management.Do not manually author
pyproject.tomloruv.lock; letuvgenerate/update them.Use this backend install set:
uv add fastapi 'uvicorn[standard]' "weaviate-client>=4.23.1,<5" pydantic-settings python-dotenv
Depending on user request: consider combining this app with the Query Agent Chatbot.
If the user explicitly only wants a data viewer/explorer, create this app independently
If the user wants a fully featured chat and data explorer, combine the apps
If no explicit instructions are given, ask the user their preference before continuing
See the Next Steps section for more details
Fast Setup Commands
Project bootstrap:
uv init data_explorer
cd data_explorer
uv venv
uv add fastapi 'uvicorn[standard]' "weaviate-client>=4.23.1,<5" pydantic-settings python-dotenvWorkflow Contract
Build backend and frontend in one pass.
Create
.envfrom the canonical template inenvironment_requirements.md, then add app-specific fields (for example,CORS_ORIGINS).Before asking user to fill env, do non-secret local sanity checks that do not require real credentials (imports/compile/startup-shape checks).
Ask user to fill real env values:
Mandatory:
WEAVIATE_URL,WEAVIATE_API_KEYOptional: only provider keys required by their collection setup
After the user confirms, verify backend starts without errors and provide exact commands to run in the terminal.
Do not ask avoidable questions that you can resolve from context.
Directory Structure
Use a modular layout like:
data_explorer/
backend/
app/
main.py
config.py
lifespan.py
dependencies.py
routers/
services/
models/
.env # local file, never committedKeep these boundaries:
routers: HTTP only
services: business/query-agent logic
models: request/response schemas
config/lifespan: wiring and startup/shutdown
Backend Requirements
FastAPI async app with lifespan.
Async Weaviate client initialized in lifespan and closed on shutdown.
Ensure no async blocking operations.
Not a full CRUD implementation - this is only for viewing data in a Weaviate collection.
Endpoints for:
GET /healthGET /env_check: returns what API keys are missing (if any) for verification on app startGET /collections: return available collectionsGET /data/{collection_name}?xx=xx&yy=yy: return data with optional arguments (more later), and pagination
Pydantic settings should read from process environment; local
.envloading is optional for local development.Conversation history mapping to Weaviate chat message format.
Env Rules
Mandatory:
WEAVIATE_URLWEAVIATE_API_KEY
External provider keys:
Include every provider key needed by the target collections.
Leave unused provider keys empty/commented.
CORS:
Default
CORS_ORIGINSshould include:http://localhost:3000http://127.0.0.1:3000http://localhost:5173http://127.0.0.1:5173
FastAPI standards
Do not use hardcoded status values, use
statusfrom FastAPI, for example:
from fastapi import status
status.HTTP_200_OK # code 200
status.HTTP_404_NOT_FOUND # code 404
# and moreUse a Pydantic
BaseModelfor therequestandresponse_modelin all endpoints that require it. Ensure schema validation to mitigate user-error on the API.Use path parameters and query parameters for GET endpoints instead of payloads, for example:
@app.get("/items/{item_id}")
async def read_item(item_id: str):
return {"item_id": item_id}@app.get("/items/")
async def read_item(skip: int = 0, limit: int = 10):
return fake_items_db[skip : skip + limit]Implement best practices for error-handling, do early returns and provide the correct status codes when necessary.
Use proper logging for API usage, not simple print statements.
FastAPI endpoints
Basic structure of endpoints. Customise according to user preference or suitability. Do not follow exactly, this is a guideline only.
Ensure you also set up standard FastAPI procedures, such as global error handling, logging, dependencies. Set up an async client manager that connects on startup (via lifespan) and closes gracefully on app exit, use a dependency injection to add the client to the relevant endpoints.
GET /health
This is a standard health check. For example:
from pydantic import BaseModel
class HealthResponse(BaseModel):
status: str
@app.get("/health", tags=["health"], response_model=HealthResponse)
async def health_check() -> HealthResponse:
logger.info("Health check requested")
return HealthResponse(status="healthy")GET /env_check
Check what environment variables the backend has access to, used to verify the user's Weaviate configuration is correct. For example:
import os
from pydantic import BaseModel
class EnvCheckResponse(BaseModel):
weaviate_url: bool
weaviate_api_key: bool
@app.get("/env_check", tags=["health"])
async def env_check() -> EnvCheckResponse:
logger.info("Environment check requested")
return EnvCheckResponse(
weaviate_url = os.getenv("WEAVIATE_URL") is not None,
weaviate_api_key = os.getenv("WEAVIATE_API_KEY") is not None,
)GET /collections
Check what collections are available. For example:
from pydantic import BaseModel
from weaviate.client import WeaviateAsyncClient
class CollectionsResponse(BaseModel):
collections: list[str]
@app.get("/collections", tags=["collections"])
async def collections() -> CollectionsResponse:
# include client management to import async client here
logger.info("Collections requested")
collections = await client.collections.list_all()
return CollectionsResponse(
collections = list(collections.keys())
)Tip: consider expanding this endpoint to include collection descriptions and configs. await client.collections.list_all() returns dict[str, _CollectionConfigSimple] where _CollectionConfigSimple contains attributes:
description:strproperties:list[Property]wherePropertyhas.name,.descriptionand.data_type(accessed via.data_type[:]to get name of data type as string)vector_config:dict[str, _NamedVectorConfig]where_NamedVectorConfighas attribute.vectorizer.vectorizer(not a typo) which can be accessed via.vectorizer.vectorizer[:]to get the name of the vectoriser as a string.
Multi-tenancy should be checked via
config = await collection.config.get()
config.multi_tenancy_config.enabled # boolThis is not available in the _CollectionConfigSimple, it must be fetched from collection.config.get().
GET /data/{collection_name}
Retrieve data from a collection, using pagination, sorting and filters.
from weaviate.collections import CollectionAsync
from weaviate.classes.query import Sort
from fastapi import Query
from pydantic import BaseModel
from typing import Any
async def get_collection_data_types(collection: CollectionAsync) -> dict[str, str]:
config = await collection.config.get()
properties = config.properties
return {prop.name: prop.data_type[:] for prop in properties}
class GetDataResponse(BaseModel):
data_types: dict[str, str]
items: list[dict[str, Any]]
@router.post("/data/{collection_name}")
async def get_data(
collection_name: str,
page_size: int = Query(default=10, ge=1, le=100),
page_number: int = Query(default=1, ge=1),
query: str = Query(default=""),
sort_on: str = Query(default=None),
ascending: bool = Query(default=True),
) -> GetDataResponse:
# include client management to import async client here
collection = client.collections.use(collection_name)
data_types = await get_collection_data_types(collection)
if query != "":
response = await collection.query.bm25(
query=query,
limit=page_size,
offset=page_size * (page_number - 1),
)
elif sort_on is not None:
response = await collection.query.fetch_objects(
sort=Sort.by_property(name=sort_on, ascending=ascending),
limit=page_size,
offset=page_size * (page_number - 1),
)
else:
response = await collection.query.fetch_objects(
limit=page_size,
offset=page_size * (page_number - 1),
)
return GetDataResponse(data_types = data_types, items = [obj.properties for obj in response.objects])Tip: some collections can have multi-tenancy.
Consider adding the tenant as an optional query parameter to get_data, e.g.
async def get_data(
... # existing args
tenant: str | None = Query(default=None)
):
base_collection = client.collections.use(collection_name)
data_types = await get_collection_data_types(base_collection)
config = await base_collection.config.get()
if config.multi_tenancy_config.enabled and tenant and tenant.strip():
collection = base_collection.with_tenant(tenant)
else:
collection = base_collection
# ...existing codePost-Env Hand-Holding (Required)
After user says required env values are set, provide the terminal commands to run the backend:
cd data_explorer/backend
uv run uvicorn app.main:app --reload --host 127.0.0.1 --port 8000Then:
Ask user to start terminal.
Run smoke tests yourself against running services.
Report pass/fail in plain language and fix blockers.
Do not offload detailed testing steps to the user unless they explicitly ask.
Troubleshooting
Weaviate startup host errors: ensure
WEAVIATE_URLis fullhttps://...URL.For any other issues, refer to the official library/package documentation using web search.
Done Criteria
Backend healthy.
All endpoints work.
User can run server in terminal with provided commands.
Next Steps
This application is currently a data explorer backend. You may optionally offer to integrate it with the Query Agent Chatbot based on user preference.
If the user chooses to combine these two applications, implement the integration as follows:
Create or use a directory
/routeswhich separate functions for query agent chat and data exploration. Import the routers in themain.pyfileIf a frontend is requested, the frontend should have multiple pages/tabs depending on design choices so that data exploration and chat is separated
Consider crossovers between functionalities, e.g. a chat button from the data viewer/collection viewer which takes the user to chat with that collection selected.
Run quick tests to ensure the integration is seamless and the user can use both the chatbot and data explorer without any issues.
Frontend
When the user explicitly asks for a frontend, use this reference as guideline:
Frontend Interface: Build a Next.js frontend to interact with the Weaviate backend.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
What our scanner noticed· Medium risk
- Instructions that use the network
- Downloads piped into a shell
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Weaviate
- Publisher
- Weaviate (Official)
- Source
- weaviate/agent-skills · skills/weaviate-cookbooks · commit b19751c
- Licence
- BSD 3-Clause License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Weaviate.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download weaviate-cookbooks.zip