groundy
Agents & Frameworks

Should Pydantic AI Agent Benchmarks Allow Documentation Tools?

Pydantic AI benchmarks must report documentation access separately from disabled runs to ensure comparability, as the tool changes the evaluation condition without measured or

Published 4 references
On this page11 sections

Yes, but only as an explicitly reported benchmark condition. A Pydantic AI agent with PydanticAIDocs can retrieve documentation during a run; an otherwise identical agent without that capability must rely on the knowledge and other resources already available to it. Those runs should not contribute to one undifferentiated score.

The practical rule is to report documentation-disabled and documentation-enabled results separately, identify whether documentation came from a local checkout or GitHub, and pin the documentation version where possible. This is a comparability requirement, not a prediction about performance: none of the sources examined here measures whether documentation access raises or lowers Pydantic AI agent scores.

Documentation access changes what a benchmark measures

Pydantic AI Harness attaches features to agents as capabilities, alongside facilities such as memory, guardrails, planning and persistence. Documentation access is therefore a configuration choice, not an unavoidable property of every harness run.

The PydanticAIDocs capability adds one tool, read_pyai_docs(topic). The tool locates a Pydantic AI documentation page and returns it in full. No documentation is bundled into the agent’s context up front.

That distinction matters in both directions:

  • If the benchmark represents a deployed coding agent that is allowed to consult Pydantic AI documentation, excluding the tool may under-specify the intended working environment.
  • If the benchmark is intended to assess what a model can do without retrieving that documentation, enabling the tool changes the task.
  • If the purpose is broad model comparison and both environments are relevant, run both conditions and publish separate results.

Enabling the capability still does not establish that the agent used it. The agent must choose to call the tool. A configuration flag records availability; tool-call records, where the evaluation collects them, are needed to establish consumption. Without those records, report the condition as “documentation available,” not “documentation used.”

There is also a scope limit. The documented topics are capabilities, hooks, tools, tools-advanced, toolsets and agent. This is a focused Pydantic AI documentation source, not a general corpus of Python or software-engineering knowledge. Results under this capability should not be presented as evidence about arbitrary documentation retrieval.

One tool, but two different delivery paths

According to Pydantic’s documentation, each call first resolves the topic from a configured checkout inside the run workspace. It then falls back to fetching the page from GitHub at the installed pydantic_ai release tag. That fallback requires network access. If neither local_docs_path nor the PYDANTIC_AI_HARNESS_DOCS_PATH environment variable is set, every call fetches remotely.

The checkout can also arrive without the parameter being set: local_docs_path falls back to the PYDANTIC_AI_HARNESS_DOCS_PATH environment variable, and takes precedence over it when both are present. A run can therefore read locally while local_docs_path itself was never configured.

Consequently, “documentation enabled” is not a sufficiently precise condition label. Two documentation-enabled runs can have different content sources and different network dependencies.

A configured local checkout also does not, by itself, prove that every read remained local. The documented resolution order retains the remote fallback. Benchmark reports should therefore distinguish the configured source from the delivery path actually available to the run, particularly when a sandbox restricts outbound access. The documentation establishes that the fallback needs network access; it does not provide enough evidence here to describe every resulting failure mode in an offline environment.

The returned document is memoized for the duration of one agent run. Repeated reads within that run do not repeat workspace or network I/O. This is not documented as a cross-run cache. If a benchmark reports latency, request counts or tool I/O, it should define the agent-run boundary and avoid treating repeated reads within a run as independent retrieval operations.

Configuration has one additional failure mode worth catching before scoring. Two PydanticAIDocs instances with the default ID pydantic_ai_docs become one source when their configurations agree. If their configurations differ, agent construction raises UserError. That is a benchmark-configuration failure, not a task-level failure by the model, and it should be recorded accordingly.

Pin the documentation, not just the package

For remote retrieval, remote_ref defaults to the installed pydantic_ai release tag. Pydantic’s example is v2.69.0, which is an illustration of the naming scheme, not evidence that it is the current release. The intention is for fetched documentation to describe the installed APIs. An explicit remote_ref can replace the default.

