Web Search empowers agents to find current information on the internet, access news, research topics, and retrieve up-to-date data beyond their training cutoff.
Overview
The Web Search primitive gives agents the ability to search the internet in real-time, enabling them to access current information, news, facts, and data that may not be in their training data or your internal knowledge bases. This bridges the gap between static knowledge and dynamic, ever-changing web content. Web Search is essential for:- Current Events: Access latest news and developments
- Real-Time Data: Get current prices, weather, sports scores, etc.
- Research: Find information on any topic from the web
- Fact-Checking: Verify information against multiple sources
- Market Intelligence: Research competitors, trends, and market data
- Comprehensive Answers: Combine internal knowledge with web content
Real-Time Access
Search current web content, not limited to training data cutoff
Multiple Sources
Aggregate information from multiple search results automatically
Safe Search
Built-in content filtering and safe search capabilities
Source Citations
Automatically cite web sources with URLs
How Web Search Works
When web search is enabled:- Query Generation: Agent formulates search query based on user question
- Search Execution: Query is sent to search engine
- Result Retrieval: Top search results are retrieved
- Content Extraction: Relevant content is extracted from result pages
- Synthesis: Agent synthesizes information from multiple sources
- Citation: Sources are cited with URLs in the response
Privacy: Web searches are performed on behalf of your agent. Search queries and results are processed in accordance with your privacy settings.
Code Examples
Basic Web Search
Web Search with Filters
Domain-Specific Search
Combining Web Search with RAG
Controlling Number of Search Results
Use Cases
1. News and Current Events
Stay informed on latest developments:2. Market Research
Research competitors and market trends:3. Real-Time Data Lookup
Access current information:4. Academic Research
Find scholarly articles and papers:5. Product Recommendations
Research and recommend products:6. Technical Troubleshooting
Find solutions to technical problems:7. Travel Planning
Research destinations and travel information:Best Practices
Query Formulation
Good Search Prompts
Good Search Prompts
Specify Time Sensitivity
Specify Time Sensitivity
Use Domain Filtering Wisely
Use Domain Filtering Wisely
Source Verification
Performance Optimization
Safe Search
Integration with Other Primitives
With RAG
Combine internal knowledge with web research:With Memory
Remember research topics and preferences:With Workflows
Include web research in automated workflows:Performance Considerations
Search Latency
- Quick search: ~1-2 seconds
- Standard search: ~2-4 seconds
- Comprehensive search: ~4-8 seconds
- Number of results requested
- Search depth
- Content extraction complexity
Cost Optimization
Rate Limiting
Troubleshooting
No Results Found
No Results Found
Problem: Web search returns no resultsSolutions:
- Broaden search query
- Remove strict domain filters
- Adjust time range filter
- Check if query is too specific
- Verify search is enabled
Irrelevant Results
Irrelevant Results
Problem: Search returns off-topic resultsSolutions:
- Make query more specific
- Use domain filtering
- Adjust prompt to be clearer
- Use negative keywords
Outdated Information
Outdated Information
Problem: Results are old or outdatedSolutions:
- Add time range filter
- Specify need for recent information in prompt
- Check source dates in citations
Slow Search Performance
Slow Search Performance
Problem: Searches taking too longSolutions:
- Reduce maxResults
- Use “quick” depth
- Limit domains to search
- Simplify query
Advanced Features
Multi-Query Search
Search for multiple related topics:Source Diversity
Ensure diverse perspectives:Fact Verification
Cross-reference information:Related Primitives
RAG
Search internal documents and knowledge bases
Crawl & Scrape
Extract content from specific websites
Memory
Remember previous research and topics
Workflows
Automate research workflows
Additional Resources
API Reference
Complete web search API docs
Search Best Practices
Optimize search effectiveness
Examples
Web search examples