You are here:
Search the Web with Agentforce
Use the Search the Web action to retrieve real-time information from the internet for your agents and prompt templates. Search the Web lets you ground agents with current data like news, market trends, and competitor details that aren't available in Salesforce.
The Search the Web action retrieves current information from the internet for use in agents and prompt templates. Unlike data libraries, which require you to index content in advance, Search the Web retrieves information each time the action runs. It queries a search provider, retrieves relevant results, and summarizes them for use in the generated response. When the Search the Web action runs in a prompt template, the generated response includes citations to the web sources used.
Use Search the Web for information like:
- Breaking news and current events
- Market trends and industry developments
- Competitor information
- Product comparisons and reviews
- Public regulatory information
Search the Web complements Salesforce data instead of replacing it. For example, an agent can retrieve account information from Salesforce and combine it with current industry news from the web to generate more relevant responses.
Search the Web vs. Data Libraries
While both Search the Web and data libraries enhance AI responses with additional context, they serve different purposes and work in different ways.
Use Search the Web when you need real-time information from the internet. Use data libraries when you need to ground responses in proprietary knowledge, product documentation, or internal content that isn't publicly available. For many use cases, you'll use both. For example, an agent helping a financial services customer might use a data library to retrieve internal product documentation and use web search to retrieve current market conditions or regulatory news.
| Feature | Search the Web | Data Libraries |
|---|---|---|
| Data source | Public internet | Indexed internal content |
| When data is retrieved | Each time the action runs | Indexed in advance |
| Best for | Current, changing information | Stable organizational knowledge |
| Examples | News, competitor information, regulations | Knowledge articles, product docs, uploaded files |
Use Search the Web
You can use the Search the Web action in both agents and prompt templates to retrieve current information from the internet.
To add Search the Web to your agent, you can:
- Add the out-of-the-box General Web Search subagent from the asset library. This subagent comes preconfigured with the Search the Web action and instructions optimized for web search queries.
- Add the Search the Web action from the asset library to any existing subagent. You'll need to update the subagent's instructions to guide when and how the agent should use web search.
In agents, the action runs during conversations when the agent determines that web information is needed. See Agentforce Platform | Search the Web. In prompt templates, the action runs when the prompt template is executed, allowing generated responses to combine Salesforce record data with current web information. See Add the Search the Web Action to a Prompt Template.
Search Providers
Search the Web supports multiple search providers. If you don't specify a provider, the action uses BrightData by default.
| Search provider | Default rate limit |
|---|---|
| BrightData | 1,000 queries per hour per org (configurable through Salesforce Support) |
| OpenAI | 500 requests per minute per org through the Large Language Model Gateway |
| You.com | Rate limits vary |
To change the search provider, see Set the Search Provider for Search the Web Agent Action.
Control Search Results
Control which websites Search the Web uses by configuring allowed domains or excluded domains for each action. Configure either allowed domains or excluded domains for an action. Using both can significantly limit the available search results.
Allowed domains restrict searches to up to 10 trusted websites. Use allowed domains when you want responses only from specific, authoritative sources. For example, if you're building an agent that answers questions about federal regulations, you might restrict web search to government websites like fda.gov, sec.gov, and irs.gov. See Customize Allowed Domains for the Search the Web Agent Action.
Excluded domains search the open web while excluding up to 10 websites. Use excluded domains when you want broad search coverage but need to avoid specific sites. For example, you might exclude competitor websites or user-generated content sites that don't meet your quality standards. See Customize Excluded Domains for the Search the Web Agent Action.
- Set the Search Provider for Search the Web Agent Action
Improve the accuracy of web search responses by setting the search provider for the Search the Web agent action. - Customize Allowed Domains for the Search the Web Agent Action
Limit web search results to specified websites by defining allowed domains for the Search the Web agent action so your agents retrieve information from trusted sources. - Customize Excluded Domains for the Search the Web Agent Action
Limit web search results by excluding specific websites from the Search the Web agent action. Exclude the domains you don't want so your agents skip those sources and retrieve more relevant information. - Add the Search the Web Action to a Prompt Template
Add the Search the Web data action to a prompt template so your prompt can include current information from the web, such as current events, industry trends, and product information.
