# Let your AI agent search the web

> Let your intoCHAT agent look a question up on the web when your knowledge has no answer: turn it on, limit it to certain sites, what visitors see, costs and limits.

Your agent normally answers from your knowledge, your instructions and your actions. With web search on, it can also look a question up on the web when your knowledge doesn't answer it. The reply then says the information comes from the web and links the pages it used.

Web search is off by default. While it is off, the agent never searches the web.

## Turn it on

1. Open your agent and go to the **Setup** tab. The **Web search** card is below the rest of the tab's settings.
2. Switch on **Search the web**.
3. Optionally, list the sites it may search under **Only search these sites (optional)**. See below.
4. Click **Save web search**. The card is saved on its own: **Save changes** in the header doesn't save it, and **Save web search** doesn't save the rest of the tab.
5. Try it in the **Playground** with a question your knowledge doesn't cover. The Playground uses the saved setting, so save first.

## Limit it to certain sites

Leave **Only search these sites (optional)** empty to search the whole web. To search only some sites, such as your supplier's documentation or an official register, enter one site per line, up to 20.

- Enter whole sites, such as `example.com`. Subdomains are included, so `example.com` also covers `docs.example.com`.
- `https://` in front, a `/` at the end and `*.` in front are accepted and removed.
- Paths such as `example.com/blog`, ports, IP addresses and `localhost` aren't accepted. The card then shows "Not a site name:" followed by the entry, and **Save web search** stays greyed out until you correct it.
- Pages outside the list are never linked under a reply, even if the search returned them.

The field is greyed out while **Search the web** is off.

## When the agent searches

- Only when your knowledge doesn't answer the visitor's question and the question fits your [instructions and guardrails](/en/docs/instructions). The agent is told never to search for off-topic requests, for anything your instructions or guardrails rule out, or to look up private individuals. Your guardrails also apply to what it finds.
- It prefers your knowledge whenever it covers the question. The AI model decides when to search, so it can still search now and then when you wouldn't have.
- At most once per reply.
- The agent writes a short search query. It is told to leave out the visitor's personal details, such as names, email addresses, phone numbers and order numbers. Only the query is searched, not the visitor's whole message.
- The search waits up to 15 seconds. If it takes longer, fails or finds nothing useful, the agent says briefly that it couldn't look it up and helps with what it knows.

Web search also works in temporary chats.

## What visitors see

The reply says the information comes from the web and doesn't present it as your business's own. Under the reply, a line starting with "From the web" links to up to 3 pages the search used. Each link shows the page's name and opens it in a new tab.

- The links come from the citations OpenAI returns with the search result. The AI model that writes the reply doesn't choose or write them.
- The line appears whatever **Show sources under replies** on the [Appearance](/en/docs/appearance) tab says. When that switch is on, the "Sources" line for your own pages appears too.
- "From the web" follows the **Widget language**: "Aus dem Web", "Sur le web", "Dal web" or "De la web".
- No links appear under a reply that shows a [chat form](/en/docs/chat-forms), confirms a [hand-off by email](/en/docs/handoff), brings up the [lead form](/en/docs/lead-collection), or has no text.

Web results can be wrong or out of date, and intoCHAT doesn't control which pages a search finds. For facts that must be right, such as prices or policies, add them to your knowledge, for example as a [Q&A pair](/en/docs/text-and-qa).

## In your transcripts

On the **Conversations** tab, open **Why this answer** under a reply. When the agent searched, **Actions called** lists "Web search" with the query in quotes, **Succeeded** or **Failed**, and links to the pages the search cited, up to 5. See [Conversations and stats](/en/docs/conversations-and-dashboard#why-this-answer).

## Costs

- Searches run through OpenAI's web search. intoCHAT sends the query to OpenAI, which runs the search and returns a short answer with the pages it cited.
- A search doesn't cost you an extra message. Each reply counts as one message, with or without a search. See [Plans and limits](/en/docs/plans-and-limits).
- A reply with a search takes longer, because the agent waits for the result before it answers.

## Limits

- One search per reply, waiting up to 15 seconds.
- Up to 20 sites in the list, whole sites only.
- Up to 3 links under a reply.
- Web search isn't an action and doesn't count toward the limit of 25 actions.
- An enabled [client-side action](/en/docs/client-actions) named `search_web`, or anything that becomes it, such as "search web", turns web search off while it is enabled, even with the switch on, because your page's handler is registered under that exact name. The card doesn't warn you; rename or disable that action. [API actions](/en/docs/api-actions) and [custom buttons](/en/docs/custom-buttons) with that name are renamed behind the scenes and don't get in the way.
- A [duplicated agent](/en/docs/quick-start) copies the switch and the list of sites.

## Next steps

- Make sure the agent finds your own content first: [How answers work](/en/docs/how-answers-work).
- Set what is in scope for the agent: [Instructions](/en/docs/instructions).
- Show links to your own pages too: [Appearance](/en/docs/appearance).
