@airweave/vercel-ai-sdk
Provides unified search across all connected data sources using semantic search.
by Airweave
Tool "airweaveSearch" is a factory function but couldn't be initialized. Tried: no-args, config object, and single-arg patterns.
Last checked: 3/1/2026, 4:27:04 AM
Test @airweave/vercel-ai-sdk (airweaveSearch) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @airweave/vercel-ai-sdkpnpm add @airweave/vercel-ai-sdkyarn add @airweave/vercel-ai-sdkbun add @airweave/vercel-ai-sdkdeno add npm:@airweave/vercel-ai-sdkimport { airweaveSearch } from '@airweave/vercel-ai-sdk';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { airweaveSearch } from '@airweave/vercel-ai-sdk';
const result = await generateText({
model: openai('gpt-4o'),
tools: { airweaveSearch },
prompt: 'Your prompt here...',
});
console.log(result.text);How AI agents can use this tool
Use this tool to perform semantic searches across multiple data sources.
Available configuration options
defaultCollectionstringThe default collection to search within.
Schema extracted: 3/1/2026, 1:19:51 AM
Try to auto-extract schema from the package
Airweave search tool for the Vercel AI SDK. Search across all your synced data sources (Notion, Slack, Google Drive, databases, and 30+ more) in just a few lines of code.
npm install @airweave/vercel-ai-sdk
import { generateText, gateway, stepCountIs } from 'ai'; import { airweaveSearch } from '@airweave/vercel-ai-sdk'; const { text } = await generateText({ model: gateway('anthropic/claude-sonnet-4.5'), prompt: 'What were the key decisions from last week?', tools: { search: airweaveSearch({ defaultCollection: 'my-knowledge-base', }), }, stopWhen: stepCountIs(3), }); console.log(text);
airweaveSearch({ // API key (defaults to AIRWEAVE_API_KEY env var) apiKey: 'your-api-key', // Default collection to search defaultCollection: 'my-collection', // Max results per search (default: 10) defaultLimit: 20, // Generate AI answer from results (default: false) generateAnswer: true, // Query expansion for better recall (default: true) expandQuery: true, // Rerank for relevance (default: true) rerank: true, // Base URL for self-hosted instances baseUrl: 'https://your-instance.airweave.ai', });
AIRWEAVE_API_KEY - Your Airweave API keyGet your API key at app.airweave.ai/settings/api-keys
Full TypeScript types included:
import { airweaveSearch, AirweaveSearchOptions, AirweaveSearchResult, AirweaveSearchResultItem } from '@airweave/vercel-ai-sdk'; const config: AirweaveSearchOptions = { defaultCollection: 'my-collection', defaultLimit: 10, }; const search = airweaveSearch(config); // Result types interface AirweaveSearchResultItem { id: string; // Entity ID score: number; // Relevance score payload: { entity_id?: string; name?: string; created_at?: string; textual_representation?: string; airweave_system_metadata?: { source_name?: string; // e.g., "notion", "slack" entity_type?: string; // e.g., "NotionPageEntity" }; // Plus source-specific fields }; }
MIT
Downloads/month
16
GitHub Stars
1
Quality Score