DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk4 min

AI Agent Web Search: Filter Results to Save Context Tokens

Live web search can make an AI agent more current, while context settings and filtering help avoid passing irrelevant material to the model. Here’s how to configure and evaluate that workflow.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To give an AI agent current web information without filling its context with unnecessary text, connect a live-search tool and control what search results or fetched pages are passed to the model. A prompt alone does not enable search: the agent must have the tool configured. OpenAI documents a search-context setting; Anthropic documents filtering that can discard irrelevant material before it enters the context window. Neither provider publishes a guaranteed token-savings figure for this workflow.

How live search can use fewer tokens

A search-enabled agent can retrieve current information instead of relying only on what the model learned during training. But retrieved text also uses context. The practical goal is not to minimize context at any cost; it is to provide enough relevant evidence to answer the task, while excluding material the model does not need.

As an Amazon Associate I earn from qualifying purchases.

There are two useful controls: limit the amount of search context returned, and filter retrieved content before it reaches the model. These reduce unnecessary context as a mechanism, not as a promise of a particular number or percentage of tokens saved. The right amount depends on the query and the evidence needed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure search as a tool, not a prompt instruction

In OpenAI’s Agents API documentation, web search is an explicitly configured tool. The documentation states that omitting the web_search tool turns built-in search off, even if an instruction tells the agent to search. The tool can be configured for live, cached, or disabled access, and its context_size setting offers low, medium, and high; the documented default is medium. See OpenAI’s web-search guide for current API details.

Start with the smallest context setting that can plausibly support the task, then increase it if results are too thin or the answer lacks evidence. The labels describe context configuration, not a guaranteed token count or quality level. Check the documentation for the API path and settings you actually use, since tool behavior and defaults can change.

Filter results before they enter the context window

Anthropic documents dynamic filtering for a newer version of its web-search tool. In supported configurations, code can keep relevant results and discard other material before it reaches the model. This is useful when a search returns many candidates but only a few are pertinent to the question. Availability depends on the documented model, platform, and tool version; consult Anthropic’s web-search documentation for current support and setup.

Filtering should preserve evidence, not merely shorten text. Keep the result’s source and the passages that support the answer; discard unrelated results and boilerplate. If filtering removes qualifications, dates, or context needed to interpret a claim, the smaller input may produce a less reliable answer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fetch a page only when search results are not enough

Search and fetch serve different purposes. Search helps locate potentially useful sources. Fetch retrieves content from a particular page when a result snippet or search response does not provide enough evidence. Anthropic documents web fetch and content filtering for this path; see Anthropic’s web-fetch documentation.

  1. Search first. Use the search result to identify relevant pages and determine whether the returned evidence answers the question.
  2. Fetch selectively. Retrieve a specific page when you need fuller context, not every page that appeared in search.
  3. Filter fetched content. If the supported fetch workflow allows filtering, keep passages relevant to the question and necessary qualifications rather than forwarding an entire page by default.
  4. Ground the answer. Retain source information and ensure citations point to evidence that actually supports the final claims.

Choose a search setup that fits the task

There is no universally best configuration in the cited documentation. Compare the options against the task’s needs:

  • Freshness: Decide whether the answer needs live access or whether a cached mode is adequate. OpenAI documents live, cached, and disabled modes.
  • Context control: OpenAI documents low, medium, and high context-size choices. Anthropic documents dynamic filtering for supported search-tool configurations.
  • Depth of evidence: Use search results when they contain enough information; use fetch when a particular page needs closer examination.
  • Source visibility: Preserve citations and inspect whether the cited material supports the answer. Both providers document citations in their search workflows.
  • Compatibility and operations: Verify supported models, platforms, tool versions, parameters, and current API constraints in the relevant provider documentation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Measure token use without sacrificing answer quality

The documentation describes mechanisms for limiting or filtering context, but it does not establish a token-savings percentage or prove that smaller context always improves answers. Measure your own agent on representative tasks before claiming a reduction or changing defaults broadly.

  1. Choose representative queries, including cases that need a brief fact and cases that need multiple sources or fuller page context.
  2. Run the same tasks with your baseline and candidate search settings.
  3. Log input tokens and output tokens, along with latency and whether the answer is complete.
  4. Check citation quality: confirm that cited sources support the claims and that filtering did not remove relevant qualifications.
  5. Compare the trade-off. Keep the lower-context configuration only where it retains the evidence and answer quality the task requires.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.