For detailed information about what Tambo is and how it works, check out our docs site.
For a quick walkthrough of using the fundamental features of Tambo, check out this page.
tambo-ai is a client-side registry of React components that can be used by an LLM.
1. Register your components
constcomponents: TamboComponent[]=[{name: "Graph",description:
"A component that renders various types of charts (bar, line, pie) using Recharts. Supports customizable data visualization with labels, datasets, and styling options.",component: Graph,propsSchema: graphSchema,// zod schema},// Add more components];
2. Wrap your app in a TamboProvider
// In your chat page<TamboProviderapiKey={process.env.NEXT_PUBLIC_TAMBO_API_KEY!}components={components}><MessageThreadFullcontextKey="tambo-template"/></TamboProvider>
// App.jsximport{TamboProvider}from"@tambo-ai/react";import{WeatherCard}from"./components/WeatherCard";import{z}from"zod";// Define your componentsconstcomponents=[{name: "WeatherCard",description: "A component that displays weather information",component: WeatherCard,propsSchema: z.object({temperature: z.number(),condition: z.string(),location: z.string(),}),},];// Pass them to the providerfunctionApp(){return(<TamboProviderapiKey="your-api-key"components={components}><YourApp/></TamboProvider>);}
Register tools to make them available to the AI:
consttools: TamboTool[]=[{name: "getWeather",description: "Fetches current weather data for a given location",tool: async(location: string,units: string="celsius")=>{// Example implementationconstweather=awaitfetchWeatherData(location);return{temperature: weather.temp,condition: weather.condition,location: weather.city,};},toolSchema: z.function().args(z.string().describe("Location name (city)"),z.string().optional().describe("Temperature units (celsius/fahrenheit)"),).returns(z.object({temperature: z.number(),condition: z.string(),location: z.string(),}),),},];// Pass tools to the provider<TamboProviderapiKey="your-api-key"tools={tools}><YourApp/></TamboProvider>;
constmcpServers=[{url: "https://mcp-server-1.com",transport: "http",name: "mcp-server-1",},];// Pass MCP servers to the provider<TamboProviderapiKey={process.env.NEXT_PUBLIC_TAMBO_API_KEY!}components={components}><TamboMcpProvidermcpServers={mcpServers}>{children}</TamboMcpProvider></TamboProvider>;