feat(weave): add AG2 (formerly AutoGen) tracing integration#6370
Open
VasiliyRad wants to merge 5 commits intowandb:masterfrom
Open
feat(weave): add AG2 (formerly AutoGen) tracing integration#6370VasiliyRad wants to merge 5 commits intowandb:masterfrom
VasiliyRad wants to merge 5 commits intowandb:masterfrom
Conversation
|
This PR requires manual approval from a wandb user to run all CI checks. To see the current diff, click here. To approve CI for this PR as of this commit, comment: |
Contributor
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
|
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=0526087fdea46ee54f0c0a60cf4ceff71a40fbae |
andrewtruong
requested changes
Mar 17, 2026
Collaborator
andrewtruong
left a comment
There was a problem hiding this comment.
Hey @VasiliyRad thanks for the PR. This PR seems mostly fine
You'll also need to:
- Add an extra for this in pyproject.toml;
- Generate the cassettes for your tests;
Author
Done — added ag2 extra and ag2_tests dependency group in pyproject.toml. Cassettes recorded and included |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add AG2 (formerly AutoGen) tracing integration
Weave traces conversations for several agent frameworks but not AG2. AG2 is the community-driven fork of Microsoft AutoGen, one of the most downloaded multi-agent orchestration frameworks on PyPI. This is a separate integration from the existing autogen integration, which targets Microsoft's autogen-agentchat v0.5+ — the two projects have diverged in API.
This PR patches four AG2 methods to capture nested traces of agent conversations and LLM calls, using the same
SymbolPatcher pattern as the CrewAI integration.
Changes
weave/integrations/ag2/— patcher module with inputsanitizers for chat and LLM inputs
weave/integrations/patch.py—patch_ag2()function andimport-based dispatcher that routes to the correct patcher
depending on whether AG2 or Microsoft AutoGen is installed
weave/integrations/__init__.py— exportpatch_ag2weave/trace/autopatch.py—ag2field inAutopatchSettingstests/integrations/ag2/— two-agent with tool use,three-agent group chat (VCR cassettes needs to be generated
before merge)