Use this file to discover all available pages before exploring further.
Web Search lets your agents search the internet for up-to-date information. It works as both a programmatic function and an agent tool that the LLM can invoke automatically.
The simplest way to give your agent search capabilities:
import { Agent, openai, createWebSearchTool } from '@runflow-ai/sdk';const agent = new Agent({ name: 'Research Agent', instructions: 'You help users research topics using the internet.', model: openai('gpt-4o'), tools: { search: createWebSearchTool({ provider: 'tavily', apiKey: process.env.TAVILY_API_KEY, }), },});const result = await agent.process({ message: 'What are the latest developments in AI agents?',});
The agent will automatically decide when to search the internet based on the user’s question.
{ query: "Runflow AI platform", answer: "Runflow is an AI agent platform...", // Tavily only results: [ { title: "Runflow - Build AI Agents", url: "https://runflow.ai", snippet: "Platform for building and deploying AI agents...", content: "Full page content...", // When includeContent is true score: 0.95, publishedDate: "2026-03-01" } ]}