> ## Documentation Index
> Fetch the complete documentation index at: https://docs.budecosystem.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Search

> DuckDuckGo-backed web search that returns titles, URLs, and snippets to the agent

## Overview

Web Search lets an agent issue free-text queries against the public web and receive a list of results — title, URL, and a short snippet — that the LLM can reason over or cite. The tool is backed by DuckDuckGo so no API key or per-project quota setup is required.

```mermaid theme={null}
sequenceDiagram
    participant A as Agent
    participant L as LLM
    participant T as web_search Tool
    participant D as DuckDuckGo

    A->>L: Run prompt with web_search enabled
    L->>T: Call tool with a query string
    T->>D: Issue text search
    D-->>T: Results (title / URL / snippet)
    T-->>L: Structured results list
    L-->>A: Final answer (optionally citing URLs)
```

## When to Use It

* The model needs **fresh** information that may not be in its training data — recent news, current pricing, latest releases.
* You want the model to **discover candidate sources** before fetching them with Web Fetch.
* You need lightweight grounding without standing up a retrieval pipeline.

Web Search is not a substitute for vetted internal knowledge — for proprietary or compliance-sensitive content, prefer a retrieval connector backed by your own index.

## Configuration

The tool exposes a single optional field on the prompt version.

| Field         | Type    | Default | Description                                                                      |
| ------------- | ------- | ------- | -------------------------------------------------------------------------------- |
| `max_results` | integer | `null`  | Maximum number of search results to return. `null` returns the first batch only. |

The defaults work well for general-purpose agents. Increase `max_results` only when you need broader coverage and your downstream prompt can handle the larger context.

## How Results Are Returned

Each result is a small object with three fields:

* `title` — page title as indexed
* `href` — destination URL
* `body` — short snippet (typically 1-3 sentences)

The list is passed to the LLM as the tool's output; the model decides whether to cite, summarise, or follow up by fetching one of the URLs.

## Operational Considerations

* **No caching** — every tool call hits DuckDuckGo. Repeated identical queries inside the same session will issue repeated network requests.
* **No authentication** — results reflect the public web view; logged-in or paywalled content is not accessible.
* **Latency** — typical responses complete in 1-3 seconds depending on query and upstream load.
* **Result quality** — DuckDuckGo's index lags Google for some long-tail queries. Pair with Web Fetch for follow-up reading on candidate URLs.
* **Content trust** — treat returned snippets as untrusted user-supplied data; downstream prompts should not interpret them as instructions.

## Next Steps

<CardGroup cols={2}>
  <Card title="Web Fetch" icon="globe" href="/prompts-agents/guides/native-tools/web-fetch">
    Follow up on a search result by fetching the full page as markdown
  </Card>

  <Card title="Native Tools Overview" icon="toolbox" href="/prompts-agents/guides/native-tools/introduction">
    How native tools differ from MCP connectors
  </Card>
</CardGroup>
