🎓 Glide Tutorial - AI Assisted Data Entry

What’s up Gliders!

In this video I introduce a concept called AI Assisted Data Entry. IBM estimates that US-based businesses are losing $3.1 trillion dollars annually due to low-quality or incomplete data, so if we can turn even just a fraction of that low-quality, bad data into high-quality, accurate data… We can unlock a TON of value.

The problem is that everyone hates data entry, so I came up with a “Hybrid” solution that uses ChatGPT to select from a predefined set of answers, but allows human oversight & tweaking before submission.

I experimented quite a bit with JSON + Parsing, but for some reason Glide was caching the parsed JSON answers, which lead to “old” data being submitted on Add Row… Ended up using Regex to extract what I needed.

Anyhow, hope you find this valuable!

Cheers :popcorn:

6 Likes

Fantastic! :+1:
Awesome job, mate. Incredibly clear and easy to follow.

Curious - do you ever see a race condition where the user specific column values are set before everything’s been extracted? Looks like it works fine in the video, although I’d be a little concerned about that. I guess if it ever did become an issue then a short wait or wait for condition would sort it out.

3 Likes

Thanks Darren! :pray:

I haven’t experienced that yet, but it’s a very valid concern… You could (and probably should) throw a Wait action in there to ensure all the values are present before Setting Column Values.

I initially had a “wait for condition” action in place that ensured one of the “Suggestion” columns had a value before continuing (so the wait time was a small as possible instead of waiting for a pre-defined time) but while testing ChatGPT returned a slightly wonky response, which meant the value couldn’t be extracted properly, which in turn meant the column remained empty and the Wait for condition was not met…

So I kinda scrapped that and proceeded without it since I didn’t run into any errors.

But now that I think about it, you could probably create a column (or set of columns) that check for at least one or more responses being present before proceeding… Or just use a Wait for ~200ms or something extremely quick/unnoticeable.

Anyhow, thanks for watching! :saluting_face:

2 Likes

Great job :clap: very powerful concept and use of AI.

If you have time (just a suggestion and understand if you don’t want to share) but it might be helpful to others see the prompt, message & regex syntax - so all the bits of the puzzle so they can replicate.

2 Likes

@Rosewebstudio Happy to share! We all level-up together :rocket:

System Prompt (Template Column):
AAA, BBB (etc) would be replaced by a joined list of values you’ve imported from another table. These act as a predefined/approved set of answers you want AI to select from, which in turn allows relation columns, data consistency, etc.

You are WineGPT, the worlds best wine researcher and assistant. You return accurate and up-to-date information about wine based on wine reviews, information, descriptions, and articles.

You job is to follow the instructions below and return the desired information in the format specified.

For each category, a predefined list of answers is provided, and the number of desired results are specified. The results you return will either be a single answer, or a set of answers separated by a comma.

Do NOT include any whitespace between comma separated answers.

If you cannot find any information on the wine, search for another vintage. If you still cannot find any information, return “Wine Not Found”.

The wine will be specified, it’s your job to return the rest of the information for each category. Here’s the information you need to return:

Wine Type:

  • Options: AAA
  • Return: 1

Visual Clarity:

  • Options: BBB
  • Return: 1

… etc

Message Prompt (Template Column):
In this case, all we’re doing is specifying the subject (wine) and then providing the format we want the response to be returned in. You could also make this JSON, then later “Transform” i.e. Parse that JSON, but i got funny cached results from time to time so I stuck to Regex, which is shown below. Same idea, different exectution.

Wine = AAA

Return your answer in the exact format below:

WineType: answer
VisualClarity: answer
… etc

Extraction Example (Extract Matching Text Column)
Then all we’re doing is isolating and extracting specific pieces of data so we can use/leverage them throughout the app. In this case, I’m select the Response that is generated by AI as the text, and then extracting the WineType from this text. The result would be (for example) “red” for this particular column.

Text = Response
Regular Expression = (?<=WineType: )(.*)

3 Likes

Have you found any cases that your response contain extra text that is not in the format that you requested?

1 Like

Fantastic! And imagine how far you could go on this use case when we will be able to integrate from Glide with “chalGpt” Plugins & ‘code interpreter’ (there may have a way via Zappier…still looking)

Well done.

1 Like

@ThinhDinh Not so far… It’s pretty consistent!

The only instances where my results are not “flawless” is when it:

  1. Returns more than I’ve specified for a particular category where I’m requesting more than 1 answer (e.g. I request 6 aromas, and it returns 7 aromas).
  2. Returns an answer immediately after the semi-colon without a space (e.g. “Topic:Answer” instead of “Topic: Answer”) which causes the regex to break. This could probably solved by requesting JSON then parsing it… But as I mentioned, I ran into some odd “caching” esque issues where previous values (despite the JSON text field that they are Parsing being empty/cleared) were returning values from the previous JSON snippet when I added a new row.
1 Like

But the great thing about this setup is that even if it only extracts 8/10 values from the response, you can still manually select the appropriate values for the 2 missing columns before submission, so it’s fairly accomodating even if the response isn’t perfectly formatted.

1 Like

As I told you in your post, if there’s no API to do so, you won’t be able to use it :sweat_smile:

1 Like

Excellent thanks for sharing - it’s all good learning :clap:

1 Like

Yes but I am digging :slight_smile:
Since OpenAi has open the gpt4 API (GPT-4 API general availability and deprecation of older models in the Completions API), I am wondering if we can’t do something with zappier, webhooks etc… but since I don’t know anything to all of this, it’s only assumptions

No, you can’t. The GPT-4 API only has access to the GPT-4 model itself. Plugins and Code Interpreter are different models in their ecosystem.

2 Likes

Arrggghh…

So, need to implement a partially manual workflow, right ?

Something like:
. Glide button to ‘copy to clipboard’ (the csv link) > open link (chatgpt)
Then manually:
. Paste the csv link
. Select ‘code interpreter’
. Copy the resulting pdf
. Back to Glide, text entry component to paste the link to the pdf with the analysis…

1 Like

Great idea and solution!

I’ve never thought of an idea like this, but now I think I have 2-3 use cases for this.

Thanks for sharing all this.

Feliz día Marco!

2 Likes

Not yet!

1 Like

Yeah, this is a new type of API called AMI: Application Manual Interface :wink:

1 Like

That’s too manual, to be honest. I wouldn’t like it as a user. I wouldn’t build any products until I’m sure an API is supported and is stable.

But isn’t it referring to this example? Where the API is stable but the results are not always perfect so the user can change whatever should be different?

Agree with you, but at this stage the product is… for me… so I can deal with it :slight_smile: