cancel
Showing results for 
Search instead for 
Did you mean: 
Generative AI
Explore discussions on generative artificial intelligence techniques and applications within the Databricks Community. Share ideas, challenges, and breakthroughs in this cutting-edge field.
cancel
Showing results for 
Search instead for 
Did you mean: 

Preventing Genie from Returning Empty Tables as Responses

Rafael2
New Contributor

Hello! I am implementing the use of a Genie Room in my company. During development, we are encountering several situations where Genie returns an empty table.

I understand that an empty table is always an error—either due to a mistake in the user's query or an error in Genie's interpretation, but always an error.

In the cases where we identified a user error, situations included requests to filter by a non-existent key or to filter by a non-existent date.

In such cases, I would like Genie to return a textual response, helping the user understand the error in their query.

I have tried various approaches to instruct Genie to perform in this way but have not been successful.

Do you have any recommendations on how to configure Genie to never return an empty table and, in cases where an empty table would be returned, to instead prompt the user to reformulate their query?

1 REPLY 1

TakuyaOmi
Contributor III

I found this to be a very interesting approach.
One important point to consider is that an empty result can also carry meaning. With this in mind, I provided the following instructions to Genie:

When a user's query results in an empty table, first determine whether this outcome is genuinely meaningful (e.g., no records match the query criteria). If you suspect the empty result may be due to an error in the query—such as filtering on non-existent keys or invalid dates (like future dates)—politely inform the user of this possibility. Suggest that they review and revise their query if necessary, and offer assistance in refining the SQL query to achieve the desired results.

It prompts users to carefully interpret the results if they are empty.

While this may not fully meet your requirements, I wanted to share it with you.

The following image shows the result of filtering using a non-existent SKU name, no-serverless.



TakuyaOmi_0-1733368518147.png

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group