Generated banner for Weaviate Cookbooks
Generated logo for Weaviate Cookbooks

Weaviate Cookbooks

WeaviateOfficialPublished by Weaviate

  • Skill
  • Tool integration
  • Data and AI
  • BSD-3-Clause
  • Medium risk

From the author

Use 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.
— the description by Weaviate

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

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/weaviate/weaviate-cookbooks/download
  2. Unzip 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.

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

references/basic_agent.md

Basic Agent Cookbook

Build a tool-calling AI agent with structured outputs using DSPy. For RAG tools, memory, and framework integrations, see here.

Docs to reference if needed:

Core Rules

  • Use a virtual environment via venv

  • Use uv for Python project/dependency management.

  • Do not manually author pyproject.toml or uv.lock; let uv generate/update them.

  • Use this install set: uv add dspy python-dotenv

  • Customise this cookbook to the users specification, ask them for details if not given.

Env Rules

Mandatory:

  • An LLM provider API key (e.g. OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY)

  • WEAVIATE_URL

  • WEAVIATE_API_KEY

Optional:

  • Matching provider keys listed in environment_requirements.md

If the user explicitly requests a non-Weaviate agent, WEAVIATE_URL and WEAVIATE_API_KEY can be omitted.

Agent Response Signature

The structured output that defines what the LLM returns when selecting tools.

import dspy
from typing import Any, Dict

class AgentResponse(dspy.Signature):

    # Input Fields
    history: dspy.History = dspy.InputField()
    user_prompt: str = dspy.InputField()
    available_tools: str = dspy.InputField()

    # Output Fields
    response: str = dspy.OutputField(
        description="The response to the user's prompt whilst the tool is running. Update the user on the progress of their request (if a tool is picked), or the final response to the user (if no tool is picked)."
    )
    tool: str | None = dspy.OutputField(
        description="The tool that needs to be used. Return None if no tool is needed."
    )
    tool_inputs: Dict[str, Any] | None = dspy.OutputField(
        description=(
            "The inputs for the tool. Return an empty dictionary (still include the field) if no inputs are needed. "
            "The key is the name of the input, the value is the value of the input."
        )
    )

Extend AgentResponse as needed: add confidence: float for certainty scoring, requires_clarification: bool for follow-up questions, or modify description strings to shape agent behaviour for a specific domain.

Router Agent (Single Step)

Wraps the agent response into a class that manages conversation history and tool execution.

from typing import Callable, List, Tuple

class RouterAgent:
    def __init__(self, model: str, tools: List[Callable] = []):
        self.tools: list[Callable] = tools
        self.model = dspy.LM(model)
        self.agent = dspy.ChainOfThought(AgentResponse)
        self.conversation_history = dspy.History(messages=[])

    def add_conversation_history(self, message: str, response: dspy.Prediction):
        self.conversation_history.messages.append({"user_prompt": message, **response})

    def get_tools_and_descriptions(self) -> str:
        return "\n".join(
            [
                f"{tool.__name__}:\nDescription: {tool.__doc__ or ''}\nInputs: { {k: v for k, v in tool.__annotations__.items() if k != 'return'} }"
                for tool in self.tools
            ]
        )

    def get_response(self, user_prompt: str) -> Tuple[str, str | None]:
        result = self.agent(
            history=self.conversation_history,
            user_prompt=user_prompt,
            available_tools=self.get_tools_and_descriptions(),
            lm=self.model,
        )
        self.add_conversation_history(message=user_prompt, response=result)
        if result.tool and result.tool.lower() not in ["null", "none"]:
            tool_function = next(
                (tool for tool in self.tools if tool.__name__ == result.tool), None
            )
            if tool_function is None:
                raise ValueError(f"Tool {result.tool} not found")
            tool_inputs = {k: v for k, v in result.tool_inputs.items() if k != "return"}
            tool_result = tool_function(**tool_inputs)
        else:
            tool_result = None
        return result.response, tool_result

Usage:

router = RouterAgent(
    model="<model_name>",  # e.g. claude-sonnet-4-5, gpt-5.2, gemini-2.5-pro
    tools=[your_tool_function]
)
response, tool_result = router.get_response("user query here")

Tool Design

Tools are Python functions. The agent reads __name__, __doc__, and __annotations__ to decide when to use them.

def your_tool(param1: str, param2: int) -> str:
    """Clear description of what this tool does and when to use it."""
    # tool logic here
    return "result as string"

