kirha logo

AI SDK

The @kirha/ai-sdk package provides a ready-made Vercel AI SDK tool that plugs Kirha search into any LLM with a single function call. No manual tool conversion needed.

GitHubkirha-ai/ai-sdk

2

Installation

npm install @kirha/ai-sdk
pnpm add @kirha/ai-sdk
yarn add @kirha/ai-sdk
bun add @kirha/ai-sdk

Quick start

import { generateText, stepCountIs } from "ai";
import { openai } from "@ai-sdk/openai";
import { searchTool } from "@kirha/ai-sdk"; 

const { text } = await generateText({
  model: openai("gpt-5.2"),
  tools: { search: searchTool({ vertical: "crypto" }) }, 
  stopWhen: stepCountIs(3),
  prompt: "What are the top crypto trends today?",
});

console.log(text);

Configuration

Pass options to searchTool() to control the vertical, summarization, and data inclusion:

import { searchTool } from "@kirha/ai-sdk";

const tool = searchTool({ 
  apiKey: process.env.KIRHA_API_KEY, 
  vertical: "crypto", 
  summarization: "kirha-flash", 
  includeData: true, 
}); 
OptionDescriptionDefault
apiKeyKirha API keyKIRHA_API_KEY env var
verticalFocus searches on a specific verticalAll verticals
summarization"kirha", "kirha-flash", or a config objectDisabled
includeDataInclude raw data from providerstrue
includePlanningInclude the execution planfalse
descriptionCustom tool description for the modelDefault

Kirha SDK vs AI SDK tool

Use @kirha/ai-sdk when you want a plug-and-play search tool for your AI agent. Use the Kirha TypeScript SDK directly when you need finer control over planning, tool execution, or custom pipelines.

On this page