With the new release of assistants, I am excited to connect it to a database and have it answer questions. It the docs i see it can be done with files but how can an assistant be connected to a database?
3 Likes
I think its going to be easiest with Actions, but we need to wait for the GPT Editor in ChatGPT
Will Actions allow GPT to answer nuanced questions about the data in the database? From what I can tell it doesn’t transform the data into vectors so it wouldn’t be that good? I’m imagining something that vectorizes the data and embeds in a custom GPT… if that makes sense. Basically the functionality thats described here for files in context of the Retrieval tool
1 Like
Also worth noting- not sure if anyones tried to use assistants with files but I get this uploading the file BadRequestError: 400 Failed to index file: Unsupported file file-Jf8okhY5J2Te2SuiBIosmozU type: application/csv
if you have a small DB and doesnt update very frecuently, yes you can add the the db into the assistants files, in a readable format.
The other option, as i do, i give the AI my full DB structure, and in the functions i ask the AI to create the DB Query to run in my system, and return the result to the Assistants.
This is better to have updated results.
Just make sure to add some security to check the query before run it in your site (for example make sure it only has SELECT, has propper filters, etc)
I mean, it will be able to write SQL queries and then use the SQL response to answer the question, which is much more accurate and efficient than a vector search if your data is tabular and number/label-oriented.
Vector similarity search works best for text and natural language, so tasks like finding relevant snippets in a long document where it can match the ‘vibe’ of a query to a chunk of text that may or may not share the exact wording. However, for tabular data (e.g the name, population for every city in the U.S.), we probably don’t care about which city names match the general ‘vibe’ of “Philadelphia”, we just want to go to that row and see what the number is.
1 Like
Exactly my question for same reasons. Subscribing to thread.
I had the same plan yesterday. Tried to do it via actions and use a https_request json call. However, https_requests are not supported (yet?). What would be your best guess to get around this limitation?
Is there a documentation regarding https_requests? I planned on using axios in my function to retrieve data from my database using rest api.
Got access to actions today and https seems to be working for me, what’s your api schema like?