Loading Databricks updates...
← All video guides
Genie & Conversational Analytics

Master the Genie Agent: Setup, Optimization & Best Practices

Learn how to master Genie Agent in Databricks—the conversational AI interface that empowers business users to ask natural-language questions of their…

In short

Learn how to master Genie Agent in Databricks—the conversational AI interface that empowers business users to ask natural-language questions of their data without writing SQL.

Source: official Databricks documentation · Databricks announcement

Key takeaways

  • Create benchmarks first with expected questions and answers before adding tables.
  • Clear column names and comments are critical for Genie to understand table structure.
  • Synonyms map business terminology helping Genie understand industry jargon.
  • Value inference teaches Genie that Morocco means MO enabling correct filtering.
  • Example SQL queries show Genie complex logic and join patterns to follow.
  • Instructions should be last resort not substitute for data modeling and metadata.
  • Agent mode uses reasoning for complex vague questions requiring multi-step analysis.

Chapters

  • 0:00 — Introduction & What is Genie Agent?
  • 2:00 — Setting Up Genie Agent
  • 4:30 — Data Modeling & Metadata for Genie Agent
  • 6:15 — Adding Domain Knowledge to Genie Agent (Synonyms)
  • 8:00 — Handling Complex Logic with SQL & Joins
  • 10:30 — Fine-Tuning with Instructions & Best Practices
  • 12:00 — Top Features: Synonyms, Value Inference, Agents Mode
  • 14:15 — Leveraging the Semantic Layer
  • 16:00 — Top Tips for Newbies & Access Methods
  • 19:08 — Series Announcement: SuperSkills Tips & Tricks

Frequently asked questions

What is the best starting approach when building a Genie space?

Start by defining scope for the business domain or use case. Create benchmarks with representative questions and correct SQL answers. Then incrementally add tables verifying accuracy with benchmarks after each change.

Why should I use synonyms in Genie?

Synonyms teach Genie business terminology and alternate names. For example mapping SPA to Senior Partner Advisor or Morocco to MO ensures Genie understands what users mean when asking questions using business language.

Should I define joins in Genie or in the database?

Ideally define them in the database as primary/foreign keys, but if not possible you can define them in Genie. Having joins somewhere is better than none, and Genie UI makes it easy for non-technical users to set them up.

When should I use instructions versus fixing data model?

Instructions should be last resort only for politeness tone or behavior guidance. First fix data modeling with clear names, add comments, create synonyms, write example queries, and infer values. Poor data quality cannot be fixed by instructions.

Full transcript

Auto-generated from the video and lightly edited for readability. Timestamps link to the moment in the video.

Show full transcript (53 segments)

0:05Hey folks. Today I have the pleasure to host for the first time Alexandra. Hi Alexandra. >> Hello. How you doing Youssef? >> Very good and very happy to host you for the first time. And I think we will be we are going to talk about hot topic. And well my question is very easy. Are you using

0:29AI behind Genie currently? >> I do. I actually use it quite a lot. Um I use it obviously like for demos, presentations, and so on. Um but I also use it for like to get information about data that is relevant for me. But essentially um for everything when I need to get some answers from my data.

0:51>> But first for those who maybe never heard about Genie, this is your way to interact with natural language with your data. Basically you just going to ask a question. I So just to give you an idea what I did recently, I I created an account in the Databricks free edition. >> Mhm. >> And I got all the data on the

1:13on the football games from the World Cup. >> Okay. >> And I aggregated all this data in on a table. And now I'm using Genie to ask questions. For example, how many how many games did Morocco win on the World Cup for example since 19 88? >> I'm on your trivia trivia team like on a pub quiz.

1:35>> Yeah, basically I mean just get any data put it on Genie and put it or reference those tables on Unity Catalog, put it on Genie, and then basically just start just ask your questions. You can do it I don't know for movies, you can do it for finance as long as you have a data source and a table on Unity Catalog, you can just start asking questions easily.

