Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions weave.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,27 @@ Select your workload type and then use the following docs to guide you through t
</Tab>
</Tabs>

## Install Weave
## Automatically instrument Weave

W&B Weave provides Python and TypeScript libraries. To install the Weave library, run the following command:
To automatically instrument your agents to use Weave, update the following prompt with your project name and [W&B API key](https://wandb.ai/settings) environment variables, then pass the prompt to your agent:

<Tabs>
<Tab title="Python">
```bash
pip install weave
```
</Tab>
<Tab title="TypeScript">
```bash
npm install weave
```
</Tab>
</Tabs>
```text
Fetch and then use the following skill to instrument all agents with Weave:

https://raw.githubusercontent.com/wandb/weave/refs/heads/master/skills/weave-instrument/SKILL.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, curious why we're providing this 'raw' link instead of the actual repo https://github.com/wandb/weave/blob/master/skills/weave-instrument/SKILL.md?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the idea is to make it as easy as possible for the agent to ingest. This is Andrew's prompt that he designed and put in the Weave UI, so I was just copying the workflow he designed.


Project configuration:
WEAVE_PROJECT=$[YOUR-PROJECT-NAME]
WEAVE_API_KEY=$[WANDB-API-KEY]`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't think it'd be a good idea to pass an API key visibly through a prompt to an LLM?
What about if we told people to set these in their zshrc file instead, and then the prompt could extract it from there?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's what the $ symbol is kind of denoting here, right? Like echo $WANDB_API_KEY? And we mention that you should set these as env variables in the opening paragraph. Is there a better way here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, i thought that was setting an environment variable to the value, and that we were asking them to replace [WANDB-API-KEY] (since that's our replaceable format style) with the text of the key?

would we want the brackets on there if it is supposed to be reading from an en var that exists by that name?

also, confused why we're setting WEAVE_API_KEY? i checked the SKILL and it doesn't have this token

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like, the skill has an auth-related section, but says nothing about WEAVE_API_KEY:

  • Authentication is the user's job, not yours, so never handle their key. A W&B API key is a
    secret, and it must not enter your context or the repo. Tell the user to authenticate in their own
    terminal: set WANDB_API_KEY (from https://wandb.ai/authorize), or run wandb login (Python) or
    await weave.login(key) once (Node). You may check that a key is reachable (the env var is set,
    or ~/.netrc has an api.wandb.ai entry), but never read or print its value, and never write it
    into source code or into a committed .env.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i interpret that as these are the instructions we'd give the user up top:: "authenticate in your own
terminal: set WANDB_API_KEY (from https://wandb.ai/authorize), or run wandb login (Python) or
await weave.login(key) once (Node). "
and then that line gets removed from the prompt altogether?

@anastasiaguspan anastasiaguspan Aug 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WEAVE_PROJECT doesn't seem to be used by the skill either? (tho sounds like the skill will prompt for it itself)
maybe i'm just confused ;)

```

Your agent installs Weave's auto-instrumentation skill and uses it to:

1. Install the Weave package, authenticate with W&B, and add `weave.init("YOUR-TEAM-NAME/WEAVE_PROJECT")` to agent entry points.
1. Identify the codebase's language, LLM/agent libraries, agent's structure (loop, model calls, tool dispatch, sub-agents), and any existing OTel setup.
1. Help you structure your trace data and properly instrument your application.
1. Verify the configuration works by sending traces to your Weave project.

Once you've completed the configuration, your agents automatically start sending traces to Weave.

To start using the Weave library, create a [Weights & Biases (W&B) account](https://wandb.ai) and an [API key at User Settings](https://wandb.ai/settings). The API key allows you to authenticate to your W&B account and start sending data to it.
If you want to manually instrument an agent, see [Quickstart: Set up custom agent observability](/weave/custom-agents-quickstart).
Loading