weave 0.54.1


pip install weave

  Latest version

Released: Nov 05, 2026


Meta
Author: Shawn Lewis, Tim Sweeney, Nick Peneranda, Jeff Raubitschek, Jamie Rasmussen, Griffin Tarpenning, Josiah Lee, Andrew Truong, Niall McQuay
Maintainer: W&B
Requires Python: >=3.10

Classifiers

Development Status
  • 4 - Beta

Environment
  • Web Environment

Framework
  • Flask
  • Jupyter

Intended Audience
  • Developers
  • Science/Research

License
  • OSI Approved :: Apache Software License

Operating System
  • OS Independent

Programming Language
  • Python

Topic
  • Database :: Front-Ends
  • Office/Business :: Financial :: Spreadsheet
  • Scientific/Engineering :: Information Analysis
  • Scientific/Engineering :: Visualization
  • Software Development :: Libraries :: Application Frameworks
  • Software Development :: Widget Sets

Weave by Weights & Biases

Open in Colab Stable Version Download Stats Github Checks

Weave is a toolkit for tracing and evaluating AI agents, built by Weights & Biases.

You can use Weave to:

  • Trace agents. Conversations, turns, LLM calls, and tool calls show up in the Agents tab.
  • Evaluate agents and LLM applications.
  • Trace functions with @weave.op when you want the Calls tab, not the Agents tab.

Documentation

Our documentation site can be found here.

Start here for agents:

  • Choose an agent integration — OpenAI Agents SDK, Claude Agent SDK, and Google ADK. weave.init() is enough for those SDKs.
  • Custom agents — wrap your own loop with start_conversation, start_turn, start_llm, and start_tool.

Prerequisites

Quick start: trace an agent

This example uses the OpenAI Agents SDK. The Python import is agents; the package name is openai-agents. Weave autopatches it after weave.init(). Traces land in the Agents tab, not the Calls tab.

pip install weave openai-agents requests
import asyncio
import requests
import weave
from agents import Agent, Runner, function_tool

weave.init("<your-team>/<your-project-name>")


@function_tool
def wikipedia_search(query: str) -> str:
    """Search Wikipedia for a topic and return its title and intro paragraph."""
    r = requests.get(
        "https://en.wikipedia.org/w/api.php",
        params={
            "action": "query",
            "generator": "search",
            "gsrsearch": query,
            "gsrlimit": 1,
            "prop": "extracts",
            "exintro": True,
            "explaintext": True,
            "format": "json",
        },
        headers={"User-Agent": "weave-demo"},
    ).json()
    page = next(iter(r["query"]["pages"].values()))
    return f"{page['title']}: {page['extract']}"


agent = Agent(
    name="Research assistant",
    instructions=(
        "You are a research assistant. Use the wikipedia_search tool to look up "
        "topics when needed, and cite the article titles you used."
    ),
    tools=[wikipedia_search],
)


async def main():
    history = []
    for question in [
        "Who founded Anthropic?",
        "What is Claude (the AI assistant)?",
        "Summarize what we discussed in one sentence.",
    ]:
        history.append({"role": "user", "content": question})
        print(f"USER: {question}")
        result = await Runner.run(agent, input=history)
        print(f"AGENT: {result.final_output}\n")
        history = result.to_input_list()


asyncio.run(main())

weave.init() prints a project URL. Open the Agents tab.

Claude Agent SDK works the same way: install the framework, call weave.init(), run the agent. For Google ADK, import google.adk before weave.init(). See Choose an agent integration.

Custom agents

If you are not using a supported agent SDK, wrap your own loop. This is the Conversation SDK, not the @weave.op path.

Use start_conversation, start_turn, and start_llm. In Python they are context managers and close on exceptions. start_session and Session still exist; they emit a DeprecationWarning. Do not use them in new code.

import weave

weave.init("<your-team>/<your-project-name>")

with weave.start_conversation(agent_name="research-bot"):
    with weave.start_turn(user_message="Who founded Anthropic?"):
        with weave.start_llm(model="gpt-4o-mini", provider_name="openai") as llm:
            llm.output("Anthropic was founded by former OpenAI researchers.")
            llm.record(
                usage=weave.Usage(input_tokens=12, output_tokens=9),
                response_model="gpt-4o-mini",
            )