1:58>> First of all, we are talking about structured data and um besides all those toys toy examples, uh it has also a lot of business applications. You can talk about your financial data, you can talk about your um I don't know, health care, um patients data and so on. So, it doesn't really matter what kind of data it is. Uh you can ask my questions uh to your

2:21data set using natural language. >> And I think so, you mentioned something very important. Make sure to create one genie per uh business unit or per use case. To make sure that you only bring the data you need. Cuz like it's like when you're asking someone, "Hey, do you know finance? Do you know marketing?" Like this person will get overwhelmed. So,

2:43that's going to be, let's say, the same thing for genies. >> Uh it's also kind of opens a broader topic about how you make your genie space actually yours, how you make it efficient and how you ensure that you know that it it is efficient, that you can prove that it is efficient. I think it all starts with a benchmarking. Like if you have a really good understanding and really good way of measuring how

3:05good your uh answers from your genie space are, then you can do something to improve it. But if you don't know how good or bad it is, it's really hard to move in any direction. What is the What is your uh way of, let's say, starting from scratch with a genie space? >> Building benchmark first, which means like >> Mhm. >> finding the right uh data sets

3:30and then immediately building benchmarks. And what I mean by mesh by benchmark is that you bring uh your question and you also copy-paste the answer. And then whenever you add some specific instructions, some uh more comments, you go and check, you run the benchmark and see whether your, let's say instructions

3:53and additional tables behaved well or maybe they were a little bit biased, so you still need to go and let's say run and add some modifications. If you think that your table is, let's say, well-structured and the name of the columns is crystal clear, then it's very easy for Genie to understand the context. If your like the name of the column is

4:15like, I don't know, XY_Z, then I'd recommend you to go and comment your the columns that column. Like give some explanation what does this column do or what's the purpose of this table. This will help Genie understand how to query this table. And I think this is something very important. Start small and keep adding more tables to if you

4:38think those tables are relevant. And you can also, if you think that within the same table you have some columns that you won't need, you can basically just open the table inside Genie and uh hide those columns, so they won't be sent in the instruction, which going to give you more context to add additional columns. >> Yeah, but I think if you're if your

5:00table is called table one and your columns are X Y Z, you have a little bit like a bigger issue. But I completely agree with you. Uh columns column names um comments basically all that metadata around your data is absolutely crucial for Genie. If that is not in the right shape, Genie

5:22will struggle to give you a right answer. Like basically any single normal person who will ever touch that data. But I also think that um one important aspect is to help Genie understand your business jargon. So essentially uh specific terms or specific statements that you use in your business, you can do it in Genie by

5:44using synonyms. So essentially you add all those words that are critical for your business as a sort of glossary for Genie that it can use to answer your questions properly. To me, it's one of the like one of the features that uh users are not really like using to the

6:06full advantage, I would say. >> In addition to the synonyms you've mentioned, uh you can also infer the values. And I think also this one can be very interesting. Let me give you a simple example. For my World Cup Genie World Cup, if I ask like, "Hey, uh give me the like how many games did Morocco win in the

6:29World Cup?" Let's suppose my in my data, like Morocco uh only exists within acronyms, which means MO. So, basically, Genie will filter by team equal to Morocco, but Morocco doesn't exist. The value Morocco doesn't exist in that table. It's MO. So, basically, when you, let's say, get or infer the

6:51values, Genie will understand that Morocco means MO. And by and which kind of help me have a result and not return null value. So, inferring values can be also very important. And when you filter, I think it's kind of helps a lot. So, and I think if I remember well for now, those values can be inferred automatically, but if you think something is missing,

7:14you can just go and enable this feature inside inside the inside the inside the column. One thing to add to that, but you can also um encapsulate certain complicated logic in a SQL statements. Because sometimes you have some um specific Let's say, some specific logic

7:36or some specific calculation or some specific way of connecting the tables together. And this is what you do need to provide to Genie to actually force it to follow those specific specific passes or those specific calculations. You can do it two ways. You can add SQL queries or basically like example