There is an important exception: a development build without a release tag reads main. The default is then not a fixed documentation version. Content can change while a benchmark series is being run, weakening both repeatability and comparisons over time.

For development builds, a benchmark maintainer faces a real tradeoff:

  • Following main may track the development API, but it does not provide stable benchmark content.
  • Pinning an explicit release reference improves content stability, but the selected documentation may not match the development build being tested.
  • A fixed local checkout can provide a stable source, but its revision and relationship to the installed package need to be recorded.

For local retrieval, record the checkout revision as well as the package version. The documented release-tag default applies to remote fetching; it should not be interpreted as proof that a configured local checkout has been synchronized automatically with the installed release.

The harness itself adds another versioning constraint. Its documentation warns that, while it remains on 0.x releases, the API may change between minor releases. The page also shows no publication date. Benchmark definitions should therefore record the harness and pydantic_ai versions and recheck the documented resolution behavior after upgrades, rather than treating this article’s configuration details as permanent API guarantees.

A benchmark-condition matrix

The following matrix separates the conditions using the documented tool semantics. “What the condition includes” describes available capabilities, not a guaranteed method used by every agent.

ConditionDocumentation resolutionVersion and network reportingWhat the condition includes
Documentation disabledPydanticAIDocs absentRecord package and harness versions; no documentation fetch through this toolTask execution without retrieval from read_pyai_docs
Documentation enabled, local checkout configuredWorkspace checkout first, GitHub fallback secondRecord checkout revision and installed package version; disclose whether network fallback was available or usedDocumentation availability, plus any retrieval and document use the agent performs
Documentation enabled, no local checkout configured by either meansGitHub fetchRecord installed release tag or explicit remote_ref; network access is requiredDocumentation availability with a remote retrieval dependency
Documentation enabled on a development build, default remote referenceLocal checkout if configured, otherwise remote retrievalDefault reference is main when no release tag exists; do not label this version-pinnedDocumentation availability with potentially changing content unless separately fixed

Scores from these rows should not be pooled into a single ranking. Even the two local and remote documentation-enabled rows are not interchangeable: their network dependencies differ, and their content can differ if the checkout and remote reference are not aligned.

For a model comparison, I would normally publish documentation-disabled results and one fixed documentation-enabled condition as separate panels. Remote-fallback runs belong in another panel when they are included to represent deployment behavior or network dependence. If the actual deployment always retrieves remotely, however, that remote condition is the relevant primary benchmark; the reporting requirement remains the same.

Validity, difficulty and coverage are separate questions

The TASTE paper gives useful vocabulary for making this decision. Its authors propose three desiderata for benchmarks of tool-using agents: validity, difficulty and coverage. They operationalize coverage through tool sequences and generate tasks intended to explore that space.

Applied to documentation access, validity asks whether the benchmark condition represents the capability you claim to measure. A documentation-enabled condition can be valid for a documentation-assisted agent and invalid for a test of recall without that source. Neither condition is universally correct.

Difficulty needs equal care. Documentation could supply API information that a model otherwise lacks. Retrieving and applying that documentation could also add steps to the task. Both possibilities are plausible, but neither establishes the direction or size of a score change. The supplied evidence contains no docs-on/docs-off comparison.

Coverage is not achieved merely by adding the capability. If coverage is described through tool sequences, the relevant questions include whether documentation calls were available, whether tasks admitted sequences containing those calls, and whether such sequences occurred. A benchmark can enable the tool while barely exercising it, or exclude it while covering other tool-use patterns extensively.

TASTE also supplies a reason to remain skeptical of impressive aggregate scores. Its authors constructed τc-Bench as an extension of τ2-Bench and reported performance drops among models that nearly saturated the original benchmark. They interpret such results as evidence that high scores can reflect saturation rather than robust task-solving ability. That finding comes from generated tasks in a different domain, including flight-domain tasks, not from Pydantic AI documentation work. It supports scrutiny of benchmark construction; it does not demonstrate a documentation-tool effect.

