Plugins and integrationsReviewed · Pydantic

ExaSearch and ExaAgent (Pydantic AI Harness)

ExaSearch and ExaAgent are Python capabilities that give Pydantic AI agents web search, page reading, optional deep search and delegated long research through the Exa API. They suit developers building research agents. The main catch is that they need an Exa API key, and the harness API may change while it is on 0.x releases. ExaSearch adds three tools. web_search returns at most max_results hits (default 5). get_page caps page text at max_text_chars, up to 10,000 characters. deep_search is opt-in and returns its answer untruncated. ExaSearch also adds research guidance to the system prompt and structured source records. ExaAgent adds an exa_agent tool that hands long tasks to Exa's asynchronous Agent API as deferred tool calls. The page documents no output cap for ExaAgent results.

Researched 15 Nov 2026

In short.

ExaSearch and ExaAgent are Python capabilities from Pydantic AI Harness that give a Pydantic AI agent web search and page reading through the Exa API. They are for developers building research agents. The main catch is that they need an Exa API key and credits (the page states no pricing), and the harness API may change between minor releases while it is on 0.x. ExaSearch contributes three tools. web_search returns top results with title, URL and excerpts, limited to max_results. get_page reads one URL, with text capped at max_text_chars, at most 10,000 characters. deep_search is opt-in and returns a cited answer from Exa's multi-step search, untruncated. ExaSearch also adds short research guidance to the system prompt. A separate ExaAgent capability adds exa_agent, which starts an asynchronous Exa Agent API run. The run is resolved either by polling inside the agent run or by returning deferred requests to the host application. Every tool returns text for the model plus structured source records for the application. The page warns about untrusted content and notes that domain filters do not restrict get_page. This report is based only on the documentation page. Nothing was installed or run, and no claims about performance, cost or quality have been checked.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage is the complete selected page, [https://pydantic.dev/docs/ai/harness/exa-search/index.md], captured on 2026-11-15 (about 40 KB). It contains the guide and the API reference for ExaSearch, ExaAgent, agent_run_result and ExaSource. Linked pages were excluded: Exa's documentation, the Exa Agent API guide, the Pydantic AI capability, toolset and durable-execution pages, the PromptInjectionDefender page, the version policy, the GitHub source, the MCP server repository and the companion article. No licence text, source code, package metadata or release history was captured. Nothing was installed or executed, so tool behaviour, performance, cost, result quality and compatibility are untested and rest on the page's own description.

The overview

What this resource is

