Tavily is a web intelligence platform offering real-time web search optimized for AI applications. Tavily provides comprehensive web research capabilities including search, content extraction, website crawling, and site mapping to power AI agents with current information.
pnpm install @tavily/ai-sdk# Add to your .env fileTAVILY_API_KEY=your_api_key_hereimport { generateText, gateway, stepCountIs } from 'ai';import { tavilySearch } from '@tavily/ai-sdk';
const { text } = await generateText({ model: gateway('google/gemini-3-pro-preview'), prompt: 'What are the latest developments in agentic search?', tools: { webSearch: tavilySearch, }, stopWhen: stepCountIs(3),});
console.log(text);