A documentation delta would not be a pure knowledge delta

The ToolRet benchmark treats tool retrieval as a capability worth evaluating in its own right. Its dataset spans Web APIs, Code Functions and Customized Applications and draws on tools collected from more than 30 datasets.

ToolRet does not test read_pyai_docs, so it cannot provide a numerical expectation for a Pydantic AI benchmark. Its relevance is conceptual: retrieval ability should not be collapsed silently into model knowledge.

If an otherwise controlled experiment did produce a documentation-enabled versus documentation-disabled score difference, that difference would still combine several possibilities. The agent might retrieve a useful page, choose an unsuitable topic, fail to call the tool, or retrieve information without applying it successfully. Task execution remains part of the result as well. The delta would concern the complete documentation-assisted condition, not a clean measurement of either recall or retrieval alone.

This is why separate reporting is more defensible than attaching a generic “with tools” label to one score. It preserves the condition under which the result was obtained without pretending that the sources have isolated a causal effect.

The reporting checklist for every run

A Pydantic AI agent benchmark using this harness should record:

  1. The target capability. State whether the benchmark represents documentation-assisted work, execution without this documentation source, or both.
  2. The capability configuration. Identify whether PydanticAIDocs was present. Validate duplicate instances before treating a run as a model result.
  3. Package and harness versions. Include the installed pydantic_ai release and harness version so the 0.x API context is visible.
  4. The documentation source. Report local_docs_path configuration and the PYDANTIC_AI_HARNESS_DOCS_PATH environment variable, whether remote retrieval was possible, and whether the condition depended on the GitHub fallback.
  5. The documentation version. Record an explicit remote_ref or installed release tag for remote retrieval, and a checkout revision for local content. Flag development builds whose default is main.
  6. Availability separately from use. If tool sequences are collected, report whether read_pyai_docs was called. Otherwise, make clear that only availability is known.
  7. Run boundaries and caching. When reporting I/O or timing, account for per-run memoization rather than assuming repeated reads repeat retrieval.
  8. Separate results. Publish documentation-disabled and documentation-enabled scores separately, and keep local, remote and moving-main conditions distinguishable.
  9. Configuration and environment failures. Distinguish build-time UserError, unavailable network fallback and task-level agent failures instead of converting them into one undifferentiated score.

Documentation tools belong in a Pydantic AI benchmark when they belong in the environment being evaluated. They do not belong as an invisible difference between rows of the same leaderboard. Until comparative measurements are available, the supported conclusion is narrow but useful: documentation access changes the evaluation condition and must be reported, while its effect on scores remains unmeasured.

Frequently Asked Questions

How does the PydanticAIDocs capability retrieve documentation during a run?

According to Pydantic’s documentation, each call first resolves the topic from a configured checkout inside the run workspace. It then falls back to fetching the page from GitHub at the installed pydantic_ai release tag. That fallback requires network access. If neither local_docs_path nor the PYDANTIC_AI_HARNESS_DOCS_PATH environment variable is set, every call fetches remotely.

What happens if a benchmark uses a development build without a release tag?

There is an important exception: a development build without a release tag reads main. The default is then not a fixed documentation version. Content can change while a benchmark series is being run, weakening both repeatability and comparisons over time.

How should benchmark reports distinguish documentation availability from actual use?

Enabling the capability still does not establish that the agent used it. The agent must choose to call the tool. A configuration flag records availability; tool-call records, where the evaluation collects them, are needed to establish consumption. Without those records, report the condition as “documentation available,” not “documentation used.”

References

Follow the links in the article for context. The supporting material is collected here for further reading.

  1. PydanticAIDocs capabilitypydantic.devAccessed
  2. TASTE paperarxiv.orgAccessed
  3. ToolRet benchmarkarxiv.orgAccessed

Join the discussion

Share a useful perspective or ask a question about this article.

Discussion guidelinesComments privacy