Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

docs - embedding chat (#63259)

Jeff Bruemmerb9838f7cf7cb
diff --git a/docs/embedding/images/ai-chat.png b/docs/embedding/images/ai-chat.png
new file mode 100644
index 00000000000..05c24472abd
Binary files /dev/null and b/docs/embedding/images/ai-chat.png differ
diff --git a/docs/embedding/sdk/ai-chat.md b/docs/embedding/sdk/ai-chat.md
new file mode 100644
index 00000000000..1dbd056f8fb
--- /dev/null
+++ b/docs/embedding/sdk/ai-chat.md
@@ -0,0 +1,42 @@
+---
+title: "Embedded analytics SDK - AI chat"
+summary: Embed an AI chat component in your app that can create queries from natural language questions.
+---
+
+# Embedded analytics SDK - AI chat
+
+![Embedded AI chat](../images/ai-chat.png)
+
+{% include plans-blockquote.html feature="Embedded analytics SDK" sdk=true %}
+
+You can embed an AI chat in your application similar to [Metabot](../embedded-analytics-js.md) 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](https://embedded-analytics-sdk-demo.metabase.com/admin/analytics/new/ask-metabot) on our Shoppy demo site.
+
+## Example
+
+```typescript
+{% include_file "{{ dirname }}/snippets/questions/ai-question.tsx" %}
+```
+## API reference
+
+- [Component](./api/MetabotQuestion.html)
+
+## Setting up AI chat
+
+To configure your embedded AI chat in your Metabase:
+
+1. Click the **gear** icon in the upper right.
+2. Select **Admin settings**.
+3. Click the **AI** tab.
+4. 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](../../ai/settings.md).
diff --git a/docs/embedding/sdk/introduction.md b/docs/embedding/sdk/introduction.md
index a95e23ff9f5..27e3572ef23 100644
--- a/docs/embedding/sdk/introduction.md
+++ b/docs/embedding/sdk/introduction.md
@@ -91,6 +91,7 @@ Start with one of the quickstarts, then see these pages for more info on compone
- [Authentication](./authentication.md)
- [Questions](./questions.md)
+- [AI chat](./ai-chat.md)
- [Dashboards](./dashboards.md)
- [Appearance](./appearance.md)
- [Collections](./collections.md)
diff --git a/docs/embedding/sdk/questions.md b/docs/embedding/sdk/questions.md
index 85ecec318cb..876fc8efafa 100644
--- a/docs/embedding/sdk/questions.md
+++ b/docs/embedding/sdk/questions.md
@@ -71,6 +71,10 @@ You can pass parameter values to questions defined with SQL via the `initialSqlP
`initialSqlParameters` can't be used with questions built using the query builder.
+## Questions with natural language
+
+See [AI chat](./ai-chat.md).
+
## Customizing interactive questions
By default, the Embedded analytics SDK provides a default layout for interactive questions that allows you to view your questions, apply filters and aggregations, and access functionality within the query builder.
diff --git a/docs/embedding/sdk/snippets/questions/ai-question.tsx b/docs/embedding/sdk/snippets/questions/ai-question.tsx
new file mode 100644
index 00000000000..5ac0ac01b26
--- /dev/null
+++ b/docs/embedding/sdk/snippets/questions/ai-question.tsx
@@ -0,0 +1,19 @@
+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>
+ );
+}
+