agentpile 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. agentpile-0.1.0/CHANGELOG.md +22 -0
  2. agentpile-0.1.0/LICENSE +201 -0
  3. agentpile-0.1.0/MANIFEST.in +3 -0
  4. agentpile-0.1.0/PKG-INFO +283 -0
  5. agentpile-0.1.0/README.md +236 -0
  6. agentpile-0.1.0/pyproject.toml +66 -0
  7. agentpile-0.1.0/setup.cfg +4 -0
  8. agentpile-0.1.0/src/agentpile/__init__.py +88 -0
  9. agentpile-0.1.0/src/agentpile/_capture.py +561 -0
  10. agentpile-0.1.0/src/agentpile/_graph.py +139 -0
  11. agentpile-0.1.0/src/agentpile/_io.py +54 -0
  12. agentpile-0.1.0/src/agentpile/_send.py +83 -0
  13. agentpile-0.1.0/src/agentpile/_show.py +700 -0
  14. agentpile-0.1.0/src/agentpile/_tables.py +199 -0
  15. agentpile-0.1.0/src/agentpile/cache.py +77 -0
  16. agentpile-0.1.0/src/agentpile/corpora/__init__.py +1 -0
  17. agentpile-0.1.0/src/agentpile/corpora/_base.py +252 -0
  18. agentpile-0.1.0/src/agentpile/corpora/adp.py +316 -0
  19. agentpile-0.1.0/src/agentpile/corpora/agent_reward_bench.py +498 -0
  20. agentpile-0.1.0/src/agentpile/corpora/agentdojo.py +120 -0
  21. agentpile-0.1.0/src/agentpile/corpora/catchbench_pre.py +109 -0
  22. agentpile-0.1.0/src/agentpile/corpora/manifests/adp.json +667 -0
  23. agentpile-0.1.0/src/agentpile/corpora/manifests/agent_reward_bench.json +95 -0
  24. agentpile-0.1.0/src/agentpile/corpora/manifests/agentdojo.json +114 -0
  25. agentpile-0.1.0/src/agentpile/corpora/manifests/catchbench_pre.json +66 -0
  26. agentpile-0.1.0/src/agentpile/corpora/manifests/mast.json +109 -0
  27. agentpile-0.1.0/src/agentpile/corpora/manifests/swe_agent_nebius.json +58 -0
  28. agentpile-0.1.0/src/agentpile/corpora/manifests/swe_gym_openhands.json +72 -0
  29. agentpile-0.1.0/src/agentpile/corpora/manifests/swe_rebench_openhands.json +69 -0
  30. agentpile-0.1.0/src/agentpile/corpora/manifests/swe_smith.json +75 -0
  31. agentpile-0.1.0/src/agentpile/corpora/manifests/tau2_bench.json +69 -0
  32. agentpile-0.1.0/src/agentpile/corpora/manifests/tau_bench.json +73 -0
  33. agentpile-0.1.0/src/agentpile/corpora/manifests/trail.json +82 -0
  34. agentpile-0.1.0/src/agentpile/corpora/manifests/who_and_when.json +75 -0
  35. agentpile-0.1.0/src/agentpile/corpora/mast.py +94 -0
  36. agentpile-0.1.0/src/agentpile/corpora/swe_agent_nebius.py +134 -0
  37. agentpile-0.1.0/src/agentpile/corpora/swe_gym_openhands.py +194 -0
  38. agentpile-0.1.0/src/agentpile/corpora/swe_rebench_openhands.py +178 -0
  39. agentpile-0.1.0/src/agentpile/corpora/swe_smith.py +198 -0
  40. agentpile-0.1.0/src/agentpile/corpora/tau2_bench.py +164 -0
  41. agentpile-0.1.0/src/agentpile/corpora/tau_bench.py +140 -0
  42. agentpile-0.1.0/src/agentpile/corpora/trail.py +891 -0
  43. agentpile-0.1.0/src/agentpile/corpora/who_and_when.py +147 -0
  44. agentpile-0.1.0/src/agentpile/deps.py +654 -0
  45. agentpile-0.1.0/src/agentpile/errors.py +17 -0
  46. agentpile-0.1.0/src/agentpile/formats/__init__.py +1 -0
  47. agentpile-0.1.0/src/agentpile/formats/atif.py +43 -0
  48. agentpile-0.1.0/src/agentpile/formats/config.py +37 -0
  49. agentpile-0.1.0/src/agentpile/formats/jsonfile.py +14 -0
  50. agentpile-0.1.0/src/agentpile/formats/messages.py +431 -0
  51. agentpile-0.1.0/src/agentpile/formats/otlp.py +2211 -0
  52. agentpile-0.1.0/src/agentpile/formats/tools.py +334 -0
  53. agentpile-0.1.0/src/agentpile/integrations/__init__.py +51 -0
  54. agentpile-0.1.0/src/agentpile/integrations/_common.py +88 -0
  55. agentpile-0.1.0/src/agentpile/integrations/_otel.py +177 -0
  56. agentpile-0.1.0/src/agentpile/integrations/openai_agents.py +412 -0
  57. agentpile-0.1.0/src/agentpile/integrations/pydantic_ai.py +280 -0
  58. agentpile-0.1.0/src/agentpile/loading.py +74 -0
  59. agentpile-0.1.0/src/agentpile/record.py +354 -0
  60. agentpile-0.1.0/src/agentpile/registry.py +120 -0
  61. agentpile-0.1.0/src/agentpile/schemas/agentpile-v0.schema.json +200 -0
  62. agentpile-0.1.0/src/agentpile/validate.py +249 -0
  63. agentpile-0.1.0/src/agentpile.egg-info/PKG-INFO +283 -0
  64. agentpile-0.1.0/src/agentpile.egg-info/SOURCES.txt +183 -0
  65. agentpile-0.1.0/src/agentpile.egg-info/dependency_links.txt +1 -0
  66. agentpile-0.1.0/src/agentpile.egg-info/requires.txt +37 -0
  67. agentpile-0.1.0/src/agentpile.egg-info/top_level.txt +1 -0
  68. agentpile-0.1.0/tests/compat/__init__.py +1 -0
  69. agentpile-0.1.0/tests/compat/grade.py +408 -0
  70. agentpile-0.1.0/tests/corpora/fixtures/adp/agenttuning_alfworld/full_std.jsonl +2 -0
  71. agentpile-0.1.0/tests/corpora/fixtures/adp/agenttuning_db/full_std.jsonl +1 -0
  72. agentpile-0.1.0/tests/corpora/fixtures/adp/agenttuning_kg/full_std.jsonl +3 -0
  73. agentpile-0.1.0/tests/corpora/fixtures/adp/agenttuning_mind2web/full_std.jsonl +1 -0
  74. agentpile-0.1.0/tests/corpora/fixtures/adp/agenttuning_os/full_std.jsonl +1 -0
  75. agentpile-0.1.0/tests/corpora/fixtures/adp/agenttuning_webshop/full_std.jsonl +1 -0
  76. agentpile-0.1.0/tests/corpora/fixtures/adp/code_feedback/full_std.jsonl +1 -0
  77. agentpile-0.1.0/tests/corpora/fixtures/adp/codeactinstruct/full_std.jsonl +1 -0
  78. agentpile-0.1.0/tests/corpora/fixtures/adp/go-browse-wa/full_std.jsonl +1 -0
  79. agentpile-0.1.0/tests/corpora/fixtures/adp/nebius_SWE-agent-trajectories/full_std.jsonl +1 -0
  80. agentpile-0.1.0/tests/corpora/fixtures/adp/nnetnav-wa/full_std.jsonl +1 -0
  81. agentpile-0.1.0/tests/corpora/fixtures/adp/openhands/full_std.jsonl +1 -0
  82. agentpile-0.1.0/tests/corpora/fixtures/adp/swe-gym_openhands_sampled_trajectories/full_std.jsonl +1 -0
  83. agentpile-0.1.0/tests/corpora/fixtures/adp/synatra/full_std.jsonl +1 -0
  84. agentpile-0.1.0/tests/corpora/fixtures/agent_reward_bench/cleaned/assistantbench/GenericAgent-synth-llama/GenericAgent-synth-llama_on_assistantbench.improved.validation/assistantbench.improved.validation.0.json +38 -0
  85. agentpile-0.1.0/tests/corpora/fixtures/agent_reward_bench/cleaned/visualwebarena/GenericAgent-synth-gpt/GenericAgent-synth-gpt_on_visualwebarena.resized/visualwebarena.resized.5.json +191 -0
  86. agentpile-0.1.0/tests/corpora/fixtures/agent_reward_bench/cleaned/webarena/GenericAgent-synth-llama/GenericAgent-synth-llama_on_webarena/webarena.1.json +285 -0
  87. agentpile-0.1.0/tests/corpora/fixtures/agent_reward_bench/cleaned/webarena/GenericAgent-synth-llama/GenericAgent-synth-llama_on_webarena/webarena.2.json +454 -0
  88. agentpile-0.1.0/tests/corpora/fixtures/agent_reward_bench/cleaned/workarena/GenericAgent-synth-claude/GenericAgent-synth-claude_on_workarena.servicenow/workarena.servicenow.order-synth-laptop.json +169 -0
  89. agentpile-0.1.0/tests/corpora/fixtures/agent_reward_bench/data/annotations.csv +7 -0
  90. agentpile-0.1.0/tests/corpora/fixtures/agentdojo/model-a/banking/user_task_0/important_instructions/injection_task_0.json +103 -0
  91. agentpile-0.1.0/tests/corpora/fixtures/agentdojo/model-a/banking/user_task_0/none/none.json +45 -0
  92. agentpile-0.1.0/tests/corpora/fixtures/agentdojo/model-a/slack/user_task_1/important_instructions/injection_task_0.json +101 -0
  93. agentpile-0.1.0/tests/corpora/fixtures/catchbench_pre/data/pre/crewai.json +42 -0
  94. agentpile-0.1.0/tests/corpora/fixtures/catchbench_pre/data/pre/injecagent.json +38 -0
  95. agentpile-0.1.0/tests/corpora/fixtures/catchbench_pre/data/pre/mcp.json +41 -0
  96. agentpile-0.1.0/tests/corpora/fixtures/catchbench_pre/data/pre/n8n.json +1 -0
  97. agentpile-0.1.0/tests/corpora/fixtures/catchbench_pre/data/pre/sweagent.json +30 -0
  98. agentpile-0.1.0/tests/corpora/fixtures/catchbench_pre/data/pre/synthetic.json +30 -0
  99. agentpile-0.1.0/tests/corpora/fixtures/mast/MAD_full_dataset.json +1 -0
  100. agentpile-0.1.0/tests/corpora/fixtures/swe_agent_nebius/data/train-00000-of-00012.parquet +0 -0
  101. agentpile-0.1.0/tests/corpora/fixtures/swe_agent_nebius/data/train-00001-of-00012.parquet +0 -0
  102. agentpile-0.1.0/tests/corpora/fixtures/swe_agent_nebius/make_fixture.py +73 -0
  103. agentpile-0.1.0/tests/corpora/fixtures/swe_gym_openhands/data/train.raw-00000-of-00003.parquet +0 -0
  104. agentpile-0.1.0/tests/corpora/fixtures/swe_gym_openhands/data/train.raw-00001-of-00003.parquet +0 -0
  105. agentpile-0.1.0/tests/corpora/fixtures/swe_gym_openhands/data/train.raw-00002-of-00003.parquet +0 -0
  106. agentpile-0.1.0/tests/corpora/fixtures/swe_gym_openhands/make_fixture.py +160 -0
  107. agentpile-0.1.0/tests/corpora/fixtures/swe_rebench_openhands/make_fixture.py +115 -0
  108. agentpile-0.1.0/tests/corpora/fixtures/swe_rebench_openhands/tools.json +102 -0
  109. agentpile-0.1.0/tests/corpora/fixtures/swe_rebench_openhands/trajectories.parquet +0 -0
  110. agentpile-0.1.0/tests/corpora/fixtures/swe_smith/data/tool-00000-of-00008.parquet +0 -0
  111. agentpile-0.1.0/tests/corpora/fixtures/swe_smith/data/tool-00001-of-00008.parquet +0 -0
  112. agentpile-0.1.0/tests/corpora/fixtures/swe_smith/make_fixture.py +117 -0
  113. agentpile-0.1.0/tests/corpora/fixtures/tau2_bench/alpha-model.jsonl +2 -0
  114. agentpile-0.1.0/tests/corpora/fixtures/tau2_bench/beta-model.jsonl +3 -0
  115. agentpile-0.1.0/tests/corpora/fixtures/tau_bench/model-a.jsonl +4 -0
  116. agentpile-0.1.0/tests/corpora/fixtures/tau_bench/model-gem.jsonl +2 -0
  117. agentpile-0.1.0/tests/corpora/fixtures/tau_bench/model-think.jsonl +1 -0
  118. agentpile-0.1.0/tests/corpora/fixtures/trail/data/gaia-00000-of-00001-33a2e72d362d688a.parquet +0 -0
  119. agentpile-0.1.0/tests/corpora/fixtures/trail/data/swe_bench-00000-of-00001-91aa04220f7198b4.parquet +0 -0
  120. agentpile-0.1.0/tests/corpora/fixtures/trail/make_fixture.py +345 -0
  121. agentpile-0.1.0/tests/corpora/fixtures/who_and_when/Who&When/Algorithm-Generated/1.json +41 -0
  122. agentpile-0.1.0/tests/corpora/fixtures/who_and_when/Who&When/Algorithm-Generated/2.json +1 -0
  123. agentpile-0.1.0/tests/corpora/fixtures/who_and_when/Who&When/Hand-Crafted/1.json +32 -0
  124. agentpile-0.1.0/tests/corpora/test_adp.py +325 -0
  125. agentpile-0.1.0/tests/corpora/test_agent_reward_bench.py +382 -0
  126. agentpile-0.1.0/tests/corpora/test_agentdojo.py +59 -0
  127. agentpile-0.1.0/tests/corpora/test_catchbench_pre.py +86 -0
  128. agentpile-0.1.0/tests/corpora/test_mast.py +49 -0
  129. agentpile-0.1.0/tests/corpora/test_swe_agent_nebius.py +143 -0
  130. agentpile-0.1.0/tests/corpora/test_swe_gym_openhands.py +249 -0
  131. agentpile-0.1.0/tests/corpora/test_swe_rebench_openhands.py +207 -0
  132. agentpile-0.1.0/tests/corpora/test_swe_smith.py +195 -0
  133. agentpile-0.1.0/tests/corpora/test_tau2_bench.py +193 -0
  134. agentpile-0.1.0/tests/corpora/test_tau_bench.py +182 -0
  135. agentpile-0.1.0/tests/corpora/test_trail.py +620 -0
  136. agentpile-0.1.0/tests/corpora/test_who_and_when.py +67 -0
  137. agentpile-0.1.0/tests/fixtures/atif_multiagent.json +357 -0
  138. agentpile-0.1.0/tests/fixtures/atif_two.jsonl +2 -0
  139. agentpile-0.1.0/tests/fixtures/config_mcp.json +95 -0
  140. agentpile-0.1.0/tests/fixtures/grade/a_openhands_event_order.json +28 -0
  141. agentpile-0.1.0/tests/fixtures/grade/a_tau_bench_event_order.json +31 -0
  142. agentpile-0.1.0/tests/fixtures/grade/agent_reward_bench_records.json +204 -0
  143. agentpile-0.1.0/tests/fixtures/grade/agent_reward_bench_synthetic.json +150 -0
  144. agentpile-0.1.0/tests/fixtures/grade/b_openhands_multi_call_turn.json +36 -0
  145. agentpile-0.1.0/tests/fixtures/grade/b_tau_bench_multi_call_turn.json +38 -0
  146. agentpile-0.1.0/tests/fixtures/grade/c_tau2_parallel_pairing.json +131 -0
  147. agentpile-0.1.0/tests/fixtures/grade/exceptions.json +19498 -0
  148. agentpile-0.1.0/tests/fixtures/grade/scienceworld_fixture.expected.jsonl +2 -0
  149. agentpile-0.1.0/tests/fixtures/grade/scienceworld_fixture.json +60 -0
  150. agentpile-0.1.0/tests/fixtures/grade/swe_agent_synthetic.json +376 -0
  151. agentpile-0.1.0/tests/fixtures/make_fixtures.py +112 -0
  152. agentpile-0.1.0/tests/fixtures/not_a_trace.json +1 -0
  153. agentpile-0.1.0/tests/fixtures/otlp/make_fixtures.py +274 -0
  154. agentpile-0.1.0/tests/fixtures/otlp/openai_agents_0.24.0_oi_2.5.3.jsonl +3 -0
  155. agentpile-0.1.0/tests/fixtures/otlp/openai_agents_0.24.0_oi_2.5.3_as_tool.json +793 -0
  156. agentpile-0.1.0/tests/fixtures/otlp/pydantic_ai_2.58.0.json +703 -0
  157. agentpile-0.1.0/tests/fixtures/otlp/pydantic_ai_2.58.0_delegation.json +625 -0
  158. agentpile-0.1.0/tests/fixtures/otlp/versions.json +18 -0
  159. agentpile-0.1.0/tests/fixtures/tools/anthropic_tools.json +20 -0
  160. agentpile-0.1.0/tests/fixtures/tools/mcp_tools_list.json +36 -0
  161. agentpile-0.1.0/tests/fixtures/tools/mcp_tools_list_jsonrpc.json +14 -0
  162. agentpile-0.1.0/tests/fixtures/tools/multimodal_messages.json +64 -0
  163. agentpile-0.1.0/tests/fixtures/tools/openai_tools.json +29 -0
  164. agentpile-0.1.0/tests/test_cache.py +46 -0
  165. agentpile-0.1.0/tests/test_capture_config.py +188 -0
  166. agentpile-0.1.0/tests/test_capture_openai_agents.py +654 -0
  167. agentpile-0.1.0/tests/test_capture_otlp.py +357 -0
  168. agentpile-0.1.0/tests/test_capture_pydantic_ai.py +558 -0
  169. agentpile-0.1.0/tests/test_core_has_no_dependencies.py +24 -0
  170. agentpile-0.1.0/tests/test_dataset_base.py +54 -0
  171. agentpile-0.1.0/tests/test_deps.py +139 -0
  172. agentpile-0.1.0/tests/test_deps_rules.py +392 -0
  173. agentpile-0.1.0/tests/test_grade_compat.py +371 -0
  174. agentpile-0.1.0/tests/test_harbor_atif.py +57 -0
  175. agentpile-0.1.0/tests/test_limit_fetch.py +367 -0
  176. agentpile-0.1.0/tests/test_load.py +121 -0
  177. agentpile-0.1.0/tests/test_messages.py +372 -0
  178. agentpile-0.1.0/tests/test_otlp.py +1685 -0
  179. agentpile-0.1.0/tests/test_plugins.py +105 -0
  180. agentpile-0.1.0/tests/test_record.py +191 -0
  181. agentpile-0.1.0/tests/test_send.py +148 -0
  182. agentpile-0.1.0/tests/test_show.py +531 -0
  183. agentpile-0.1.0/tests/test_tables_graph.py +623 -0
  184. agentpile-0.1.0/tests/test_tools_formats.py +261 -0
  185. agentpile-0.1.0/tests/test_validate.py +246 -0
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ All notable changes to agentpile are listed here. Versions follow [Semantic Versioning](https://semver.org/); before 1.0, a minor version may change the record format, and the entry says how.
4
+
5
+ ## 0.1.0 (2026-10-22)
6
+
7
+ The first release.
8
+
9
+ ### Added
10
+
11
+ - `ap.load(name)` for 13 public agent-trace datasets, each at a pinned revision and checked against the run count in its manifest: Who&When, MAST, TRAIL, tau-bench, tau2-bench, AgentRewardBench, AgentDojo, SWE-rebench OpenHands, SWE-agent (Nebius), SWE-Gym OpenHands, SWE-smith, ADP and CatchBench PRE. With `limit=N`, a Hugging Face dataset downloads only the files its first N runs come from (five AgentRewardBench runs fetch about 25 MB of its 30 GB); a later full load fetches the rest and runs the count check.
12
+ - `ap.load(path)` and `ap.load(record)` for ATIF v1.7, OpenAI-style message lists, OTLP JSON (OpenInference and OTel GenAI attributes), MCP `tools/list` results, OpenAI and Anthropic tool lists, and agentpile config records. The format is detected, and an input that more than one reader claims is an error.
13
+ - The run record: an ATIF v1.7 trajectory with an `extra["agentpile"]` extension for source identity, labels with targets, agents and tools with permissions, source spans, and the source values behind every stand-in ATIF requires. A configuration without execution is an `agentpile-config/0` record. Harbor 0.22.0's ATIF models accept every trajectory checked: the first 3,000 runs of each dataset, or all of a smaller one.
14
+ - `Run.events()`: messages, tool calls and tool results in the order the source recorded them, with each event's address in the record.
15
+ - `ap.derive_deps(run, rules=[...])` with six named, versioned rules (`tool_call_id_v1`, `full_context_v1`, `resource_chain_v1`, `last_writer_v1`, `prior_reads_v1`, `value_flow_v1`), and `Run.with_deps(rules=[...])`, which returns a copy whose steps carry the entries.
16
+ - `run.to_json()` and `run.to_otlp()`; an OTLP export reads back to an equal record, and a run loaded from a trace writes each source span once.
17
+ - `ap.show(run)`: a terminal view of one run, with labels beside the events they target and the record's stand-in and pairing marks; rich output with the `view` extra, plain text without it.
18
+ - `ap.table(runs, level)` for flat rows of runs, events or labels (standard library), `ap.to_pandas(runs, level)` (`pandas` extra), and `ap.to_networkx(run, rules)`, an event graph with pairings and inferred dependencies as edges (`graph` extra).
19
+ - `ap.send_otlp(runs, endpoint)`: posts each trajectory's OTLP JSON to a tracing backend such as Jaeger or MLflow, and switches to protobuf for one that answers 415, such as Arize Phoenix (needs `opentelemetry-proto` from the `otel` extra).
20
+ - `ap.capture(agent=...)` and `ap.config_from(agent)` for Pydantic AI (2.58.0 and 2.59.0) and the OpenAI Agents SDK (0.24.0, through openinference-instrumentation-openai-agents 2.5.3). Spans from any other version of the instrumentation (Pydantic AI's own, or OpenInference's for the Agents SDK) raise `UnsupportedVersion` unless `allow_untested_version=True`, which builds the run and marks it.
21
+ - `ap.validate(record)`, the JSON schema of the extension, and plugin registries for readers, writers and datasets (`ap.register` and the `agentpile.readers`, `agentpile.writers` and `agentpile.datasets` entry-point groups).
22
+ - One download cache, `~/.cache/agentpile/` (`AGENTPILE_CACHE`), with `ap.cache_info()` and `ap.clear_cache()`.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Yue Zhao
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,3 @@
1
+ include CHANGELOG.md
2
+ graft tests
3
+ global-exclude __pycache__ *.py[cod] .DS_Store
@@ -0,0 +1,283 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentpile
3
+ Version: 0.1.0
4
+ Summary: Load public agent-trajectory datasets and agent traces into one run record based on ATIF v1.7.
5
+ Author-email: Yue Zhao <yzhao010@usc.edu>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/yzhao062/agentpile
8
+ Project-URL: Repository, https://github.com/yzhao062/agentpile
9
+ Project-URL: Issues, https://github.com/yzhao062/agentpile/issues
10
+ Project-URL: Changelog, https://github.com/yzhao062/agentpile/blob/main/CHANGELOG.md
11
+ Keywords: agent,trajectory,trace,dataset,atif,opentelemetry
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Provides-Extra: hf
26
+ Requires-Dist: huggingface_hub>=0.23; extra == "hf"
27
+ Requires-Dist: pyarrow>=14; extra == "hf"
28
+ Provides-Extra: view
29
+ Requires-Dist: rich>=13; extra == "view"
30
+ Provides-Extra: pandas
31
+ Requires-Dist: pandas>=1.5; extra == "pandas"
32
+ Provides-Extra: graph
33
+ Requires-Dist: networkx>=3.0; extra == "graph"
34
+ Provides-Extra: otel
35
+ Requires-Dist: opentelemetry-sdk>=1.45.1; python_version >= "3.10" and extra == "otel"
36
+ Requires-Dist: opentelemetry-proto>=1.45.1; python_version >= "3.10" and extra == "otel"
37
+ Provides-Extra: pydantic-ai
38
+ Requires-Dist: pydantic-ai-slim>=2.58.0; python_version >= "3.11" and extra == "pydantic-ai"
39
+ Requires-Dist: opentelemetry-sdk>=1.45.1; python_version >= "3.10" and extra == "pydantic-ai"
40
+ Provides-Extra: openai-agents
41
+ Requires-Dist: openai-agents>=0.24.0; python_version >= "3.10" and extra == "openai-agents"
42
+ Requires-Dist: openinference-instrumentation-openai-agents>=2.5.3; python_version >= "3.10" and extra == "openai-agents"
43
+ Requires-Dist: opentelemetry-sdk>=1.45.1; python_version >= "3.10" and extra == "openai-agents"
44
+ Provides-Extra: dev
45
+ Requires-Dist: pytest>=7.0; extra == "dev"
46
+ Dynamic: license-file
47
+
48
+ <div align="center">
49
+
50
+ # agentpile
51
+
52
+ **From agent trajectory datasets and traces to the tools you already use.**
53
+
54
+ [![CI](https://github.com/yzhao062/agentpile/actions/workflows/tests.yml/badge.svg)](https://github.com/yzhao062/agentpile/actions/workflows/tests.yml)
55
+ [![PyPI](https://img.shields.io/pypi/v/agentpile.svg)](https://pypi.org/project/agentpile/)
56
+ [![Python](https://img.shields.io/badge/python-3.9%20to%203.13-blue.svg)](https://github.com/yzhao062/agentpile/blob/main/pyproject.toml)
57
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/yzhao062/agentpile/blob/main/LICENSE)
58
+
59
+ [What You Can Do](#1-what-you-can-do) · [Quick Start](#2-quick-start) · [Datasets](#3-datasets) · [Add a Dataset](#4-add-a-dataset) · [Capture](#5-capturing-a-running-agent) · [Reference](#6-reference)
60
+
61
+ </div>
62
+
63
+ ```python
64
+ import agentpile as ap
65
+
66
+ run = next(ap.load("who_and_when")) # one of 13 datasets by name, or a trace file by path
67
+ ap.show(run) # every step, call and result, with the source's labels beside them
68
+ ```
69
+
70
+ <p align="center">
71
+ <img src="https://raw.githubusercontent.com/yzhao062/agentpile/main/assets/show.svg" alt="ap.show output for a Who&When run: the task, four agents, the outcome, and five steps, with the expert's mistake labels in color beside step 1" width="100%">
72
+ </p>
73
+
74
+ Public datasets store agent runs in their own schemas (e.g., chat messages in tau-bench, OpenTelemetry spans in TRAIL, raw log text in MAST), and each analysis tool expects its own input. agentpile sits between the two. It reads datasets, trace files and live runs into [ATIF v1.7](https://github.com/harbor-framework/harbor) records that keep what the source recorded. You can then use those records with pandas, networkx or a tracing UI such as Phoenix. It downloads each dataset from its publisher at a pinned revision and redistributes nothing.
75
+
76
+ <p align="center">
77
+ <img src="https://raw.githubusercontent.com/yzhao062/agentpile/main/assets/overview.png" alt="Three kinds of input (13 public datasets, trace and tool files, live agent runs) go into one run record, an ATIF v1.7 trajectory or a config record with no steps. Three kinds of use come out: read a run with ap.show, analyze many runs with pandas tables and networkx graphs, and hand a run on as JSON or as OTLP spans to Phoenix or Jaeger." width="100%">
78
+ </p>
79
+
80
+ ## 1. What You Can Do
81
+
82
+ ### 1.1 Open Any Run in a Tracing UI
83
+
84
+ tau-bench stores plain chat logs. `ap.send_otlp` posts a run as OTLP spans to Arize Phoenix, Jaeger, MLflow or any OTLP/HTTP collector.
85
+
86
+ ```python
87
+ run = next(ap.load("tau_bench", limit=1))
88
+ ap.send_otlp(run, "http://localhost:6006/v1/traces") # Phoenix; Jaeger listens on :4318
89
+ ```
90
+
91
+ <p align="center"><img src="https://raw.githubusercontent.com/yzhao062/agentpile/main/assets/phoenix.png" alt="A tau-bench run in Arize Phoenix: system and user messages, chat steps and tool calls in a span tree, with the customer's request and the agent's final answer" width="85%"></p>
92
+
93
+ A run whose source has no timestamps gets synthetic ones that only order its spans. The durations a tracing UI shows for such a run are therefore not runtime measurements.
94
+
95
+ ### 1.2 Compare Failures Across Datasets
96
+
97
+ Who&When blames a step, TRAIL marks error spans, and MAST flags 14 failure modes per run. One table holds all three ([script](https://github.com/yzhao062/agentpile/blob/main/examples/compare_failures.py)).
98
+
99
+ ```python
100
+ runs = [run for name in ("who_and_when", "trail", "mast") for run in ap.load(name)]
101
+ labels = ap.to_pandas(runs, "labels") # run_id, name, value, target_kind, step, span, ...
102
+ ```
103
+
104
+ <p align="center"><img src="https://raw.githubusercontent.com/yzhao062/agentpile/main/assets/compare_failures.png" alt="Left: cumulative share of labels by the position of their step in the run, for Who&When's decisive step, TRAIL's first error and all TRAIL errors. Right: share of MAST runs flagged with each of 14 failure modes" width="100%"></p>
105
+
106
+ ### 1.3 Follow Values Through a Run
107
+
108
+ Which earlier result does each call reuse? When a call reuses an id-like value from an earlier result, the `value_flow` rule makes it depend on the call that produced that result. Such values include reservation ids, product ids and dates. The links are inferred from the recorded values ([script](https://github.com/yzhao062/agentpile/blob/main/examples/value_flow.py)).
109
+
110
+ ```python
111
+ deps = ap.derive_deps(run, rules=["value_flow"]) # each entry names its rule and version
112
+ graph = ap.to_networkx(run, rules=["value_flow"]) # events as nodes, dependencies as edges
113
+ ```
114
+
115
+ <p align="center"><img src="https://raw.githubusercontent.com/yzhao062/agentpile/main/assets/value_flow.png" alt="Left: one tau-bench run drawn as a graph, with arcs from the calls whose results supplied reservation ids to the later calls that reused them. Right: how many steps back each dependency reaches in tau-bench and tau2-bench" width="100%"></p>
116
+
117
+ ## 2. Quick Start
118
+
119
+ ```bash
120
+ pip install agentpile # the core: standard library only
121
+ pip install "agentpile[hf,view]" # adds dataset downloads and the colored ap.show
122
+ ```
123
+
124
+ | Extra | Adds |
125
+ |---|---|
126
+ | `hf` | downloads of the Hugging Face datasets |
127
+ | `view` | colored `ap.show` output (rich); without it the view is plain text |
128
+ | `pandas`, `graph` | `ap.to_pandas` and `ap.to_networkx`; `ap.table` gives the same rows with the core alone |
129
+ | `otel` | protobuf for `ap.send_otlp` to a receiver that takes only protobuf, such as Phoenix (Python 3.10+) |
130
+ | `pydantic-ai`, `openai-agents` | `ap.capture` for Pydantic AI (Python 3.11+) and the OpenAI Agents SDK (Python 3.10+) |
131
+
132
+ A conversation in the OpenAI chat format needs only the core:
133
+
134
+ ```python
135
+ import agentpile as ap
136
+
137
+ messages = [
138
+ {"role": "user", "content": "Is it raining in Paris?"},
139
+ {"role": "assistant", "content": None, "tool_calls": [{"id": "call_1", "type": "function",
140
+ "function": {"name": "get_weather", "arguments": "{\"city\": \"Paris\"}"}}]},
141
+ {"role": "tool", "tool_call_id": "call_1", "content": "light rain, 14 C"},
142
+ {"role": "assistant", "content": "Yes, light rain."},
143
+ ]
144
+ run = next(ap.load(messages)) # the format is detected, and an ambiguous input is an error
145
+ for event in run.events(): # messages, tool calls and tool results in source order
146
+ print(event.kind, event.role, event.content)
147
+
148
+ for dep in ap.derive_deps(run, rules=["tool_call_id"]): # inferred only when you ask, by a named rule
149
+ print(dep["rule"], "step", dep["src"]["step"], dep["src"]["call"], "-> step", dep["dst"]["step"])
150
+
151
+ run.to_json("run.json") # ATIF v1.7 JSON; run.to_otlp("run.otlp.json") writes OTLP spans
152
+ ```
153
+
154
+ ```text
155
+ message user Is it raining in Paris?
156
+ message agent None
157
+ call agent {'city': 'Paris'}
158
+ result tool light rain, 14 C
159
+ message agent Yes, light rain.
160
+ tool_call_id step 2 call_1 -> step 3
161
+ ```
162
+
163
+ The second line is a stand-in made visible. ATIF does not permit the `null` in the source's first assistant message. agentpile therefore stores an empty string in the record and notes that the source held `null`, and the event reports `None`. Rule `tool_call_id` gives the dependency: it makes the next agent step after a result depend on the call that produced it, here the final answer (step 3) on `call_1` in step 2.
164
+
165
+ A dataset loads by name (`ap.datasets.names()` lists them), and a trace file by its path (`ap.readers.names()` lists the formats):
166
+
167
+ ```python
168
+ for run in ap.load("who_and_when", limit=5): # fetches only the files these five runs come from
169
+ print(run.id, run.labels) # the labels the reader emits, each with its target
170
+ run = next(ap.load("my_trace.json")) # ATIF, OpenAI messages, OTLP JSON or a tool list
171
+ ```
172
+
173
+ ## 3. Datasets
174
+
175
+ Each name loads one dataset at the revision shown, and a full load is checked against the run count in its [manifest](https://github.com/yzhao062/agentpile/tree/main/src/agentpile/corpora/manifests). Harbor's ATIF v1.7 models (Harbor 0.22.0) accept every trajectory checked: the first 3,000 runs of each dataset, or all of a smaller one. `tools/dataset_table.py` regenerates this table.
176
+
177
+ | Name | Source at pinned revision | Runs | Source annotation levels | License on the card |
178
+ |---|---|---|---|---|
179
+ | `who_and_when` | [Kevin355/Who_and_When](https://huggingface.co/datasets/Kevin355/Who_and_When) @ `59b9fcb` | 184 | run, step | not declared |
180
+ | `mast` | [mcemri/MAST-Data](https://huggingface.co/datasets/mcemri/MAST-Data) @ `95118ac` | 1,642 | run | cc-by-4.0 |
181
+ | `trail` | [PatronusAI/TRAIL](https://huggingface.co/datasets/PatronusAI/TRAIL) @ `b424ce6` | 148 | run, span | mit |
182
+ | `tau_bench` | [AgentSuite/tau-bench-trajectories](https://huggingface.co/datasets/AgentSuite/tau-bench-trajectories) @ `382e57d` | 4,950 | run | not declared |
183
+ | `tau2_bench` | [AgentSuite/tau2-bench-trajectories](https://huggingface.co/datasets/AgentSuite/tau2-bench-trajectories) @ `07264f1` | 8,340 | run | not declared |
184
+ | `agent_reward_bench` | [McGill-NLP/agent-reward-bench](https://huggingface.co/datasets/McGill-NLP/agent-reward-bench) @ `b6d17e6` | 1,302 | run | not declared |
185
+ | `agentdojo` | [sungjuncho/agentdojo-trajectories](https://huggingface.co/datasets/sungjuncho/agentdojo-trajectories) @ `43df1b8` | 15,095 | call, run, span | not declared |
186
+ | `swe_rebench_openhands` | [nebius/SWE-rebench-openhands-trajectories](https://huggingface.co/datasets/nebius/SWE-rebench-openhands-trajectories) @ `3545538` | 67,074 | run | cc-by-4.0 |
187
+ | `swe_agent_nebius` | [nebius/SWE-agent-trajectories](https://huggingface.co/datasets/nebius/SWE-agent-trajectories) @ `68195a1` | 80,036 | run, step | cc-by-4.0 |
188
+ | `swe_gym_openhands` | [SWE-Gym/OpenHands-Sampled-Trajectories](https://huggingface.co/datasets/SWE-Gym/OpenHands-Sampled-Trajectories) @ `baf3a4e` | 6,055 | run | not declared |
189
+ | `swe_smith` | [SWE-bench/SWE-smith-trajectories](https://huggingface.co/datasets/SWE-bench/SWE-smith-trajectories) @ `08e109b` | 24,100 | run, step | mit |
190
+ | `adp` | [neulab/agent-data-collection](https://huggingface.co/datasets/neulab/agent-data-collection) @ `31a76bf` | 200,914 | run | not declared |
191
+ | `catchbench_pre` | [yzhao062/catchbench](https://github.com/yzhao062/catchbench) @ `30a516c` | 1,187 | run, tool | MIT; rows name their upstream license |
192
+
193
+ > [!WARNING]
194
+ > TRAIL's harness logs contain GAIA reference answers and SWE-bench gold patches. agentpile keeps them as recorded. Remove them before you show a TRAIL run to an agent under test, using the `gold_note` of the TRAIL manifest, which names each field.
195
+
196
+ <details>
197
+ <summary>Notes on the table and on single datasets</summary>
198
+
199
+ <br>
200
+
201
+ - **Annotation levels.** The column lists the levels at which each source annotates its runs, as its manifest records them. Readers turn part of these annotations into `run.labels`: run labels for every dataset except ADP, plus step and agent labels for Who&When, span labels for TRAIL and tool labels for CatchBench PRE. The rest stay elsewhere in the record (e.g., ADP's results in `run.outcome`, SWE-smith's patch in `run.dataset`).
202
+ - **TRAIL** is gated on Hugging Face: accept its terms on the dataset page with the account whose token you use.
203
+ - **AgentRewardBench** run files total about 30 GB, because each step keeps the browser state the agent saw. `limit=` fetches only the run files it reads.
204
+ - **SWE-smith** loads its `tool` split. 14,984 of its 24,100 rows write actions as text and load as plain messages, and `message_format="native"` returns only the 9,116 rows with structured calls.
205
+ - **ADP** loads the 14 configurations whose records pass validation and a count check, and the manifest lists the rest. The loader follows ADP's own ADP-to-ATIF converter with two changes, both to keep the source's roles. An environment observation that answers no call becomes a user step whose `role` is `environment`, where ADP's converter makes it an empty agent step. A call's result keeps the observation's own `source`, where ADP's converter relabels `user` as `environment`.
206
+
207
+ </details>
208
+
209
+ ## 4. Add a Dataset
210
+
211
+ Have agent trajectories or a trace format that agentpile does not load yet? [Open an issue](https://github.com/yzhao062/agentpile/issues/new?template=add-a-dataset.yml) with a link and we write the loader, the manifest and the tests. A pull request with a loader is welcome too (see [Extending](#62-extending)).
212
+
213
+ ## 5. Capturing a Running Agent
214
+
215
+ `ap.capture` records a run of a Pydantic AI agent or an OpenAI Agents SDK agent into the same record, with the agent's configuration attached:
216
+
217
+ ```bash
218
+ pip install "agentpile[pydantic-ai]" # or "agentpile[openai-agents]"
219
+ ```
220
+
221
+ ```python
222
+ with ap.capture(agent=my_agent) as cap:
223
+ my_agent.run_sync("Book a flight from LAX to SFO.")
224
+ cap.run # the captured run
225
+ cap.otlp # the same spans as an OTLP JSON document
226
+ ap.config_from(my_agent) # the configuration alone: instructions, model, tools with schemas, handoffs
227
+ ```
228
+
229
+ Capture is tested with Pydantic AI 2.58.0 and 2.59.0 and with the OpenAI Agents SDK 0.24.0 through openinference-instrumentation-openai-agents 2.5.3. agentpile checks the version of the instrumentation that wrote the spans, which is Pydantic AI itself or, for the Agents SDK, OpenInference. With any other instrumentation version `cap.run` raises an error, and `ap.capture(my_agent, allow_untested_version=True)` builds the run anyway and marks it `source.dialect_tested` false.
230
+
231
+ <details>
232
+ <summary>Which runs a capture records</summary>
233
+
234
+ <br>
235
+
236
+ A capture uses its own tracer provider and never sets the global one. Observers the host program already had keep receiving every span, and the agent's original instrumentation setting is restored when the block exits, including on an exception. Everything a capture records happens while the block is open and only for the agents passed to `capture()`. Runs of other agents in the same window are not recorded. What counts as a selected agent's run depends on the framework. For the Agents SDK, a trace in which a selected agent takes part (it starts the run, receives a handoff, or is called as a tool) is recorded whole, other participants included. Because the SDK names agents only by name in its spans, an unselected agent that shares a selected agent's name is also recorded. For Pydantic AI, each selected agent's own runs are recorded: an agent that a selected agent calls from a tool is recorded only when it is selected too. Pass every agent whose delegated work you want.
237
+
238
+ </details>
239
+
240
+ ## 6. Reference
241
+
242
+ ### 6.1 The Record
243
+
244
+ A trajectory record is an ATIF v1.7 trajectory, the Agent Trajectory Interchange Format of the Harbor evaluation framework. What ATIF has no field for sits under `extra["agentpile"]`: where the run came from, the source's labels with their targets, the agents and tools with their permissions, and the source value behind each message or call stand-in. A configuration with no execution (e.g., an MCP tool list) is a config record (`agentpile-config/0`) with the same agents, tools and labels at its top level and no steps.
245
+
246
+ Loading never adds what the source did not record: it keeps any dependencies the input states and infers none. The few pairings a reader has to infer carry `paired_by` with the name of the rule, and `ap.derive_deps(run, rules=[...])` infers dependencies between steps when you ask.
247
+
248
+ <details>
249
+ <summary>What the extension holds, and how inference and export work</summary>
250
+
251
+ <br>
252
+
253
+ - **Source and identity:** dataset, revision, file, record key and reader version, enough to trace every run back to the row it came from.
254
+ - **Labels with targets:** each label points at the run, an agent, a step, a call, a span or a tool, with the label's origin (expert, LLM judge, benchmark).
255
+ - **Agents and tools:** each agent's instructions, model and tools, and each tool's original definition, its permission, and where that permission came from.
256
+ - **Stand-ins made visible:** where ATIF requires a value the source did not have (a non-null message, an object of arguments, a call id, an image part it cannot hold), the record keeps the source value and the event view reports it. A missing value, a null and an empty string therefore stay distinct. A call whose source arguments were neither a JSON object nor null keeps them in `arguments_raw` and carries `arguments_state: "unparsed"`, and in `run.to_otlp()` its model span and its tool span both show that source value. For any other call the model span shows the parsed arguments, and the tool span shows the source text where the reader kept it.
257
+ - **Source order:** `run.events()` follows the order the source recorded, which differs from ATIF where ATIF stores a result on the step that issued the call (a delegated agent's steps can come in between). A reader whose references are not integers (e.g., TRAIL's span addresses) stores an integer sort position beside each reference (`source_pos`, `result_pos`), and the reference itself keeps pointing back into the source.
258
+
259
+ CatchBench PRE rows load as config records, and so do tool definitions: an MCP `tools/list` result, an OpenAI tool list and an Anthropic tool list (readers `mcp-tools-list`, `openai-tools` and `anthropic-tools`), each definition kept verbatim. An MCP tool's permission comes from its annotations when it states them and is `unknown` otherwise.
260
+
261
+ Inferred pairings include a result matched to its call by position, a TRAIL history call placed on the latest agent step, and a TRAIL TOOL span tied to its call by a unique match. Every dependency from `ap.derive_deps` names the rule and version that produced it, and `run.with_deps(rules=[...])` returns a copy whose steps carry those entries, which `to_otlp()` then writes as span links. The run you loaded is not changed.
262
+
263
+ `run.to_otlp()` writes a run as OTLP JSON spans in the layout of Harbor's ATIF-to-OpenTelemetry converter. A run loaded from a trace writes each of its source spans once, and a telemetry tool therefore counts the same model and tool operations as in the original trace. The spans agentpile adds around them (the trajectory, user and system steps) are CHAIN spans, not model or tool operations. Reading an OTLP trace whose instrumentation version differs from the tested ones raises an error unless you pass `allow_untested_version=True`, which marks the record as read from an untested version.
264
+
265
+ </details>
266
+
267
+ ### 6.2 Extending
268
+
269
+ A reader is any object with `sniff(source) -> bool` and `read(source) -> Iterator[Run]`. Register one for a session with `ap.register("my-format", reader)`, or ship it in a package through the entry-point group `agentpile.readers` (datasets and writers have `agentpile.datasets` and `agentpile.writers`). Pass `reader="..."` to `ap.load` to skip detection.
270
+
271
+ ### 6.3 Downloads and Cache
272
+
273
+ Downloaded files live in one place, `~/.cache/agentpile/<dataset>/<revision>/` (set `AGENTPILE_CACHE` to move it), and never in the shared Hugging Face cache. A load with `limit=` fetches only the files its runs come from, and a later full load fetches the rest. Until a full download completes, each limited load still asks the hub for its file listing. `ap.cache_info()` lists what is there and `ap.clear_cache()` removes it.
274
+
275
+ ## 7. Status
276
+
277
+ Alpha. Version 0.1.0 covers the 13 datasets above, each checked against a manifest of pinned counts, the ATIF, OpenAI-style message, OTLP JSON, tool-definition and agentpile config formats, and capture for Pydantic AI and the OpenAI Agents SDK. The record format may still change before 1.0, and the [changelog](https://github.com/yzhao062/agentpile/blob/main/CHANGELOG.md) lists every change.
278
+
279
+ ## 8. License
280
+
281
+ Apache-2.0 for the code. Each dataset keeps its publisher's terms. Several declare no license on their dataset card, and agentpile records what each card says in its manifest. The tests use synthetic fixtures in each dataset's file layout and copy no dataset content. The name follows the habit of calling a mixed collection a pile and has no connection to EleutherAI's The Pile.
282
+
283
+ <p align="right"><a href="#agentpile">back to top</a></p>