Natural Language Queries inside Retool

This is how I got Natural Language queries to work right inside Retool. This will open more opportunities for us. My ultimate goal is to have an app that can do what-if analysis based on Natural Language. Eg. What will happen to my conversions if I increase my ads spend by 10%.

1 Like

Are you planning to expand on how you made this? I'm interested!

1 Like

Hey @Harsha_Wijesooriya Are you able to share the underlying prompt & query? It seems like you may be using external resources, so it would be helpful to hear more details if you can share them

Seems like there could be a few ways to go about this use case!

In the meantime, my initial thought is that, if you're only using Retool's AI features, you could try to use the generate text AI Action to filter data from your DB or API:

You could use generate text to come up with a SQL query, but you could run into potential syntax issues if trying to use this result in other queries :thinking:

@awilly Have you implemented any Retool AI solutions yet? Curious to hear how it's going

1 Like

@Tess no, not yet. But we're interested now that we're getting a hint of what's possible. I need to read up.

1 Like

Thank you for bumping in. The method I am using is generating the SQL for a query using Retool AI. I understand the issue of wrong syntax. But if we craft the prompt with more context by providing the table schema and more details about the kind of data we have, we can always get the correct SQL 99% of the time.

The real cool part comes in when we combine OpenAI's Assistants API with Retool. Right now I am running that feature outside the Retool AI as Retool AI is still not supporting it. But I have requested Retool to give us that end-point as well. We can do some amazing stuff with Assistants API as we can talk to code-interpreter and Function Calling. This will unlock many things for us.