Using GPT-4 "Advanced Data Analysis"?

I've been using GPT-4 with the advanced data analysis feature outside of retool. As a test, I uploaded CSVs of multiple exported database tables and then asked questions of this data after giving some instructions on what the data means and how it's related.

I'm trying to recreate this same concept in Retool. Is this possible at the moment? I've tried using my instructions and references to the actual database tables as the system prompt for my AI action and then chat input from the chat component, but the request times out after a while with no answer provided. The GPT-4 directly from OpenAI handles the same question in about 3 seconds. Retool is timing out after about a minute and a half. I'm guessing I'm not inputting the data correctly or it can't handle the advanced data analysis yet in retool.

My system prompt is like this (note that {{ }} relate to data available from Retool DB queries :

I have all this disjointed data that have relationships together that I want to analyze.

This is data for a company that places electronic devices in physical locations. Sometimes these break and need to be serviced by technicians. This data shows the history of all devices and services performed

Here's what's in each sheet and how it relates to other sheets:

{{demoAccounts.data}} - a list of physical locations where demo_devices can be located
{{demoDevices.data}} - a list of all the devices and related data
{{demoStatus.data}} - the current status of given device
{{demoLocation.data}} - data on the account where the given device has been located. entries with no end date show the current account where the device resides
{{demoAppts.data}} - data on what service was performed and the cost of each
{{demoCases.data}} - the support tickets that come in when a device breaks or needs service. Every case must have one or more appointment to be resolved
{{demoTechs.data}} - these are the people that go on the service appointments to fix/service the devices.

Ingest this data and I will ask multiple questions.

Wondering if there's a way to get this all into Retool's AI action to get the same performance I get directly from GPT-4. Perhaps it's not possible because advanced data analysis isn't "enabled" on Retool or I'm just not setting up the prompt correctly.

Curious if anyone has had success with this setup.

Thanks,
JMR

Hi @jmr1234

the Advanced Data Analytics from ChatGPT uses the model to create python scripts that are executed at runtime to get statistical information out of a given dataset to support the answers provided by the model (it's amazing).

I guess your prompt is too big once the data fields are resolved, thus, maybe this is the reason of the timeout.

And I don't think it's something doable right now with the tools provided by Retool.

I did a different test using Vector AI, giving a CSV source telling the system to provide statistical information out of it. It's able to answer to something basic, but nothing we can compare to ChatGPT results.

Hope this help.

1 Like

Yep...that's basically what I figured, but thought I'd check to make sure I wasn't missing anything obvious. Might give it go via API and see how that works.

1 Like

Keep it up and let us know if you come up to something interesting!

1 Like

Hey @jmr1234 - Retool PM here. @abusedmedia is correct that the ChatGPT data analysis feature creates python scripts executed at runtime (something we don't support in Retool today). I would also agree that it's most likely that your prompt is exceeding the context window. We do hope to support data analysis if and when it's available as part of the API.

Separately, we are exploring having our own "agents" inside of our workflows product, where you'll be able to generate python and JS code. If you you would like discuss your use case with me in further detail, I'd love to hear about it! dworsky@retool.com

2 Likes

Hi, I'm not quite sure if I understood your question correctly, but I think we do something similar. I already have a topic on this here: OpenAI GPT content loop CSV File - #7 by Konstantin_Kiss

We run ChatGPT through each line and give a prompt where it is supposed to parse each field and then give us out certain data.

Maybe this topic of mine will help you.