Getting Started
Getting started with web search - basic usage, async patterns, agent integration
Basic Usage
Simple Search
// Search with default HTTP provider
var results = aiWebSearch( "BoxLang programming language" )
// Results is an array of search result structs
results.each( result => {
println( "Title: #result.title#" )
println( "URL: #result.url#" )
println( "Snippet: #result.snippet#" )
println( "---" )
} )Selecting a Provider
// Use HTTP (default) - no API key needed
var results = aiWebSearch( "AI news", { provider: "http" } )
// Use Brave Search
var results = aiWebSearch(
"AI news",
{ provider: "brave", maxResults: 10 }
)
// Use Google Custom Search
var results = aiWebSearch(
"BoxLang",
{ provider: "google", maxResults: 5 }
)
// Use Tavily (AI-optimized)
var results = aiWebSearch(
"latest AI models",
{ provider: "tavily", maxResults: 15 }
)
// Use Exa (neural/semantic)
var results = aiWebSearch(
"semantic search techniques",
{ provider: "exa", maxResults: 5 }
)Limiting Results
Async/Non-Blocking Search
Working with Results
Filtering Results
Extracting Data
Sorting Results
Agent Integration
Basic Agent with Web Search
Multi-Tool Agent
Research Task Agent
With Memory
Combining Web Search and Conversation Memory
Web Search + Vector Memory (RAG)
Error Handling
Catching Search Errors
Rate Limiting
Performance Tips
Caching Results
Parallel Searches
Next Steps
Last updated