kirha logo

Search

Pass a natural language query to kirha.search(query, options?). The SDK sends it to Kirha's planning engine, which determines the right data providers to call, executes them, and returns the results.

import { Kirha } from "kirha";

const kirha = new Kirha({
  apiKey: process.env.KIRHA_API_KEY,
  vertical: "crypto",
});

const result = await kirha.search("What is the TVL of Aave?"); 
console.log(result.data); 

Cross-vertical search (beta)

Omitting the vertical parameter searches across all available tools. This is currently in beta and results are less accurate than when targeting a specific vertical.

Summarization

Enable summarization to get a concise answer generated from the aggregated data. Two models are available:

ModelBest for
kirhagpt-5.2
kirha-flashUse gemini 3 flash, faster summarization
import { Kirha } from "kirha";

const kirha = new Kirha({
  apiKey: process.env.KIRHA_API_KEY,
  vertical: "crypto",
});

const result = await kirha.search("What is the TVL of Aave?", {
  summarization: "kirha-flash", 
});

console.log(result.summary);

Summarization with custom instruction

You can pass a custom instruction to control how the summary is formatted:

import { Kirha } from "kirha";

const kirha = new Kirha({
  apiKey: process.env.KIRHA_API_KEY,
  vertical: "crypto",
});

const result = await kirha.search("current portfolio of the largest USDC holder on Base", {
  summarization: { 
    model: "kirha-flash", 
    instruction: "Format as a markdown table with columns: Address, Amount", 
  }, 
});

console.log(result.summary);

Raw data

Raw data is included by default. It contains the structured output from each data provider. Set includeData to false if you only need the summary.

import { Kirha } from "kirha";

const kirha = new Kirha({
  apiKey: process.env.KIRHA_API_KEY,
  vertical: "crypto",
});

const result = await kirha.search("current portfolio of the largest USDC holder on Base", {
  summarization: "kirha-flash",
  includeData: false, 
});
console.log(result.summary); 

To inspect which tools were called, enable planning in the response:

import { Kirha } from "kirha";

const kirha = new Kirha({
  apiKey: process.env.KIRHA_API_KEY,
  vertical: "crypto",
});

const result = await kirha.search("current portfolio of the largest USDC holder on Base", {
  includePlanning: true, 
});
console.log(result.planning); 

Search options

Prop

Type

SummarizationConfig

Prop

Type

On this page