| title | Modular embedding SDK - AI chat |
|---|---|
| summary | Embed an AI chat component in your app that can create queries from natural language questions. |
{% include plans-blockquote.html feature="Modular embedding SDK" sdk=true %}
You can embed an AI chat in your application similar to Metabot in Metabase.
Embedded Metabot is a more focused version of Metabot designed to work well in an embedded context. Embedded Metabot can only display ad-hoc questions and metrics; it doesn't know about dashboards.
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.
You can check out a demo of the AI chat component on our Shoppy demo site.
{% include_file "{{ dirname }}/snippets/questions/ai-question.tsx" %}{% include_file "{{ dirname }}/api/snippets/MetabotQuestionProps.md" snippet="properties" %}
To configure your embedded AI chat in your Metabase:
- Click the grid icon in the upper right.
- Select Admin.
- 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.
Use the layout prop to specify which layout to use for the Metabot component:
auto(default): Metabot uses thestackedlayout on mobile screens, and asidebarlayout on larger screens.stacked: the question visualization stacks on top of the chat interface.sidebar: the question visualization appears to the left of the chat interface, which is on a sidebar on the right.