The selected resource is the documentation page for ExaSearch and ExaAgent, two capabilities in Pydantic AI Harness. Pydantic AI Harness is an add-on package for Pydantic AI. The page links to its source at [https://github.com/pydantic/pydantic-ai/tree/main/src/pydantic_ai_harness/pydantic_ai_harness/exa/]. Pydantic publishes the page at [https://pydantic.dev/docs/ai/harness/exa-search/index.md].

In Pydantic AI, a capability is a bundle that adds tools, instructions and behaviour to an Agent through its capabilities parameter. ExaSearch bundles web research tools backed by the Exa search API [https://exa.ai/], per-tool output budgets and short research guidance. ExaAgent is a separate capability that hands long research tasks to Exa's Agent API.

The package is installed as pydantic-ai-harness with the exa extra. The page does not give a version number for the documented release.

Overall assessment

Judged on the documentation alone, this is a well-specified integration. The page covers tool behaviour, size limits, error handling, configuration defaults, security caveats, durable execution and testing with a fake client. A developer already using Pydantic AI who wants a ready-made search and page-reading toolset would find it directly useful.

The output limits are specific to each tool, not a general cap. web_search returns at most max_results results (default 5, allowed 1 to 100). get_page caps page text at max_text_chars (default 10,000, allowed 1 to 10,000). deep_search returns its answer untruncated, and the page documents no output cap for ExaAgent results.

The main reservations are practical. It depends on a third-party service, Exa, which needs an API key and credits, and the page gives no prices. It is on 0.x releases, so the API may change between minor releases. get_page can read any URL the model passes it, so the application has to deal with untrusted web content and possible data leakage. None of this was tested here. The assessment rests on what the page says, not on running the code.

Who it is for

It is for Python developers building agents with Pydantic AI who need live web information. Examples include an agent that answers questions about recent changes, compares sources or produces cited research. The page's own example asks about the latest stable Python release.

It is not aimed at non-programmers. Using it means writing Python (or an agent spec in YAML or JSON), managing an API key and deciding how to handle untrusted web text.

The page speaks directly to teams using durable execution (Temporal, Prefect or DBOS) and to teams that need an external worker to finish long research runs outside the original process. Developers who do not use Pydantic AI are not served by this page, because the capabilities attach to Pydantic AI agents. The page also describes an Exa MCP server as a separate route.

What it can do

ExaSearch contributes these tools. web_search searches the web and returns the top max_results pages (default 5, allowed 1 to 100), each with its title, URL and most relevant excerpts (Exa highlights). get_page returns the text of one URL, capped at max_text_chars (default 10,000, allowed 1 to 10,000). deep_search is off by default. When enabled with include_deep_search=True, it calls Exa search with type 'deep'. Exa expands the question into several queries and returns one answer with cited sources.

Optional settings: text_summary makes each web_search call also request a plain-text synthesized summary, which is placed at the top as a Summary: line. include_domains or exclude_domains filter web_search and deep_search; you can set one but not both. native=True uses the model's own web search where it has one, with Exa's web_search as the fallback. guidance replaces or removes the default research instructions.

ExaAgent adds exa_agent, which creates an Exa Agent API run. A run moves from queued to running and ends as completed, failed or cancelled, which can take up to an hour. Settings include effort, output_schema (a Pydantic model class or a dict), system_prompt, poll_interval, timeout_ms and execution ('inline' or 'external'). A returned run ID can be passed back as previous_run_id to ask follow-up questions.

Every tool returns a ToolReturn. The text goes to the model. The 'sources' key in its metadata holds records with url and title, which the application can read from the message history without parsing text. The capabilities can be declared in an agent spec file. They can also be wrapped with PrefixTools so that several differently configured instances work side by side.

Using it

What you need

You need a Python project that uses Pydantic AI, the pydantic-ai-harness package installed with the exa extra, and an Exa API key in the EXA_API_KEY environment variable. Keys are created at [https://dashboard.exa.ai]. You also need access to whichever language model the Agent uses. The page's examples use Anthropic model strings, so those examples would need Anthropic credentials. Beyond mentioning native web search on Anthropic and Gemini models, the page does not say which providers are supported.

The page does not give the minimum Python version, Pydantic AI version or exa_py version. If EXA_API_KEY is missing, building the Agent fails with a setup hint, although the capability itself can be constructed without it. Instead of using the environment variable, you can pass your own client: an exa_py AsyncExa or any object matching the ExaClient protocol.

For external ExaAgent execution, the agent's output_type must include DeferredToolRequests, and the host application needs code to poll or resolve the runs.

How it works

ExaSearch builds a toolset whose tools call the Exa API through exa_py. web_search asks for highlights rather than full text, so surveying several sources uses little context. The agent then reads the pages it chooses with get_page. The page says this follows Exa's own guidance for agents. Results are limited to max_results even if Exa returns more. A query with no matches returns the text No results found for the query.

Errors are handled in two ways. Some go back to the model as a retry prompt, up to the tool's retry limit, after which the run raises: an empty page or deep search answer, an HTTP error response such as a rate limit, or a network failure. Others are raised straight away: errors 401 and 403 (API key), 402 (credits) and any other exa_py error, such as a rejected option or a response it can't parse.

The default system-prompt guidance tells the model to search wide first, read the most promising pages in full before drawing conclusions, prefer primary sources and cite the URLs it relied on. With deep search enabled, it also tells the model to treat deep_search as an escalation from web_search.

ExaAgent maps the Exa run lifecycle onto Pydantic AI deferred tool calls. The exa_agent tool creates the run and defers, with the run ID in the call metadata. In inline mode the capability polls each run to completion, one after another, and timeout_ms applies to each run. In external mode the host receives DeferredToolRequests and resolves them, even from another process. It builds results with the agent_run_result helper and resumes the agent with the original message history. Failed or cancelled runs are returned to the model as a structured message.

Outside durable execution, an unrecoverable polling error or cancelling the agent run during polling makes the capability cancel the Exa runs nothing will read. These are the runs it has not finished polling and the runs it was leaving for the model to follow up on. This needs a cancel method on the runs client, which exa_py's client has. It can hold the agent run for up to about 5 seconds while Exa accepts the cancellations. Under durable execution those runs are left running instead, because the engine can resume the wait.

Setup steps

The documented steps are short. First, install with pip install "pydantic-ai-harness[exa]" or uv add "pydantic-ai-harness[exa]". Second, create an Exa API key at [https://dashboard.exa.ai] and set EXA_API_KEY. Third, pass ExaSearch() in the capabilities list of an Agent. For long delegated research, add ExaAgent() the same way.

For production-style use the page describes extra steps. Choose inline or external ExaAgent execution. On Temporal, deep_search can exceed the default 60-second activity timeout, so give tool calls longer through toolset_activity_config, keyed by the capability id. ExaAgent polls its run in a capability activity that uses the base activity_config, so set that config's start_to_close_timeout above timeout_ms. To run several instances, give each extra one a distinct id and wrap it in PrefixTools.

Under durable execution, keep the capability ids stable. Changing an id renames the records, and in-flight runs then cannot find them. These steps come from the documentation. None were carried out here.

Worked example from the page

The page's basic example imports Agent from pydantic_ai and ExaSearch from pydantic_ai_harness, then creates Agent('anthropic:claude-sonnet-5-5', capabilities=[ExaSearch()]). It runs agent.run_sync('What changed in the latest stable Python release?') and prints result.output. Following the default guidance, the model would be expected to call web_search, then get_page on promising hits, then answer with cited URLs.

To show sources in an application, the page loops over result.all_messages(). For each ModelRequest, it checks the ToolReturnPart entries that have metadata, reads the 'sources' list and prints each source's url and title. This metadata is never sent to the model.

Two further snippets are separate examples, and each constructs its own ExaSearch instance. ExaSearch(include_deep_search=True) exposes the deep_search tool. ExaSearch(text_summary='One concise sentence with the requested facts.') makes web_search also request a summary in that format. The page does not present them as one configuration that enables both settings. An agent spec example sets max_results to 3, turns on deep search and adds ExaAgent with effort low, and the file is loaded through Agent.from_file with custom_capability_types. These examples were not run for this report, and their outputs are unknown.

Assessment & evidence

Limitations and risks

Stability: while Pydantic AI Harness is on 0.x releases, the API may change between minor releases. The page says deprecation warnings and release-note guidance will explain how to upgrade. num_results is already a deprecated alias for max_results.

Prompt injection: titles, excerpts, page text and deep search answers can carry instructions aimed at the model. The title, URL, author, date and excerpt fields are each rendered on one line, so they can't fake another result's Title: or URL: line. Page text is passed through as returned. The text_summary summary and the deep_search answer are Exa's own synthesized text, so they can still contain such lines. The page suggests PromptInjectionDefender and human approval for get_page. Neither was evaluated.

Content limits: get_page returns at most max_text_chars characters, up to 10,000. A truncation marker appears only when the cap is below that ceiling. At 10,000 no marker appears, because Exa can't return the extra character that would reveal truncation. deep_search output is not truncated. web_search returns text excerpts, not full pages.

Operational caveats: inline ExaAgent polling runs one run at a time, so a response that starts several runs can wait up to timeout_ms per run (default 3,600,000 ms). A run whose polling times out keeps running on Exa. If creating a run fails in a way Exa may have acted on (a 5xx response, or a network failure after the request was sent), the error is raised rather than retried. Two instances that share an id but differ in configuration raise an error. Combining core WebSearch() with the default ExaSearch() on Anthropic native-search models would send two tools both named web_search. With native=True on Gemini, setting a domain list makes the capability use Exa search, because Gemini's native search takes no domain filters.

Not assessed: result quality, latency, citation accuracy, rate limits, behaviour under load and compatibility across model providers.

Reasoning behind the assessment

The page is detailed and internally consistent about configuration defaults, ranges and failure behaviour. It states the security trade-offs openly, for example that get_page ignores domain filters and that synthesized text can contain injected lines. That makes the design easier to judge from the documentation alone.

The page gives reasons for its design choices. Search returns excerpts so that surveying sources stays cheap. Full page text is fetched only when asked for, and capped. Deep search is opt-in because it takes longer and costs more. Structured sources travel in metadata, so rendering citations needs no text parsing. These choices help research agents keep context size under control. They do not limit everything, though: deep_search answers are untruncated and no ExaAgent output cap is documented.

Confidence is limited. The page is the maintainer's own description, not independent testing. It contains no benchmarks, no version or release date and no pricing. The examples use different model strings: claude-sonnet-5-5 in the usage examples and claude-sonnet-4-6 in the API reference. The page does not explain why, and it does not show whether both strings work with the documented release.

Alternatives and related options

The page compares two options. The first is core Pydantic AI WebSearch, which adapts to the provider. On models with a native search tool it uses the provider's own server-side search. On other models it raises an error unless you pass a local fallback, such as local=True for DuckDuckGo. It fits when you want search that follows the model, whereas ExaSearch gives the same search behaviour on every model. To use native search where it exists and Exa elsewhere, set ExaSearch(native=True), or pass ExaSearch(...).web_search_tool() as WebSearch's local fallback (this form has no get_page).

The second is Exa's official hosted MCP server at [https://mcp.exa.ai/mcp], with its repository at [https://github.com/exa-labs/exa-mcp-server]. By default it exposes web_search_exa and web_fetch_exa, and its full catalog adds advanced search and agent-run tools. It can be attached through core's MCP capability and used alongside ExaSearch, because none of the tool names collide. According to the page, ExaSearch adds output caps, retry prompts on empty results, research instructions and fake-client testing, while the MCP server exposes Exa's full tool catalog.

The page also links a Pydantic article, A research agent, three ways, at [https://pydantic.dev/articles/harness-exa]. This report does not cover or evaluate other search providers or frameworks.

Evidence base

The report rests on one captured file: the selected documentation page (about 40 KB) at [https://pydantic.dev/docs/ai/harness/exa-search/index.md]. It contains the narrative guide and the API reference for ExaSearch, ExaAgent, agent_run_result and ExaSource. Linked pages were not read, including Exa's documentation, the Pydantic AI capability pages, the GitHub source, the article and the version policy.

No source code, tests, licence file, changelog or package metadata was captured. Nothing was installed or executed, so every behaviour described here comes from the maintainers' documentation and has not been confirmed. The page opens with a note asking agents to add query parameters when they fetch pages. That note is not part of the resource's behaviour, and nothing in this report relies on it.

Access & freshness

Costs

The page gives no prices. It says deep_search takes longer and costs more than web_search, and that ExaAgent runs can last up to an hour, but it gives no figures. It also mentions error code 402 for credits, so Exa usage appears to draw on account credits. Exa's pricing, free tier and rate limits are not covered and are unknown from this evidence.

Language model usage is a separate cost. ToolReturn.return_value carries the text sent to the model; ToolReturn.metadata, including structured source records, is not sent to the model. The limits on that text matter. web_search returns at most max_results hits (default 5). get_page returns at most max_text_chars characters of page text (default and maximum 10,000). deep_search answers are untruncated, and the page documents no output cap for exa_agent results. The page does not say how many tokens or dollars a typical run uses, and this was not measured.

The page does not state a price or licence terms for the harness package itself.

Rights, data handling and licence

The page does not state the licence of pydantic-ai-harness or of the documentation. The link to the GitHub source suggests the licence can be checked there, but it was not checked for this report. Use of the Exa API is presumably governed by Exa's own terms, which the page does not cover.

On data flow, queries and the URLs the model passes are sent to the Exa API, because the tools call Exa's search and get_contents operations. The page warns that get_page reads any URL the model passes, including one a page told it to read, and that the URL can carry data from the conversation to that site's owner. include_domains and exclude_domains do not restrict get_page.

Content returned by searches and page reads comes from third parties. Whether you may store, quote or republish it depends on the source sites and Exa's terms, which the page does not address. On telemetry, the capabilities emit no spans of their own; core Pydantic AI tool-call spans cover each Exa operation.

Freshness

The page was captured on 2026-11-15. It gives no release number, publication date or changelog entry for the documented behaviour, so how current it is compared with the latest package release is unknown.

The page says the harness is on 0.x releases and that the API may change between minor releases, so details such as defaults, parameter names and tool names could differ in other versions. num_results is already deprecated in favour of max_results. Check the installed version's release notes before relying on specifics. Exa's own API limits and behaviours, such as the 10,000-character page maximum and runs lasting up to an hour, are described as of this page and may change on Exa's side.

Suggested next steps

If you use Pydantic AI and need web research, try ExaSearch() with its defaults in a sandboxed project, using a test Exa key. Before trusting it, check its results against questions whose answers you already know.

Before production, decide how to handle untrusted content. Consider PromptInjectionDefender and approval for get_page, and remember that domain filters do not apply to get_page. Leave deep_search and ExaAgent off until a task needs them, and set timeouts and retry limits with their cost and duration in mind.

Look up Exa's current pricing and rate limits, the package licence on GitHub, and the minimum Python and Pydantic AI versions, since none of these are on this page. If you use durable execution, raise the Temporal timeouts as described and keep capability ids stable. Pin the harness version while it is on 0.x, and read the release notes when upgrading. Use a fake ExaClient in tests so they don't call the live API.

Evidence for this report

selected-page.txtselected · checked 2026-11-15