7:58queries. And you can also set up explicitly mention what kind of joins you want to have between different tables. One caveat there basically one note there is that when you actually add in example SQL queries, don't add obvious queries. Like Genie is smart enough to derive an obvious query. Like add something that is much

8:21more complicated, something that would be difficult for it to do invent or to imagine basically. >> I've used all the all the features but but you mentioned you mentioned something that I want to double down on it. You remember talk like putting your joints and I want to know on which team are you? Are you the team

8:43that let's say define the primary keys and foreign keys on the table level or you define them at the Genie level? >> I'm on the team in between. Um I do acknowledge that it's better to have them in your data model so basically outside of Genie.

9:05But seeing a lot of examples from a different different people, I think it's important to have some. If you have some just in general, doesn't really matter where, you're already on a right path. What is what is your preference? >> I would I mean if I have them already defined on the table, that's good. But again

9:27if you're a if you're data analyst and you want to benefit from this, you don't need to have those deep technical skills on data engineering to deploy or in or let's say improve your Genie experience. You can do literally everything on the UI. And I And also something I think I've I've got a lot of questions about it

9:49like how can I fine-tune my Genie to make sure I tailor it to my specific needs. Well, the response I think is very easy. You just need to add instructions. So, you can really put the in your the entire logic of your company inside

10:12instructions. Just make sure to not copy any an entire book inside the instructions because system will get lost. Just be really straightforward each time. >> It's nice that you mentioned instructions. I want to be like My point of view here is that instructions should be a last resort.

10:34So, you shouldn't like you shouldn't use instructions if you haven't done everything else. Because instructions will never compensate for your bad data modeling or for lack of example SQL queries or not well-defined synonyms. You do need to complete all those steps first and then if you still have some

10:57kind of um literally instructions to Genie like for instance be more polite or answer it in a specific like specific tone way, then you can use it in instructions. But as as you just mentioned, just having like the whole book the whole like a novel in instructions will definitely not make it the most efficient Genie

11:19space. What are your top three top three features in Genie like if you have to choose? >> I'm more likely saying synonyms. >> Mhm. >> Inferring values. >> and also the possibility to bring functions. And I think this is

11:41this is a cool logic because you can define a forecast function or you can define a specific logic for I don't know your Um you do have currency conversion. You can like define a function that does this currency currency conversion or forecast. And then whenever you ask question, you will literally bring that function, implement

12:04like run it on the top of the like data that has been returned, and you can have cool awesome results. And I think the last feature I I mean that I really really really really like is the agents mode. What are the trends of my the sales for the past couple of four years? So this question is vague. So here

12:28you're going to let the system define think about lot of instructions and then after I don't know 5 6 7 minutes, going to return complete report with the response you want to like some really amazing response. I've been using it for quite some time, and I'm really really amazed at how the

12:50agents mode can solve a lot of problems. I don't know I don't know what what what's what's are your thoughts about it, Alexandra? >> Uh I absolutely love it. Um I I think like to me I I use it by default. But I would like to say that if you are if you are data engineer on the other hand, you also need to think that you

13:12are creating this genie space for a business user in most cases. So when you do it, you need to think of what would what would work for business user. Like what kind of questions they might ask and how they how they work with this information. That's that's your responsibility to have a proper data model to select only relevant

13:35table, only relevant columns, and so on. But at the same time, you do need to think what would work for a business user when you when you define your Genie space. Meaning that you do need to emphasize on adding like proper synonyms, on adding good example SQL queries, not something that you came up with, but probably your

13:58a business user actually would use, and so on. And I think that would be critical to for a for a data engineer who is creating Genie space to actually make it the most efficient. >> And I think something we we could have mentioned at the beginning, um you can also use or leverage semantic layer inside inside Databricks.

14:21And why this is important, you can define your dimensions and and your your your rules, your dimensions and and and and and rules, and then you can bring those metric views or semantic layer inside Genie, and then you can basically ask questions. What's my NRR? Well, you already defined your semantic

