searchextractcrawl

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.

Installation

pnpm
npm
yarn
bun
pnpm install @tavily/ai-sdk
# Add to your .env file
TAVILY_API_KEY=your_api_key_here

Usage

import { 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);