Creating a Chatbot using the data stored in my huge database

So your data is a bunch of numbers like:

5/30/2023: $100.00
5/14/2023: $900.25
1/1/2022: $5.02

Then the user asks, “What is my most recent transaction?”

You would go to the database, pull the latest date, and spit out “The most recent transaction is $100.00”

This didn’t use any embeddings.

Now the question is, how to get the computer to map the question to your code. You could use embeddings for this. For example, if you embed a bunch of “actions” and one of them is “get recent transaction amount”, and then you compare this (vector-wise) to all of your actions, and when it correlates high with “get recent transaction amount”, you just run the code that does this and spit out an answer. So the embedding acts as a layer that maps the user intent to the code you need to execute.

4 Likes