searchwebextraction

Parallel gives AI agents best-in-class tools to search and extract context from the web. Web results returned by Parallel are compressed for optimal token efficiency at inference time.

Installation

pnpm add @parallel-web/ai-sdk-tools
# Add to your .env file
PARALLEL_API_KEY=your_api_key_here

Usage

import { generateText, isStepCount } from 'ai';
import { searchTool, extractTool } from '@parallel-web/ai-sdk-tools';

const { text } = await generateText({
  model: 'google/gemini-3.1-pro-preview',
  prompt: 'When was Vercel Ship AI?',
  tools: {
    webSearch: searchTool,
    webExtract: extractTool,
  },
  stopWhen: isStepCount(3),
});

console.log(text);