Embedded analytics SDK - AI chat
Embedded analytics SDK is only available on Pro and Enterprise plans (both self-hosted and on Metabase Cloud). You can, however, play around with the SDK on your local machine without a license by using API keys to authenticate your embeds.
You can embed an AI chat in your application similar to Metabot in Metabase.
To help embedded Metabot more easily find and focus on the data you care about most, select the collection containing the models and metrics it should be able to use to create queries.
If you’re embedding the Metabot component in an app, you can specify a different collection that embedded Metabot is allowed to use for creating queries.
Chat preview
You can check out a demo of the AI chat component on our Shoppy demo site.
Example
import React from "react";
import {
MetabotQuestion,
MetabaseProvider,
defineMetabaseAuthConfig,
} from "@metabase/embedding-sdk-react";
const authConfig = defineMetabaseAuthConfig({
metabaseInstanceUrl: "https://your-metabase.example.com",
});
export default function App() {
return (
<MetabaseProvider authConfig={authConfig}>
<MetabotQuestion />
</MetabaseProvider>
);
}
API reference
Setting up AI chat
To configure your embedded AI chat in your Metabase:
- Click the gear icon in the upper right.
- Select Admin settings.
- Click the AI tab.
- In the left sidebar, click Embedded Metabot.
When embedding the Metabot component in your app, you should specify a collection that embedded Metabot is allowed to use for creating queries. Embedded Metabot will only have access to that collection.
For tips and more, see Metabot settings.
Read docs for other versions of Metabase.