Home/Tools/@airweave/vercel-ai-sdk

airweaveSearch

@airweave/vercel-ai-sdk

Provides unified search across all connected data sources using semantic search.

by Airweave

search
v0.1.1
MIT
⚠️

This tool is currently broken

Import Failed
Cannot load from Railway service
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

Interactive Playground

Test @airweave/vercel-ai-sdk (airweaveSearch) with AI-powered execution

0/2000 characters

Installation & Usage

Install this tool and use it with the AI SDK

1. Install the package

npm install @airweave/vercel-ai-sdk
pnpm add @airweave/vercel-ai-sdk
yarn add @airweave/vercel-ai-sdk
bun add @airweave/vercel-ai-sdk
deno add npm:@airweave/vercel-ai-sdk

2. Import the tool

import { airweaveSearch } from '@airweave/vercel-ai-sdk';

3. Use with 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);

AI Agent Integration

How AI agents can use this tool

Use Case

Use this tool to perform semantic searches across multiple data sources.

Examples

  • Search for key decisions from last week in the knowledge base.

Parameters

Available configuration options

Author-provided
defaultCollection
Required
Type: string

The default collection to search within.

Schema extracted: 3/1/2026, 1:19:51 AM

Try to auto-extract schema from the package

README

@airweave/vercel-ai-sdk

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.

Installation

npm install @airweave/vercel-ai-sdk

Quick Start

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

Configuration

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',
});

Environment Variables

  • AIRWEAVE_API_KEY - Your Airweave API key

Get your API key at app.airweave.ai/settings/api-keys

Features

  • Unified Search - Search across 35+ connected data sources with one API
  • Semantic Search - AI-powered search that understands meaning, not just keywords
  • Query Expansion - Automatically expands queries for better recall
  • Reranking - ML-based reranking for improved relevance
  • AI Answers - Optional AI-generated answers from search results

TypeScript Support

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
  };
}

Documentation

License

MIT

Statistics

Downloads/month

16

GitHub Stars

1

Quality Score

81%

Bundle Size

NPM Keywords

ai
vercel
airweave
search
rag
tool
ai-sdk
semantic-search

Maintainers

ewantauran(ewan@airweave.ai)
orhanrauf(rauf@airweave.ai)
lennert_airweave(lennert@airweave.ai)

Frameworks

vercel-ai