AI analytics, with a build button AI Analytics Week, Metabase Transcript of the session recording: https://www.metabase.com/events/ai-analytics-with-a-build-button So welcome to the third session of the AI Analytics Week. This is AI Analytics with a Build Button. I am Matthew Heffron. I'm a developer advocate here at Metabase. Super excited to be showing you some AI features. They should be pretty fun. So to kick things off, we did an AI readiness quiz. We put this on socials, and I wanted to go over some of that feedback so we can all have some context. So let me open that up All right, cool. So for the AI readiness quiz, this is where teams land on the readiness stage. If I hover over here, you can see seventy-four point fourteen percent are building. There's twenty percent that are cautious. We have three point four five percent curious, and scaling one point two percent-- one point seven two percent. For question one, it says: Where's your team with AI in your analytics today? And this is cool to see. Um, there's nineteen that use it regularly, haven't started, tried it, or running a pilot, interested but concerned deliberately holding off. Uh, the second question was: What's holding your team back, if anything? And security comes in at the top here with ten. And if you missed it yesterday, Abed did an awesome presentation about this. They'll be on YouTube, so you can go ahead and check those out. This next result here says nothing, we're moving fast, relying on a third-party AI vendor, not sure the answers are correct, our data isn't ready, don't know what's available, no visibility into who's using AI or how, and cost and pricing. Question three: Uh, how much control do you need over where AI and your data team run? Self-host everything on our own servers, twenty-five responses there. Some guardrails, but cloud is fine. Not sure yet. Choose the model, bring your own key. Not really a concern. For question four: How do you want to work with your data and analytics? This is cool to see 'cause we're gonna be covering this stuff today. So connect AI agents with MCP, as code, CLI, version control, dev to prod. I'm gonna be showing you this too. This is actually super fun. I'm really into this. Um, the UI is all we need, and not my team's job. And the last question: How do you feel about AI changing your or your team's role? It's cool to see a lot of people are excited. There's people that say curious, not worried, hadn't really thought about it, and it keeps me up at night. Yeah, it's a lot going on right now in the data space. So let's go back into the presentation. We're gonna kick it off with a couple polls, so let me fire off the first poll here Start Are you guys seeing that poll? Okay, I see, I see things coming in Have you already connected to an AI coding tool? Yes to Matabase. Yes to something. Not yet. Want to. Okay, so yes to Matabase at 53%. All right, we'll stop the poll And jump into the presentation. The first thing we're gonna talk about is the MCP, and Metabase includes an MCP server. And for those that don't know, MCP stands for Model Context Protocol. It lets you connect your AI tools to Metabase. And to use this, you need a couple things. You're gonna need a Metabase instance, you're gonna need to enable the MCP server it's available on all plans, which is awesome, and you're gonna need the MCP server URL. So let me show you what that looks like in Metabase. We'll jump over there. settings admin, and then if I go to AI, and you go to MCP settings, you can see I already have it enabled. We're gonna wanna copy the MCP server URL. And then right here too, you can show inline charts in these MCP clients, so I enabled it for Claude, Cursor and VS Code, and ChatGPT. So let's go ahead and jump into Cursor, and if I hit this plus button, I can go to connectors, and I can say add connector, and we're gonna go to browse connectors. Once I do this, I'll type in Metabase, and I can go ahead and connect to Claude. Here is where it needs a server URL, so I'm gonna go ahead, put that in. I'll say connect say Authorize And it should just take a second. Here's the tools. We're gonna say authorize We'll go ahead and close this And then if I come back here and I Awesome. So now it says it's connected. We'll go ahead and close this. And then if I come back here and I go to connectors, and I say manage connectors, if I click on Metabase, you can see the tools that it has access to. So interactive tools, we have render drill through, visualize query, read-only tools. There's construct native query, construct query, execute query, execute question, query tables and metrics, search Metabase content. And for write and delete tools, there's create collection, create a dashboard, create a metric, create question, execute SQL, read resource, update dashboard, update metric, and update question. And you can see for permissions, you can set all these. Right now I have always allow on all of them. So let's go ahead and fire off some prompts and see how this works. So the first prompt I'm going to fire off will say, "Please check Metabase for the average order total in all the sample database." it returns for us It's gonna We're gonna have that go here, and we'll see what it returns for us. Found some It's gonna look at those tools that we have enabled. It's thinking. Found some tools. It's doing some work here. It's constructing the query. I can look at that Now it's using read resource Oh, it's using read resource and it gives me the answer here The average order total in the sample database Doing another execute SQL, and it gives me the answer here. The average order total in the sample database is eighty fifty-two. So let's go ahead and fire off another prompt we had each month as an inline Metabase chart And this one says, "Show me how many orders we had each month as an inline Metabase chart." So again, it's using those tools, constructing the query, and we have this nice inline chart. One of the cool things is this is a line chart. We can click on it. We can look at it as a bar chart, as a table. You can even change it, so if we wanted to look at it by quarter, we could do that. Let's go back to month. And then let's go ahead and fire off a couple more. So we could ask something like, "What columns are in the order table And so I like this to explore some data So now I'm like Oh okay here's the order table?" here's the And so I like this to explore some data. So now I'm like, "Oh, okay, here's the order table, here's the columns that it has." And then the last one I wanna fire off is to find our telling it to write some SQL. So it says, "Write a SQL query to find our top five customers by revenue." Here's the SQL So that's executing the SQL. Again, you can see what it's doing behind the scenes. Here's the SQL that it generated for me, and I can see the top five customers Let's fire off the, uh, second poll here And you should see that on your screen in a second So if dashboard if dashboards are code now, who should own them? Analysts or engineers? So we have a strong 67% analysts 11%, okay 20% both, 18%. Okay. So analysts. We'll stop the poll there, and we'll talk about agent-driven development. So agent-driven development is one of my favorite things right now. It uses the Metabase CLI, and it takes a little bit to set up, so let's jump into it. The things you're gonna need to get started, you're gonna need a Metabase instance. We recommend having a dev and a prod environment. You're gonna need a Metabase API key, a GitHub repository, remote sync, and this is only available on Pro and Enterprise plans. So let me show you my setup. If I jump over here, you can see this is a dev instance, and I have this cloud collection, orders. This was a dashboard that I built previously. But if I come over here to admin, and I go to remote sync, you can see here's my repository URL, my access token, and for sync mode for this instance, on development, we want read write. So it says, "This mode is generally for development or local instances of Metabase. Changes you make to content in sync collections can be pushed and pulled from any GitHub branch." So perfect. We have this set up. Again, let's go back now to the main app, and then we'll go over to our production environment, and we'll take a look at that one. So we'll go to remote sync. You can see the repository URL, the access token, and sync mode for this instance. Usually, you want your production instance read-only. I was doing some testing, so it says read write. But for read-only, it says, "Usually, you should use this for your production Metabase instance. All sync collections are read-only and will automatically sync with the specified branch. We recommend syncing with main." So I'm gonna go ahead and sync with main. So we'll go back into the main app, and let's jump back into the presentation. So to use this, you're gonna need to install the Metabase CLI. So you can do a npm install -g @metabase/cli. Once that's installed, you can do a mb auth login to your Metabase instance URL. You're gonna want to log in with your dev instance and also your prod instance. And once you are logged in, you can ask the agent to create content. So let's show you how to do that. So the first thing I'm gonna do is I'm gonna go ahead and jump into my dev, and I'm gonna go here to main. I'm gonna say switch branch, and I'm gonna create a branch called, let's call this, um, we'll just call this orders-demo, uh, updates. Okay. And then we'll go ahead and create that branch. And you'll see here we have this orders-demo-updates. Okay. Now we can just go ahead and jump into Cursor. You can see here that orders dashboard is here, and it's just a YAML file. So everything we're gonna be doing edits these YAML files so we can version control them. So let's go ahead and fire off a prompt. I'm gonna copy one over, paste it in, and we'll send that off. And this just says /metabase-cli. In the orders dashboard in the Claude collection, can you make revenue over time and orders by month use purple instead of blue? So if we jump over to Metabase, and this is our development instance. If I come over here and I go to our Claude, and we go to Orders, you can see that right now it's blue. And if I jump back into Cursor, we'll wait for this to finish. And this is really cool because if you think about like doing bulk updates or anything like that, say you need to update all the colors, this is way faster to do it this way. This already says done. Both revenue over time and orders by month on the orders dashboard now use purple. So let's go ahead and see how that looks. Well, this one right here. So I'm gonna go ahead and reload this. And you can see now revenue over time and orders by month use purple. So that looks good to me. So this is why it's nice to have this development environment. It doesn't just overwrite changes. You can make the changes, review them, and then you can go ahead and push. So I'm gonna go ahead and push those changes. Uh, let's just say, um Update colors. Push changes Okay? And now if we come here to my GitHub, I can create a pull request. If I scroll down, you can see that it updated those YAML files, and it just updated those colors. So this can be version controlled so we can see what the changes are. That looks good to me. So I'll say create pull request And then we'll say merge pull request, confirm merge Perfect. So now if we jump over to our production instance, I'm gonna go here to main, and I wanna pull those changes down. So it's gonna pull those down for me. I'll hit close here, and if I go to Claude, that orders dashboard you can see now uses the purple. So it's a pretty cool workflow. You can get a lot done really quickly. Let's go ahead and do another example. I am gonna go back to dev. Let's say switch branch. We're gonna create a new branch. Um, we're gonna create a product dashboard. So we'll call this create, we'll do product dashboard. Cool So we'll watch that updates create product dashboard. I'm gonna grab another prompt, and we'll go ahead and jump into Cursor, and I'll fire this one off as well. And this says /Metabase CLI, create a product dashboard and save it to the Claude collection. So that's gonna run for a minute. This is gonna create multiple questions, create a dashboard, so it might take a little bit of time So we'll see how long this takes and we'll see what it creates for us And you can see here's those modified files that we have, and again, we're just updating these YAML files. So it's running through. It says all queries work as expected It says now creating the six cards in the Claude collection all six cards created. Now let's create the dashboard Dashboard created. Let's verify the layout. Awesome. So that is done. So let's jump in and we'll go to orders. And it put it in the Claude collection. It said, "Here are the different questions and the products dashboard." So we can look at this, say, "Okay, this looks pretty good. I like this. I'm happy with it. So I'll go ahead and hit Push Changes and we'll say New Dashboard, and I'm gonna go ahead and push those changes Close. Now let's go back into GitHub. We're gonna create another pull request. This is the new dashboard. Here I wanna show you the YAML file so you can see that we created the cards and the dashboard here. So you can review this. Looks good. I'm happy with this. I'm gonna create the pull request Merge pull request, confirm merge And then it's just the same flow. So now I'm gonna jump into our production instance, and let's just go ahead and go to the main app. We're gonna pull down the changes Okay. It successfully pulled seven changes from main, and then if I go to Claude, you can see here is our products dashboard. So let's jump back into the presentation Data apps allow you to build custom applications that are more flexible than traditional dashboards and serve them directly from a Metabase instance. So when I was thinking about this, I didn't want to just build a dashboard. I wanted to build something that was a little bit more fun. So I went ahead and I went into Supabase and I created two tables. I created a table called players and I created a table called games. And so you can see here there's just ID, name, wins, losses, draws, and then there's for the games, there's ID, player ID, results, and played at. So once I have that, I'm gonna jump back into Cursor and show you what I did here. So I came over here and if I go to my README, pull this down so you can see it. I dropped this into Claude and this was the example prompt that I gave. So I said, "Build a fun, polished Tic-Tac-Toe data app in Metabase using the following existing database tables." So those are those two tables that I created in Supabase. I gave it some app behavior, so like start game. Um, you can see I said put a live leaderboard beside the h- game. And I gave it some like design direction and I said also create this just directly on my prod instance. So I ran that and now if we come over here, not this one If I come over here and I come back into my instance, let me go to the main app. I'm gonna open this up. You see we have this thing now called Data Apps, and I have this Board Bot Tic-Tac-Toe. So I'm gonna go ahead and click on this. I'm gonna go ahead and enter my name, and we're gonna go ahead and start a game. Let me look over here in the chat. Okay, cool. I am... Let's look at this. I wanted you guys to play with me here. So if you look, this will be square one, two, three, four, five, six, seven, eight, and nine. So in the comments, just drop in where I should make my first move and we'll, we'll see if we can win. So anyone can just start throwing in a number Okay, three. We're going three All right. What's next? Seven I'm gonna go here 'cause I don't wanna lose Cool. So right now what's really cool about this is, okay, so it's at a worthy stalemate, and it's a, it's a draw here. And so you can see over here, these are the recent games. These are the leaderboard. So if I come over here into Supabase, and I come in here to my table editor, you can see here I'm playing, and it's updating my data as I'm playing this game, which is super cool. So we're gonna go in one more time. Uh, let's play again. Uh, I'm gonna go anonymous as one. I'm gonna click one, and let's do it one more time. I see a seven All right, chat, where do we go? I'll bet says two. So we're gonna come in here. So we just lost here. And so you can see if I come over here in the players database, there's wins and losses. Let me reload this real quick And so now it's updated to losses. So this is actually using actions. You're playing the game, it's a application, and it's sending the results to, uh, Supabase, so it's updating my tables. So this is just something that, um, I found kind of fun, pretty cool. So we'll finish it off with our last poll Let me start that and you should see it in one second And the question is, what's most painful about managing dashboards today? Duplicating a dashboard across environments. Let's see. Changes go live with no review step I felt the pain of that Out of sync and nothing major right now All right. Well, thank you guys for participating and playing the game with me. I'm gonna go ahead and look in the chat and see if there's questions that you guys have. Sorry for the, um, the pain of the demo gods and, and things not working. But I think we came back and it's all right All right. Let's see what questions we have You're welcome Let's see. Where is Q&A. Okay Add to stream. Okay, here's a question. It says, "Introducing the CLI, are there any plans to go further into the direction of dashboard as code so that one could have their entire dashboard inside Git version repos?" Yes, totally. We're, uh, that's what we were doing, that we were showing. We were, we have a GitHub repo, and when you make those updates using the CLI it updates everything as the YAML files, so you can see all those YAML files. So you can go ahead and check those, make sure things are accurate, and then you can push those in Next question. It says, "If two people edit the same dashboard, one via GUI, one via a YAML PR, how are conflicts resolved? Does a GUI edit get clobbered on next deploy?" This is a good question. I don't know the answer to this. That's why it's nice to have your... Instead of making these changes to prod, that's why we like to, say, have that development environment, so if there are conflicts, you can figure out how you want to resolve those. But I haven't run into this yet, so I don't know the answer. Uh, the next one says, "Is there any estimate for dash level access feature?" Anyone online know about that one? I'm not sure I understand the question. Hey, I think that maybe, and Barun maybe can help us understand this a little bit more, but I think that what he's asking about is to do this, to do permissions at the dash level access sharing. You mean like permissions at the dashboard level? I think that, that, uh, Barun means permissions at the dashboard level. We don't have permissions at the dashboard level. We do it at the data level, and you can put a dashboard into a specific collection. So the way that you will do... Oh Barun's saying yes. So the way that you do permissions at a dashboard level, you would be by combining both the data permissions and the collection permission. So what you will do is you build your dashboard, like the one that Matt built, and you put it into a collection, into a specific collection, and then you can set up the permissions of the data level. And that will give you the combination of the permissions that you want. I don't think we will change the way that permissions work in Metabase, so that two things will probably get you what you need. We will drop the, the links on both, uh, data permissions and collection permissions so you can achieve what you want. Let us know if, if you need anything else. Thank you. It looks like we have one more question coming in here Says, "Does the CLI/YAML workflow preserve dashboard level filter wiring and cross filter connections? Oh, or just the individual card definitions?" Yeah, I'm all over the place I'm also not sure about this one. It, let me know. Phone a friend if any of you, if you know this better than I do I also haven't tested this, but I think it will, it will preserve 'cause everything is gonna be on the permissions and the definitions of the dashboard, so it should preserve the definitions of the cross-filtering and the dashboard level filter wiring. I think that it was... I'm sorry if I'm mispronouncing your name, A- Ain or A- Ain. If you want, you can drop us your email on the... Uh, or we will drop our email of product advocates, and we will answer both of the questions definitely. But I, I'm pretty sure this is, this is a yes And also we have one more question coming in here. Does Meta- does MetaBot respect RLS for user impersonated access? And that's yes Thanks for dropping that email in there, Prerna No problem I think that's all the questions. Thank you guys for attending. Again, apologies for some of those mishaps. If you have any questions or wanna connect, feel free to reach out to me on LinkedIn. You can also write any of... If you have any other questions on discourse I'll be watching. And I appreciate your time.