Skip to content
Back to search

weave

Weave is a toolkit for developing AI-powered applications, built by Weights & Biases.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/wandb/weave with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/wandb/weave'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/wandb--weave/badge.svg)](/listings/wandb--weave)

HTML

<a href="/listings/wandb--weave"><img src="/api/listings/wandb--weave/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

1. **Install Weave**:

   pip install weave

2. **Import and initialize**:

   import weave
   weave.init("my-project-name")

3. **Trace your functions**:

   @weave.op
   def my_function():
       # Your tracked code!
       pass

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 181 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # **Weave by Weights & Biases**
  2. [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](http://wandb.me/weave_colab)
  3. [![Stable Version](https://img.shields.io/pypi/v/weave?color=green)](https://pypi.org/project/weave)
  4. [![Download Stats](https://img.shields.io/pypi/dm/weave)](https://pypistats.org/packages/weave)
  5. [![Github Checks](https://img.shields.io/github/check-runs/wandb/weave/master
  6. )](https://github.com/wandb/weave)
  7. Weave is a toolkit for tracing and evaluating AI agents, built by [Weights & Biases](https://wandb.ai/).
  8. You can use Weave to:
  9. - **Trace agents.** Conversations, turns, LLM calls, and tool calls show up in the Agents tab.
  10. - **Evaluate** agents and LLM applications.
  11. - **Trace functions** with `@weave.op` when you want the Calls tab, not the Agents tab.
  12. ## Documentation
  13. Our documentation site can be found [here](https://wandb.me/weave).
  14. Start here for agents:
  15. - [Choose an agent integration](https://docs.wandb.ai/weave/agent-integration-quickstart) — OpenAI Agents SDK, Claude Agent SDK, and Google ADK. `weave.init()` is enough for those SDKs.
  16. - [Custom agents](https://docs.wandb.ai/weave/custom-agents-quickstart) — wrap your own loop with `start_conversation`, `start_turn`, `start_llm`, and `start_tool`.
  17. ## Prerequisites
  18. - Python 3.10 or higher
  19. - A [Weights & Biases account](https://wandb.ai/signup) (free tier available)
  20. - A W&B API key from [https://wandb.ai/authorize](https://wandb.ai/authorize). Set `WANDB_API_KEY`.
  21. - An [OpenAI API key](https://platform.openai.com/api-keys) in `OPENAI_API_KEY`, for the example below.
  22. ## Quick start: trace an agent
  23. This example uses the [OpenAI Agents SDK](https://docs.wandb.ai/weave/guides/integrations/agents/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.
  24. ```bash
  25. pip install weave openai-agents requests
  26. ```
  27. ```python
  28. import asyncio
  29. import requests
  30. import weave
  31. from agents import Agent, Runner, function_tool
  32. weave.init("<your-team>/<your-project-name>")
  33. @function_tool
  34. def wikipedia_search(query: str) -> str:
  35. """Search Wikipedia for a topic and return its title and intro paragraph."""
  36. r = requests.get(
  37. "https://en.wikipedia.org/w/api.php",
  38. params={
  39. "action": "query",
  40. "generator": "search",
  41. "gsrsearch": query,
  42. "gsrlimit": 1,
  43. "prop": "extracts",
  44. "exintro": True,
  45. "explaintext": True,
  46. "format": "json",
  47. },
  48. headers={"User-Agent": "weave-demo"},
  49. ).json()
  50. page = next(iter(r["query"]["pages"].values()))
  51. return f"{page['title']}: {page['extract']}"
  52. agent = Agent(
  53. name="Research assistant",
  54. instructions=(
  55. "You are a research assistant. Use the wikipedia_search tool to look up "
  56. "topics when needed, and cite the article titles you used."
  57. ),
  58. tools=[wikipedia_search],
  59. )
  60. async def main():
  61. history = []
  62. for question in [
  63. "Who founded Anthropic?",
  64. "What is Claude (the AI assistant)?",
  65. "Summarize what we discussed in one sentence.",
  66. ]:
  67. history.append({"role": "user", "content": question})
  68. print(f"USER: {question}")
  69. result = await Runner.run(agent, input=history)
  70. print(f"AGENT: {result.final_output}\n")
  71. history = result.to_input_list()
  72. asyncio.run(main())
  73. ```
  74. `weave.init()` prints a project URL. Open the **Agents** tab.
  75. 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](https://docs.wandb.ai/weave/agent-integration-quickstart).
  76. ## Custom agents
  77. If you are not using a supported agent SDK, wrap your own loop. This is the Conversation SDK, not the `@weave.op` path.
  78. 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.
  79. ```python
  80. import weave
  81. weave.init("<your-team>/<your-project-name>")
  82. with weave.start_conversation(agent_name="research-bot"):
  83. with weave.start_turn(user_message="Who founded Anthropic?"):
  84. with weave.start_llm(model="gpt-4o-mini", provider_name="openai") as llm:
  85. llm.output("Anthropic was founded by former OpenAI researchers.")
  86. llm.record(
  87. usage=weave.Usage(input_tokens=12, output_tokens=9),
  88. response_model="gpt-4o-mini",
  89. )
  90. ```
  91. Always pass `provider_name`. Weave does not infer it from the model name.
  92. For a multi-turn loop with tools, see the [custom agents quickstart](https://docs.wandb.ai/weave/custom-agents-quickstart).
  93. ## Function tracing
  94. `@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.
  95. 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`.
  96. ```bash
  97. pip install weave openai
  98. ```
  99. ```python
  100. import json
  101. import weave
  102. from openai import OpenAI
  103. weave.init("<your-team>/<your-project-name>")
  104. @weave.op
  105. def extract_fruit(sentence: str) -> dict:
  106. client = OpenAI()
  107. response = client.chat.completions.create(
  108. model="gpt-4o-mini",
  109. messages=[
  110. {
  111. "role": "system",
  112. "content": (
  113. "You will be provided with unstructured data, and your task is to parse "
  114. "it into one JSON object with fruit, color and flavor as keys."
  115. ),
  116. },
  117. {"role": "user", "content": sentence},
  118. ],
  119. temperature=0.7,
  120. response_format={"type": "json_object"},
  121. )
  122. extracted = response.choices[0].message.content
  123. return json.loads(extracted)
  124. extract_fruit(
  125. "There are many fruits that were found on the recently discovered planet Goocrux. "
  126. "There are neoskizzles that grow there, which are purple and taste like candy."
  127. )
  128. ```
  129. ## Contributing
  130. Interested in pulling back the hood or contributing? Awesome, before you dive in, here's what you need to know.
  131. 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.
  132. The Weave Tracing code is mostly in `weave/trace`. The trace server it talks to is developed in wandb/core.
  133. The Weave Evaluations code is mostly in `weave/flow`.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.