tambo-ai

V 1.0.0 Coming Soon

These are draft docs for the upcoming 0.1.0 release. Read more about the upcoming release here. Have a question about anything in the docs? Send us a message.

Initial tambo Setup

Learn how to set up and configure tambo for building a CRM chat assistant.

In this quickstart, we'll build an AI-powered CRM assistant that helps users manage customer notes and emails. We'll start by setting up the core tambo configuration.

1. Adding the Context Provider

Make sure to set your NEXT_PUBLIC_TAMBO_API_KEY in your environment variables before initializing the application.

Next, wrap your application with the TamboProvider to make tambo's functionality available throughout your app.

What's happening here:

  • Wrap your application with the TamboProvider to make tambo's functionality available throughout your app.

Implementing the App Wrapper

src/App.tsx
import { TamboProvider } from "tambo-react";
import { initializeTambo } from "./config/tamboConfig";
 
export const App = (): ReactElement => {
  const tamboConfig = initializeTambo();
 
  return (
    <TamboProvider config={tamboConfig}>
      {/* Your app components */}
    </TamboProvider>
  );
};

2. Configure tambo

Definitions:

  • tambo Config: The configuration for the tambo SDK
  • Personality: The personality of the AI assistant
  • Tool Registry: A registry of tools (sometimes called function calls) that the AI can use to interact with the world
  • Component Registry: A registry of UI components that the AI can use to interact with the user

The personality configuration defines how our CRM assistant will interact with users.

What's happening here:

  • Define personality configuration
  • Define tool registry
  • Define component registry
  • Initialize tambo with all the necessary configuration
We will add tools, and components latter in this quickstart.
src/config/tamboConfig.ts
import {
  createTamboComponentRegistry,
  createTamboToolRegistry,
} from "tambo-react";
 
const personality = {
  role: `You are a helpful CRM assistant focused on helping users manage customer interactions. You specialize in helping users create notes, edit them, and convert them into follow-up emails.`,
 
  style: `You communicate professionally while helping users manage their customer relationships efficiently. You provide clear suggestions for notes and emails while maintaining a helpful, business-appropriate tone.`,
 
  rules: [
    "Always confirm the customer/lead context before taking actions",
    "Provide clear previews of generated content",
    "Maintain professional language in generated emails",
    "Ask for clarification when customer details are unclear",
  ],
};
 
// Create registries for tools and components
export const toolRegistry = createTamboToolRegistry({
  // Tool definitions will be added here
});
 
export const componentRegistry = createTamboComponentRegistry({
  // Component definitions will be added here
});
 
export const initializeTambo = (): TamboConfig => {
  if (!process.env.NEXT_PUBLIC_TAMBO_API_KEY) {
    throw new Error("NEXT_PUBLIC_TAMBO_API_KEY is not set");
  }
 
  return {
    apiKey: process.env.NEXT_PUBLIC_TAMBO_API_KEY,
    toolRegistry,
    componentRegistry,
    personality,
    // debug: true, // Optional: Enable for development
  };
};

What you have now?

  • Defined the function and personality of your AI assistant
  • Created empty registries for tools and components
  • Initialized tambo with the necessary configuration
  • You know have access to the powerful context hooks to create a chat interface

In the next section, we'll use the context hooks to create a chat interface.

On this page