Web Search Tool
The Web Search tool allows Agents to search the web and retrieve real-time information.
When to Use
- Need latest information (news, stock prices, weather, etc.)
- Need supplementary information outside the knowledge base
- User questions involve external resources
Setup Steps
Step 1: Add Web Search Tool
In the Tools section, click "Add Tool" and select "Web Search".
Step 2: Set Domain Restrictions (Optional)
You can restrict the Agent to search only specific domains to avoid information noise.
Format: Separate multiple domains with commas
example.com, docs.example.com, support.example.com
Supported formats:
- Domain name only:
example.com - Including subdomains:
docs.example.com - Full URL (domain will be automatically extracted):
https://example.comorhttp://example.com
Format Validation
- The system will validate domain formats in real-time. If the format is incorrect (e.g., contains spaces, invalid characters), the input box will show a red border and display an error message.
- Please ensure each domain is in a valid format, otherwise the settings cannot be saved.
Multiple Domain Behavior
- When you enter multiple domains, the Agent will search all specified domains simultaneously when performing web searches
- For example, if you set "bbc.com, cnn.com, aljazeera.com" for three news media domains, the Agent will only search these three news media sites
Use Cases:
- Search only official documentation sites
- Search only trusted information sources
- Limit to websites in specific industries or domains
No Restrictions
- If left blank, the Agent can search any website.
- Suitable for scenarios requiring broad information.
Step 3: Set "When to Use"
Tell the Agent when to use web search, and you can also suggest which "search keywords" will yield better results in When to Use.
Examples:
Only use web search in the following situations:
- User explicitly requests to check latest news
- Knowledge base has no relevant information and the question requires real-time data
- Need to query external reference materials
Prioritize information from official sources when searching.
When users ask about market trends, competitor information, or industry news, use web search.
Search results must be annotated with source URLs.
Step 4: Confirm Addition
Click confirm, and the tool will appear in the Tools list.
Using with Knowledge Base
Web Search is typically used as a supplement to Knowledge Base:
## Agent Instruction Example
Answer sequence:
1. Query product knowledge base first
2. If knowledge base has no answer and the question requires real-time information, then use web search
3. If neither has an answer, honestly inform the user
Tool List Display
Added Web Search tools are displayed in the "Web Search" group under the "Tools" section:
- If no domain restrictions are set: Shows "Web Search" label
- If domain restrictions are set: Shows "Web Search" label with domain restrictions displayed next to it (e.g.,
example.com, docs.example.com)
You can expand the tool to view detailed settings (including domain restrictions and "When to Use"), or click the delete button to remove the tool.
Testing the Tool
After adding, test if the Agent uses it correctly:
- Ask a question that requires real-time information (e.g., "Today's XX news")
- Observe whether the Agent used web search
- Check if results come from correct domains (if restrictions were set)
Best Practices
Set Clear Trigger Conditions
Avoid the Agent over-relying on web search, which can lead to:
- Longer response times
- Citing unreliable sources
- Ignoring existing knowledge base content
Limit to Trusted Domains
For professional fields, it's recommended to limit the search scope:
| Field | Recommended Domains |
|---|---|
| Technical documentation | docs.*.com, official documentation sites |
| Legal information | Government official websites |
| Industry news | Well-known industry media |
Require Source Annotation
Add to When to Use:
Search results must be annotated with source URLs so users can verify.
Common Questions
What if search results are inaccurate?
Try:
- In "When to Use" or "Core Instruction", suggest relevant "search keywords" or "search topics" to the Agent
- Restrict search domains to trusted sources
- Require cross-verification in "When to Use" or "Core Instruction"
- Use knowledge base with priority
What if search is too slow?
Web search requires real-time queries and will be slower than knowledge base queries. Suggestions:
- Set clear trigger conditions to reduce unnecessary searches
- In "Core Instruction", require the Agent to inform users that "querying real-time information requires more time"
Can I search websites in specific languages?
Currently there's no language filtering feature, but you can achieve similar effects through domain restrictions (e.g., restrict to .tw domains).
Why can't I save domain settings?
Possible reasons:
- Domain format is incorrect (contains spaces, invalid characters, etc.)
- Domain doesn't comply with URL or hostname specifications
Please check the entered domain format and ensure: - Each domain is in a valid format - Multiple domains are separated by commas with a space after each comma - No invalid characters or incorrectly formatted URLs
If the problem persists, try entering domains one by one for testing.
Next Steps
- Knowledge Base - Connect your data
- Call Agent - Delegate tasks
- Back to Tools Overview