ag2tracer
Failure attribution on multi-agent traces. Given a conversation trace from a multi-agent system, ag2tracer identifies which agent made the decisive error and at which step.
Installation
pip install ag2tracer
Setup
Set at least one API key:
export OPENAI_API_KEY="your-openai-key"
export ANTHROPIC_API_KEY="your-anthropic-key" # optional
export GOOGLE_API_KEY="your-google-key" # optional
Web Interface
# Launch the web UI
ag2tracer launch
# Or run in background
ag2tracer launch --daemon
# Other commands
ag2tracer status # check if server is running
ag2tracer logs # view server logs
ag2tracer logs -f # follow logs
ag2tracer stop # stop the background server
Then open http://127.0.0.1:8500 to:
- Upload a trace JSON file (must contain a
historyfield) - Browse the conversation with a sliding-window viewer
- Select an attribution method and click Start
- View the failure-responsible agent and decisive error step
Python API
import json
from ag2tracer import all_at_once, step_by_step, binary_search
with open("trace.json") as f:
trace = json.load(f)
# Choose a method
result = all_at_once(trace, model="gpt-4o")
# result = step_by_step(trace, model="gpt-4o")
# result = binary_search(trace, model="gpt-4o")
print(f"Agent: {result.agent_name}")
print(f"Step: {result.step_number}")
print(f"Reason: {result.reason}")
Trace Format
A trace is a JSON object with a required history array:
{
"history": [
{"role": "assistant", "name": "Excel_Expert", "content": "..."},
{"role": "user", "name": "Computer_terminal", "content": "..."},
...
],
"question": "optional problem description",
"ground_truth": "optional expected answer"
}
Attribution Methods
| Method | Description | LLM Calls |
|---|---|---|
| All-at-Once | Feeds entire conversation to the LLM | 1 |
| Step-by-Step | Evaluates each step sequentially, stops at first error | Up to N |
| Binary Search | Recursively narrows down the error location | O(log N) |
License
MIT
Metadata
Release files for ag2tracer 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ag2tracer-0.1.1.tar.gz | 15.5 kB | Without provenance | Details for ag2tracer-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ag2tracer-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for ag2tracer-0.1.1-py3-none-any.whl |
Total release size: 31.5 kB
Release files / ag2tracer-0.1.1.tar.gz
| Download URL | ag2tracer-0.1.1.tar.gz |
|---|---|
| Size | 15.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d01afb08652c1833161b32988d6c4eed9d52daa8c9f3e40eea0cecbe82376ad9
|
|
BLAKE2b-256 checksum How to use checksums |
00fb813fb73a42de979b73d9566294d3c0674b66d86d1e61900a255deafd6f6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / ag2tracer-0.1.1-py3-none-any.whl
| Download URL | ag2tracer-0.1.1-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c79ed4101f8c9da685ae83186382d0221cd2f6cc507ed1c3e05fbcf96f773ec6
|
|
BLAKE2b-256 checksum How to use checksums |
8b5b1beed39458ebc57c240f704236647d7ffd5758189fc97b004a25939ab5ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for ag2tracer 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.