Skip to main content
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:
  1. Query Generation: Agent formulates search query based on user question
  2. Search Execution: Query is sent to search engine
  3. Result Retrieval: Top search results are retrieved
  4. Content Extraction: Relevant content is extracted from result pages
  5. Synthesis: Agent synthesizes information from multiple sources
  6. 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

Web Search with Filters

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

Let Agent Formulate Queries: The agent will automatically formulate effective search queries. Your prompt should focus on what information you need, not how to search for it.

Source Verification

Verify Critical Information: Web search returns information from the internet, which may not always be accurate. Always verify critical information from authoritative sources.

Performance Optimization

Integration with Other Primitives

With RAG

Combine internal knowledge with web research:
Learn more: RAG Primitive

With Memory

Remember research topics and preferences:
Learn more: Memory Primitive

With Workflows

Include web research in automated workflows:
Learn more: Workflow Primitive

Performance Considerations

Search Latency

  • Quick search: ~1-2 seconds
  • Standard search: ~2-4 seconds
  • Comprehensive search: ~4-8 seconds
Factors:
  • Number of results requested
  • Search depth
  • Content extraction complexity

Cost Optimization

Cache Common Queries: For frequently asked questions, consider caching results instead of repeated web searches.

Rate Limiting

Troubleshooting

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
Problem: Search returns off-topic resultsSolutions:
  • Make query more specific
  • Use domain filtering
  • Adjust prompt to be clearer
  • Use negative keywords
Problem: Results are old or outdatedSolutions:
  • Add time range filter
  • Specify need for recent information in prompt
  • Check source dates in citations
Problem: Searches taking too longSolutions:
  • Reduce maxResults
  • Use “quick” depth
  • Limit domains to search
  • Simplify query

Advanced Features

Search for multiple related topics:

Source Diversity

Ensure diverse perspectives:

Fact Verification

Cross-reference information:

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
Remember: Web search provides access to current information but requires verification. Always cite sources and encourage users to verify critical information from authoritative sources.