@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
Test @takoviz/ai-sdk (takoSearch) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @takoviz/ai-sdkpnpm add @takoviz/ai-sdkyarn add @takoviz/ai-sdkbun add @takoviz/ai-sdkdeno add npm:@takoviz/ai-sdkimport { takoSearch } from '@takoviz/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);Available configuration options
querystringThe search query - use natural language to describe what you're looking for
Schema extracted: 1/20/2026, 3:49:58 AM
Add powerful knowledge search with data visualizations to your AI applications using Tako's knowledge base.
npm install @takoviz/ai-sdk ai
Get your API key from the Tako Dashboard and set it as an environment variable:
export TAKO_API_KEY=your_api_key_here
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);
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, });
takoSearch(config?: TakoSearchConfig)Creates a Tako knowledge search tool for use with Vercel AI SDK.
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.A Vercel AI SDK tool that accepts a natural language query and returns Tako knowledge cards with visualizations, data, and sources.
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; }
This package includes full TypeScript type definitions. Import types as needed:
import type { TakoSearchConfig, TakoSearchResponse, TakoKnowledgeCard } from '@takodata/ai-sdk';
MIT
Downloads/month
162
GitHub Stars
0
Quality Score