Always pass provider_name. Weave does not infer it from the model name.

For a multi-turn loop with tools, see the custom agents quickstart.

Function tracing

@weave.op traces a function. Those traces land in the Calls tab, not the Agents tab. Use it for evaluations, scorers, and LLM calls that are not an agent loop.

Plain openai is also auto-traced into the Calls tab after weave.init(). @weave.op wraps the call in a parent function, so the OpenAI request sits under extract_fruit.

pip install weave openai
import json
import weave
from openai import OpenAI

weave.init("<your-team>/<your-project-name>")


@weave.op
def extract_fruit(sentence: str) -> dict:
    client = OpenAI()
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[
            {
                "role": "system",
                "content": (
                    "You will be provided with unstructured data, and your task is to parse "
                    "it into one JSON object with fruit, color and flavor as keys."
                ),
            },
            {"role": "user", "content": sentence},
        ],
        temperature=0.7,
        response_format={"type": "json_object"},
    )
    extracted = response.choices[0].message.content
    return json.loads(extracted)


extract_fruit(
    "There are many fruits that were found on the recently discovered planet Goocrux. "
    "There are neoskizzles that grow there, which are purple and taste like candy."
)

Contributing

Interested in pulling back the hood or contributing? Awesome, before you dive in, here's what you need to know.

We're in the process of 🧹 cleaning up 🧹. This codebase contains a large amount code for the "Weave engine" and "Weave boards", which we've put on pause as we focus on Tracing and Evaluations.

The Weave Tracing code is mostly in weave/trace. The trace server it talks to is developed in wandb/core.

The Weave Evaluations code is mostly in weave/flow.

