The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
docs - basic metabot docs (#62842)
Jeff Bruemmer8413b6a8414f
diff --git a/docs/README.md b/docs/README.mdindex 3ccdde004f0..3ba771769e7 100644--- a/docs/README.md+++ b/docs/README.md@@ -139,6 +139,12 @@ Metabase's reference documentation.- [Basic actions](./actions/basic.md)- [Custom actions](./actions/custom.md)+### AI++- [AI overview](./ai/start.md)+- [Metabot](./ai/metabot.md)+- [Setting up Metabot](./ai/settings.md)+### Exploration and organization- [Organization overview](./exploration-and-organization/start.md)diff --git a/docs/ai/images/ai-settings.png b/docs/ai/images/ai-settings.pngnew file mode 100644index 00000000000..cc98e7658d0Binary files /dev/null and b/docs/ai/images/ai-settings.png differdiff --git a/docs/ai/images/generate-sql-from-natural-language-prompt.png b/docs/ai/images/generate-sql-from-natural-language-prompt.pngnew file mode 100644index 00000000000..70a89525f6dBinary files /dev/null and b/docs/ai/images/generate-sql-from-natural-language-prompt.png differdiff --git a/docs/ai/images/have-metabot-fix-it.png b/docs/ai/images/have-metabot-fix-it.pngnew file mode 100644index 00000000000..bb0c11987ffBinary files /dev/null and b/docs/ai/images/have-metabot-fix-it.png differdiff --git a/docs/ai/images/metabot-conversation-sidebar.png b/docs/ai/images/metabot-conversation-sidebar.pngnew file mode 100644index 00000000000..36389c9440cBinary files /dev/null and b/docs/ai/images/metabot-conversation-sidebar.png differdiff --git a/docs/ai/images/metabot-response.png b/docs/ai/images/metabot-response.pngnew file mode 100644index 00000000000..cf28ee4d508Binary files /dev/null and b/docs/ai/images/metabot-response.png differdiff --git a/docs/ai/images/metabot-writes-description.png b/docs/ai/images/metabot-writes-description.pngnew file mode 100644index 00000000000..75d952f4c7fBinary files /dev/null and b/docs/ai/images/metabot-writes-description.png differdiff --git a/docs/ai/images/metabot.png b/docs/ai/images/metabot.pngnew file mode 100644index 00000000000..f40ac4dea21Binary files /dev/null and b/docs/ai/images/metabot.png differdiff --git a/docs/ai/metabot.md b/docs/ai/metabot.mdnew file mode 100644index 00000000000..fe4c2e83664--- /dev/null+++ b/docs/ai/metabot.md@@ -0,0 +1,93 @@+---+title: Metabot - Metabase's AI assistant+summary: Metabot is Metabase's AI assistant that helps you analyze data, create charts, write SQL, fix errors, find content, and get answers from documentation.+---++# Metabot - Metabase's AI assistant++{% include beta-blockquote.html %}++> For now, [Metabot](https://www.metabase.com/features/metabot-ai) is only available as an add-on for Pro and Enterprise plans on Metabase Cloud.++++Metabot helps you analyze your data by creating charts from natural language, generating SQL queries, fixing query errors, and analyzing existing visualizations.++> Like with all generative AI, you'll always need to double-check results.++To set up Metabot, see [Metabot settings](./settings.md).++## What Metabot can do++Metabot can help you to:++- Create a chart using the [query builder](../questions/query-builder/editor.md) from a natural language query.+- Generate SQL in the [native editor](../questions/native-editor/writing-sql.md) from natural language.+- [Analyze a chart](#analyze-charts-with-metabot).+- [Fix errors in SQL code](#have-metabot-fix-sql-queries).+- Answer questions from our documentation (as in, the literature you're reading right now).++## The Metabot chat sidebar++++There are multiple ways to start a chat with Metabot:++- Type cmd+b on Mac, ctrl+b on Windows, to open up the [chat sidebar](#the-metabot-chat-sidebar).+- Click the Metabot icon in the search bar.+- Type cmd+k on Mac, or ctrl+k on Windows, to open the [command palette](../exploration-and-organization/exploration.md#command-palette). Select the Metabot option to **Ask me to do something, or ask a question**.++You can chat with Metabot (though predictably, it's only interested in helping you answer questions about your data).++Metabot will keep the context of the current question with each new prompt. Only the current conversation history is saved (you can scroll up to see it). If you start a new chat, Metabase will discard the previous conversation, so be mindful when resetting the conversation.++Some tips:++- Give Metabot as much context as you can. If you know the table or fields you want to query, tell Metabot.+- Whenever you want Metabot to do something completely different, you should reset the conversation, as Metabot might find that irrelevant historical context to be confusing.+- Once Metabot creates a question for you, you can follow up with more questions or take over yourself. You can drill through the chart or step into the editor to tweak the query (both in the query builder and the SQL editor).++### Metabot response menu++Hover over Metabot's response to:++- Copy the response.+- Give thumbs-up/thumbs-down feedback on responses.+- Re-run the prompt with Metabot. This is useful if you've updated the chart or just want to have Metabot take another pass (since AI responses aren't deterministic, Metabot may give a different response on another run).++## Analyze charts with Metabot++++When viewing a question, you can click the Metabot icon in the upper right to analyze a visualization. You can also open the command palette to tell Metabot to analyze the chart.++When viewing a table of results, Metabase won't display the Metabot button, but you can open the chat to ask Metabot to analyze the table, and it will produce an [X-ray](../exploration-and-organization/x-rays.md) of the results.++You can also ask Metabot to tell you about specific tables in your database.++## Metabot in the native editor++++To have Metabot generate SQL for you:++1. Open the [SQL editor](../questions/native-editor/writing-sql.md).+2. Select the database you want to query.+3. Type cmd+b on Mac, ctrl+b on Windows, to open up the [chat sidebar](#the-metabot-chat-sidebar).+4. Ask it to "Write a SQL query that..." and type your prompt.++Metabot will generate the SQL for you, but it won't run the query. This gives you a chance to inspect the code before running it. The native editor is designed to be read-only (so don't worry about Metabot dropping any tables), but you should still check the query to make sure it targets the data you want.++If you don't specify a specific table in a natural language question, Metabot will only check the first 100 tables in the currently selected database. If your question pertains to tables other than those first 100 tables, Metabot may hallucinate the tables it needs, and the query will fail.++## Have Metabot fix SQL queries++++When you get an error in a SQL query, you can click the **Have Metabot fix it** button, and Metabot will try to correct the query. You can also ask Metabot to fix your SQL in the chat.++## Navigating after Metabot creates a chart++If Metabot creates a query or takes you to a new item but you want to return to the previous screen, you can navigate using your browser's back button.++You can also save any chart that Metabot creates to a dashboard or collection.diff --git a/docs/ai/settings.md b/docs/ai/settings.mdnew file mode 100644index 00000000000..6c2c447f539--- /dev/null+++ b/docs/ai/settings.md@@ -0,0 +1,87 @@+---+title: Metabot settings+summary: Configure Metabot settings, including which collections Metabot can access, and learn tips for improving Metabot's performance through data modeling and metadata.+---++# Metabot settings++{% include beta-blockquote.html %}++> For now, [Metabot](https://www.metabase.com/features/metabot-ai) is only available as an add-on for Pro and Enterprise plans on Metabase Cloud.++_Settings > Admin settings > AI_++This page covers admin settings for Metabase's AI assistant, Metabot.++## Configure Metabot++To help Metabot focus on the data you care about most, select the collection containing the models and metrics you'd like it to work with.++## Pick a collection for Metabot to have access to++++To select a collection for Metabot:++1. Go to **Settings** > **Admin settings** > **AI**.+2. Click the **Collection** dropdown.+3. Select the collection that contains the models and metrics you want Metabot to use.++Metabot will use the models and metrics in that collection to help answer questions and generate queries. You can change this collection at any time.++## Tips for making the most of Metabot++The best thing you can do to improve Metabot's performance is to prep your data like you would for onboarding a new (human) hire to your data. In practice, this means you should:++- [Add models and metrics to your Metabot collection](#add-models-and-metrics-to-your-metabot-collection)+- [Add descriptions for your data and content](#add-descriptions-for-your-data-and-content)+- [Make sure the semantic types for each field are correct](#make-sure-the-semantic-types-for-each-field-are-correct)+- [Curate prompt suggestions](#curate-prompt-suggestions)++### Add models and metrics to your Metabot collection++Create models that make it easy for Metabot to find answers to the kinds of questions you expect people to ask about your data. Create metrics that capture key business calculations that people frequently need to reference. Add these models and metrics to the collection you've designated for Metabot to learn from.++For example, if people often ask questions about customer lifetime value (LTV), create a model that joins customer data with order history and calculates LTV. Or if people frequently need to know monthly active users (MAU), create a metric that defines exactly how MAU should be calculated.++### Add descriptions for your data and content++Add descriptions to your [models](../data-modeling/models.md#add-metadata-to-columns-in-a-model), [metrics](../data-modeling/metrics.md), [dashboards](../dashboards/introduction.md), and [questions](../questions/introduction.md). Write descriptions to provide context, define terms, and explain business logic.++Admins can also curate [table metadata](../data-modeling/metadata-editing.md) by adding descriptions for tables and their fields.++For example, here's a decent description for an ID field that provides additional context for the data:++```txt+This is a unique ID for the product. It is also called the “Invoice number” or “Confirmation number” in customer facing emails and screens.+```++You can even ask Metabot to write descriptions for you. But Metabot will only have access to the data in the database. It can't know things like "this ID is called the 'Invoice number' in the web app", which is the kind of contextual information worth documenting.++### Make sure the semantic types for each field are correct++Make sure the semantic types for each field accurately describe the field's "meaning". For example, if you have a field like `created_at`, you'd want the column type to be Creation date.++Metabase will try to set semantic types automatically, but you should confirm that each field has the relevant semantic type. See [Data types and semantic types](../data-modeling/semantic-types.md). You can also set semantic types for [models](../data-modeling/models.md#add-metadata-to-columns-in-a-model).++### Curate prompt suggestions++When you select a collection for Metabot to "learn", Metabot will suggest a series of prompts based on the content it finds in that collection. These give people a feel for the kinds of things people can ask Metabot to do.++Admins can run these generated prompts to test the answers, or trash the individual prompts if they're not useful or misleading. You can also regenerate all the prompts with a click.++## Metabot permissions are Metabase permissions++Metabot inherits the permissions of the current user, so you don't need to set permissions specifically for Metabot. Whenever someone uses Metabot, Metabot can only see what that person has permissions to see and do.++In other words, to restrict what data Metabot can see for each person, simply apply [data](../permissions/data.md) and [collection](../permissions/collections.md) permissions to their groups as you would normally, and those permissions will apply to their use of Metabot as well.++## Metabot is only available instance-wide, not per person++Currently, Metabot will be available to everyone who uses your Metabase.++## Metabot uses a variety of generative AI models to answer your questions++Under the hood, Metabase powers Metabot with a variety of generative models. For now, you can't change which generative AI models Metabot uses, as Metabase's AI service handles their selection.++To get the best results, we (the Metabase team) use internal benchmarks to determine which AI models Metabot should use for different tasks. And we are constantly iterating on performance, so Metabot will continue to improve over time.diff --git a/docs/ai/start.md b/docs/ai/start.mdnew file mode 100644index 00000000000..48fd9df869c--- /dev/null+++ b/docs/ai/start.md@@ -0,0 +1,17 @@+---+title: "AI in Metabase"+---++# AI in Metabase++{% include beta-blockquote.html %}++> For now, [Metabot](https://www.metabase.com/features/metabot-ai) is only available as an add-on for Pro and Enterprise plans on Metabase Cloud.++## [Metabot](./metabot.md)++Metabot is an AI assistant that helps you explore and analyze your data.++## [Setting up Metabot](./settings.md)++Admins can configure Metabot to focus on specific collections and manage example prompts.diff --git a/docs/exploration-and-organization/exploration.md b/docs/exploration-and-organization/exploration.mdindex d0ec38cf9bb..8be0f3c046d 100644--- a/docs/exploration-and-organization/exploration.md+++ b/docs/exploration-and-organization/exploration.md@@ -21,6 +21,7 @@ You can use the command palette to:- Create new things (like new questions and dashboards)- Find things (saved questions, dashboards, models, etc.)- Find and jump to Admin and account settings.+- Ask [Metabot](../ai/metabot.md) to do something, or ask it a question.So anytime you want to do or find anything in Metabase, just hit `cmd/ctrl + k` and start typing what you want to do.diff --git a/docs/questions/introduction.md b/docs/questions/introduction.mdindex f14c8b75566..d0433ea74b0 100644--- a/docs/questions/introduction.md+++ b/docs/questions/introduction.md@@ -15,6 +15,8 @@ Questions in Metabase are queries, their results, and their visualization. QuestYou can create a new question from scratch, or build off of an existing question. To create a question from scratch, you can click on **+ New** and select how you want to query your data: either with the graphical query builder, or the SQL/native editor:+You can also use [Metabot](../ai/metabot.md) to create questions using natural language. Just ask Metabot what you want to know about your data, and it can generate charts and queries for you.+### Query builderdiff --git a/docs/questions/native-editor/writing-sql.md b/docs/questions/native-editor/writing-sql.mdindex ebdd6e5a015..f88e021d9c2 100644--- a/docs/questions/native-editor/writing-sql.md+++ b/docs/questions/native-editor/writing-sql.md@@ -9,6 +9,8 @@ redirect-from:If you ever need to ask questions that can't be expressed using the query builder, you can use [SQL][sql-gloss] instead.+You can also use [Metabot](../../ai/metabot.md) to generate SQL from natural language. Just ask Metabot to "Write a SQL query that..." and describe what you want to know about your data.+## What's SQL?SQL (pronounced "sequel", or sometimes as S.Q.L. — people argue about this) stands for Structured Query Language, and is a widely used standard for getting data from databases. We won't try to teach you all about SQL right now, but to learn more about it, check out [Working with SQL][learn-sql].