Key rules:

  • Docstrings directly influence when the agent selects the tool. Be specific: "Get current weather conditions for a city" is better than "Get weather".

  • Type hints guide what inputs the agent provides. Complex types like filters: List[Dict] may need additional description in the docstring.

  • Return strings or string-serializable data.

Sequential Multi-Step Agent

For tasks requiring multiple tool calls in succession, add a followup signature and loop.

Followup signature (receives tool_output from the previous step):

class AgentFollowup(dspy.Signature):

    # Input Fields
    history: dspy.History = dspy.InputField()
    user_prompt: str = dspy.InputField()
    tool_output: str = dspy.InputField(description="The output of the previous tool.")
    available_tools: str = dspy.InputField(
        description="The available tools and their descriptions."
    )

    # Output Fields
    response: str = dspy.OutputField(
        description="The response to the user's prompt whilst the tool is running. Update the user on the progress of their request (if a tool is picked), or the final response to the user (if no tool is picked)."
    )
    tool: str | None = dspy.OutputField(
        description="The tool that needs to be used. Return None if no tool is needed."
    )
    tool_inputs: Dict[str, Any] | None = dspy.OutputField(
        description="The inputs for the tool. Return an empty dictionary (still include the field) if no inputs are needed. The key is the name of the input, the value is the value of the input.",
    )

Modify RouterAgent to loop until the agent stops requesting tools:

class RouterAgent:
    def __init__(self, model: str, tools: List[Callable] = []):
        self.tools: list[Callable] = tools
        self.model = dspy.LM(model)
        self.agent = dspy.ChainOfThought(AgentResponse)
        self.followup_agent = dspy.ChainOfThought(AgentFollowup)
        self.conversation_history = dspy.History(messages=[])

    def add_conversation_history(self, message: str, response: dspy.Prediction):
        self.conversation_history.messages.append({"user_prompt": message, **response})

    def get_tools_and_descriptions(self) -> str:
        return "\n".join(
            [
                f"{tool.__name__}:\nDescription: {tool.__doc__ or ''}\nInputs: { {k: v for k, v in tool.__annotations__.items() if k != 'return'} }"
                for tool in self.tools
            ]
        )

    def get_response(self, user_prompt: str) -> str:
        result = self.agent(
            history=self.conversation_history,
            user_prompt=user_prompt,
            available_tools=self.get_tools_and_descriptions(),
            lm=self.model,
        )
        self.add_conversation_history(message=user_prompt, response=result)

        max_iter = 10
        iter = 0

        while result.tool is not None and result.tool.lower() not in ["null", "none"]:
            iter += 1
            if iter > max_iter:
                break

            tool_function = next(
                (tool for tool in self.tools if tool.__name__ == result.tool), None
            )
            if tool_function is None:
                raise ValueError(f"Tool {result.tool} not found")

            tool_inputs = {k: v for k, v in result.tool_inputs.items() if k != "return"}
            tool_result = tool_function(**tool_inputs)

            result = self.followup_agent(
                history=self.conversation_history,
                tool_output=tool_result,
                available_tools=self.get_tools_and_descriptions(),
                lm=self.model,
            )
            self.add_conversation_history(message=tool_result, response=result)

        return result.response

max_iter controls how many tool calls can occur before forced termination. Increase for complex multi-step tasks, decrease to limit costs and runaway loops.

User-specific Customisations

If not specified ask the user about these points before implementing their respective strategies:

LLM Framework

You can use DSPy (works with all LiteLLM providers) or LiteLLM itself.

Alternatively, users can use a single model provider. What model provider will they use?

These may require additional installs.

Model Selection

What model(s) will the user use? Consider a mixed approach: capable model for main agent routing, cheaper model for auxiliary tasks like memory creation.

Tools

What tools does the user need? List their functions, inputs, and expected outputs. The agent is only as capable as its tools.

Single-step vs Multi-step

Does the user need a single tool call per query, or should the agent chain multiple tools in sequence? Only use multi-step if the use case requires it.

Troubleshooting

  • DSPy signature warnings about missing fields: ensure all input fields are passed or mark optional fields appropriately.

  • Tool not found errors: ensure tool function names match exactly what the agent outputs.

  • Agent loops indefinitely: lower max_iter or add more explicit termination conditions.

  • For any other issues, refer to the official library/package documentation and use web search extensively for troubleshooting.

Done Criteria

  • Create test scripts to check each function works independently with test data. Tear down tests after completion, or create a proper test suite with pytest (requires install)

  • User has completed specification of the app.

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 or Weaviate.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download weaviate-cookbooks.zip