0.54.1 Nov 05, 2026
0.54.0 Oct 23, 2026
0.53.13 Oct 22, 2026
0.53.12 Oct 09, 2026
0.53.11 Sep 25, 2026
0.53.10 Sep 24, 2026
0.53.9 Sep 10, 2026
0.53.8 Sep 03, 2026
0.53.7 Aug 27, 2026
0.53.6 Aug 13, 2026
0.53.4 Jul 30, 2026
0.53.3 Jul 27, 2026
0.53.2 Jul 16, 2026
0.53.1 Jul 02, 2026
0.53.0 Jun 30, 2026
0.52.43 Jun 15, 2026
0.52.42 Jun 02, 2026
0.52.41 May 19, 2026
0.52.40 May 14, 2026
0.52.39 May 11, 2026
0.52.38 Apr 29, 2026
0.52.37 Apr 17, 2026
0.52.36 Apr 01, 2026
0.52.35 Mar 19, 2026
0.52.33 Mar 12, 2026
0.52.31 Mar 10, 2026
0.52.30 Mar 04, 2026
0.52.29 Feb 26, 2026
0.52.28 Feb 14, 2026
0.52.27 Feb 13, 2026
0.52.26 Feb 03, 2026
0.52.25 Jan 20, 2026
0.52.24 Jan 15, 2026
0.52.23 Jan 08, 2026
0.52.22 Dec 04, 2025
0.52.20 Nov 26, 2025
0.52.17 Nov 13, 2025
0.52.16 Nov 07, 2025
0.52.15 Nov 06, 2025
0.52.14 Oct 31, 2025
0.52.11 Oct 23, 2025
0.52.10 Oct 16, 2025
0.52.9 Oct 10, 2025
0.52.8 Sep 17, 2025
0.52.7 Sep 12, 2025
0.52.6 Sep 04, 2025
0.52.5 Aug 28, 2025
0.52.4 Aug 23, 2025
0.52.3 Aug 23, 2025
0.52.2 Aug 22, 2025
0.52.1 Aug 19, 2025
0.51.59 Jul 25, 2025
0.51.56 Jul 10, 2025
0.51.55 Jul 09, 2025
0.51.54 Jun 16, 2025
0.51.53 Jun 11, 2025
0.51.52 Jun 11, 2025
0.51.51 Jun 05, 2025
0.51.50 Jun 02, 2025
0.51.49 May 28, 2025
0.51.48 May 23, 2025
0.51.47 May 15, 2025
0.51.46 May 09, 2025
0.51.45 May 07, 2025
0.51.44 Apr 24, 2025
0.51.43 Apr 18, 2025
0.51.42 Apr 08, 2025
0.51.41 Apr 03, 2025
0.51.39 Mar 24, 2025
0.51.38 Mar 21, 2025
0.51.37 Mar 17, 2025
0.51.36 Mar 06, 2025
0.51.35 Feb 25, 2025
0.51.34 Feb 20, 2025
0.51.33 Feb 05, 2025
0.51.32 Jan 29, 2025
0.51.31 Jan 24, 2025
0.51.30 Jan 22, 2025
0.51.29 Jan 17, 2025
0.51.28 Jan 14, 2025
0.51.27 Jan 03, 2025
0.51.25 Dec 17, 2024
0.51.24 Dec 11, 2024
0.51.23 Dec 03, 2024
0.51.22 Nov 21, 2024
0.51.21 Nov 20, 2024
0.51.20 Nov 19, 2024
0.51.19 Nov 04, 2024
0.51.18 Nov 01, 2024
0.51.17 Oct 17, 2024
0.51.16 Oct 16, 2024
0.51.14 Oct 09, 2024
0.51.12 Sep 30, 2024
0.51.10 Sep 26, 2024
0.51.9 Sep 25, 2024
0.51.8 Sep 20, 2024
0.51.7 Sep 16, 2024
0.51.6 Sep 12, 2024
0.51.5 Sep 11, 2024
0.51.2 Sep 04, 2024
0.51.1 Aug 29, 2024
0.51.0 Aug 29, 2024
0.50.15 Aug 27, 2024
0.50.14 Aug 13, 2024
0.50.13 Aug 02, 2024
0.50.12 Jul 25, 2024
0.50.11 Jul 19, 2024
0.50.10 Jul 16, 2024
0.50.9 Jul 11, 2024
0.50.8 Jul 10, 2024
0.50.7 Jul 01, 2024
0.50.6 Jun 26, 2024
0.50.5 Jun 17, 2024
0.50.4 Jun 17, 2024
0.50.3 May 21, 2024
0.50.2 May 02, 2024
0.50.1 Apr 12, 2024
0.50.0 Apr 04, 2024
0.49.0 Apr 03, 2024
0.48.0 Apr 03, 2024
0.47.0 Apr 02, 2024
0.46.0 Mar 29, 2024
0.45.0 Mar 28, 2024
0.44.0 Mar 26, 2024
0.43.0 Mar 23, 2024
0.42.0 Mar 12, 2024
0.41.0 Mar 07, 2024
0.40.0 Feb 29, 2024
0.39.0 Feb 20, 2024
0.38.0 Feb 13, 2024
0.37.0 Feb 07, 2024
0.36.0 Feb 06, 2024
0.35.0 Feb 01, 2024
0.34.0 Jan 23, 2024
0.33.0 Jan 11, 2024
0.32.0 Jan 08, 2024
0.31.0 Dec 19, 2023
0.30.0 Oct 09, 2023
0.29.0 Oct 04, 2023
0.28.0 Sep 21, 2023
0.27.0 Sep 06, 2023
0.26.0 Aug 23, 2023
0.25.0 Aug 14, 2023
0.24.1 Jul 25, 2023
0.24.0 Jul 24, 2023
0.23.0 Jul 18, 2023
0.22.0 Jun 30, 2023
0.21.0 Jun 30, 2023
0.20.0 Jun 07, 2023
0.20.0.dev2 Jun 07, 2023
0.20.0.dev1 Jun 07, 2023

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
cachetools (>=6.2.4)
click
diskcache-weave (==5.6.3.post1)
distro (<2,>=1.7.0)
gql[httpx] (>=3.0.0)
jsonschema (>=4.23.0)
opentelemetry-api (>=1.28.0)
opentelemetry-exporter-otlp-proto-http (>=1.28.0)
opentelemetry-sdk (>=1.28.0)
packaging (>=21.0)
polyfile-weave (>=0.5.9)
pydantic (>=2.0.0)
requests (>=2.32.0)
sentry-sdk (<3.0.0,>=2.0.0)
sniffio
tenacity (!=8.4.0,>=8.3.0)
tzdata