Home/Tools/@takoviz/ai-sdk

takoSearch

@takoviz/ai-sdk

Search Tako's knowledge base for visualized data, insights, and information. Use this to find knowledge cards with charts, data visualizations, and well-sourced answers to questions.

by Tako

search
v1.0.1
MIT

Interactive Playground

Test @takoviz/ai-sdk (takoSearch) 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 @takoviz/ai-sdk
pnpm add @takoviz/ai-sdk
yarn add @takoviz/ai-sdk
bun add @takoviz/ai-sdk
deno add npm:@takoviz/ai-sdk

2. Import the tool

import { takoSearch } from '@takoviz/ai-sdk';

3. Use with AI SDK

import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { takoSearch } from '@takoviz/ai-sdk';

const result = await generateText({
  model: openai('gpt-4o'),
  tools: { takoSearch },
  prompt: 'Your prompt here...',
});

console.log(result.text);

Parameters

Available configuration options

Auto-extracted
query
Required
Type: string

The search query - use natural language to describe what you're looking for

Schema extracted: 1/20/2026, 3:49:58 AM

README

Tako AI SDK

Add powerful knowledge search with data visualizations to your AI applications using Tako's knowledge base.

Installation

npm install @takoviz/ai-sdk ai

Setup

Get your API key from the Tako Dashboard and set it as an environment variable:

export TAKO_API_KEY=your_api_key_here

Quick Start

import { takoSearch } from '@takoviz/ai-sdk';
import { generateText } from 'ai';

const { text } = await generateText({
  model: 'openai/gpt-4o-mini',
  prompt: 'What is the stock price of Nvidia?',
  tools: {
    takoSearch: takoSearch(),
  },
  maxSteps: 5,
});

console.log(text);

Configuration Options

You can customize the search behavior by passing a configuration object:

const { text } = await generateText({
  model: 'openai/gpt-4o-mini',
  prompt: 'What is the GDP of major economies?',
  tools: {
    takoSearch: takoSearch({
      apiKey: 'your_api_key', // Optional: override environment variable
      sourceIndexes: ['tako', 'web'], // Default: ['tako', 'web']
      searchEffort: 'deep', // Options: 'fast', 'deep', 'auto'. Default: 'fast'
      countryCode: 'US', // Default: 'US'
      locale: 'en-US', // Default: 'en-US'
      outputSettings: {
        knowledgeCardSettings: {
          imageDarkMode: true, // Default: false
        },
      },
    }),
  },
  maxSteps: 5,
});

API Reference

takoSearch(config?: TakoSearchConfig)

Creates a Tako knowledge search tool for use with Vercel AI SDK.

Parameters

  • config.apiKey (optional): Tako API key. Defaults to TAKO_API_KEY environment variable.
  • config.sourceIndexes (optional): Array of index sources to search. Options: 'tako', 'web', 'connected_data'. Default: ['tako', 'web'].
  • config.searchEffort (optional): Search depth. Options: 'fast', 'deep', 'auto'. Default: 'fast'.
  • config.countryCode (optional): ISO3166-1 alpha-2 country code. Default: 'US'.
  • config.locale (optional): Language/region identifier. Default: 'en-US'.
  • config.outputSettings (optional): Output customization options.

Returns

A Vercel AI SDK tool that accepts a natural language query and returns Tako knowledge cards with visualizations, data, and sources.

Response Format

The tool returns a TakoSearchResponse object:

{
  outputs: {
    knowledge_cards: [
      {
        card_id: string;
        title: string;
        description: string;
        webpage_url: string;
        image_url: string;
        sources: Array<{ source_name: string; url: string }>;
        visualization_data: {
          data: any[];
          viz_config: Record<string, any>;
        };
      }
    ];
    answer: string;
  };
  request_id: string;
}

TypeScript

This package includes full TypeScript type definitions. Import types as needed:

import type { TakoSearchConfig, TakoSearchResponse, TakoKnowledgeCard } from '@takodata/ai-sdk';

License

MIT

Links

Statistics

Downloads/month

162

GitHub Stars

0

Quality Score

59%

Bundle Size

NPM Keywords

tako
knowledge-search
ai-sdk
vercel
data-visualization
ai
tools

Maintainers

at_tako(adithya@trytako.com)
bobbytako(bobby@trytako.com)
alex.whitaker(alex.whitaker@trytako.com)

Frameworks

vercel-ai
takoSearch | TPMJS | TPMJS