14:43layer, and the good thing those semantic layer can be queried by data engineer, by data scientist, by ML engineers, AI engineer, anyone who want to use those KPIs. They're going to all have the same value, the same result. Cuz in the past you you used to define the semantic layer in the BI tool. >> You can also define with it Well,

15:05>> Yeah. Yeah, or or in Excel, hi Cosway. >> [snorts] >> And this would be problematic because if I'm data scientist, how can I access the those how can I access those values? Well, I need to use Excel or Power BI. Well, now you all are all sharing the same, let's say, ground truth, which is the semantic layer that you can go over. >> It and it also opens the question of

15:29how much AI actually force us to put like to bring our data in order, to actually define a proper semantic, proper data model, and so on. And I think a lot of questions that we kind of naturally try to ignore as data engineers are now coming back to us and like, "Hey, you do actually need to define a proper data model." And for

15:52business users, "Hey, you actually need to define what do you mean by customer?" Yousef, question to you. For a complete newbie, three things that uh you need to do when you create a Genie space from scratch. >> Uh >> [snorts] >> well, define the scope, >> check, >> start small, >> check,

16:14>> and try it. And And I remember someone told me, uh you can imagine Genie as an intern. It has a lot of now knowledge and power, but more you feed it or with with the with the knowledge of the company and the knowledge of the data platform you have, the better the system will

16:37behave. >> Absolutely agree. I actually can't agree more. I think you always need to treat Genie as a very talented, absolutely uh um like absolutely smart new joiner who doesn't know yet about your company, but super willing to learn. >> And I have I have an easy question for you. >> Oh, yeah, go for it. >> So,

16:59how do you access Genie? Like which which which tool you're using? Are you using Databricks one? Are you embedding it in the rest API or you're using it through the your mobile phone? >> Oof. >> [laughter] >> So many options. I actually I personally use uh Genie uh either I use Genie UI or I make Genie available through

17:23like multi-agent systems. So, for instance, from through agent rights. But that's my preference because I always treat Genie as a part of a big bigger system or a bigger vision. But if not that, it's definitely Databricks one. I love it. What about yourself? >> Well, for my case, I use it through a mainly Databricks one. And more

17:47lately, I started using Databricks for mobile app, which means I can ask question almost I can query my my Genie everywhere while taking public transportation, at the airport. If someone is asking me some questions that I don't know, well, Genie is now my my go-to solution. >> I already see it happening. You are at

18:09the airport and somebody says like, "Hey, does anybody in this room know know how many games Morocco team won in 1975?" And the user is like, "Click, click, click, click. Here is my answer." >> I have now a dashboard. I have a Genie room, Genie space, and I have also an app where I can now simulate like you can

18:33just click on simulate. It will give you all the results for the all the upcoming games and who going to win. And like uh and then you can download reports and share it with colleagues. So, this is becoming a game. But yeah, I'm a huge fan of football and huge fan of Genie as well. >> That's awesome. >> I can grant you the permission to view my Genie so you can maybe start asking random questions to increase your

18:57football knowledge. >> [laughter] >> I'm going to do that. Let's give it a try. >> Awesome. Thank you so much, Alexandra. And uh well, do we need to share with them the good news? >> Yeah, so we're going to turn it into a series of um like a tips and tricks. Let us know if you like it. If you would

19:20like to um upskill yourself in certain parts of Databricks product. We will be covering like how to make it more efficient, how to work with it properly, and um we will uh start it as a series of short video. >> That's right. >> [snorts] >> Thank you so much and see you soon. >> In Lake House, drive data to seize Lake [music] Flow streams the flow. Iceberg

19:42and Delta Lake, tables are glow. Unity Catalog governs Lake base. O and T pitch strong. Genie takes to SQL. MOSAIC KO PROLONGS. YOU sipping quick in co-host like the fire. [music] Gen I dream scale higher and higher. Next gen, drop it.

Official Databricks resources

Related

Databricks Answers

Looking for a quick, source-backed answer? Browse Databricks Answers on Genie & conversational analytics — direct, documentation-validated answers to common Databricks questions, curated by Youssef Mrini, Senior Developer Advocate at Databricks.