Natural language database search
Hey, I have a Flutter mobile app running. Its a real estate reservation app. In the database we currently have around 12k listings, where each listing has around 50 data points. Client wants me to implement a "chatbot" of some sort, which would allow the user to search the database with natural language.
example: "I am searching for a flat in Sydney, pet friendly and cheaper than 500k".
My first approach was to basically use openAI API to construct a SQL query and then run that query to get the listings. The issue now is that the datapoints are not only numerical values / enums etc. but rather text columns with semantic data, so querying with raw SQL is not enough anymore. I cannot also dump the whole database to the API, because its too much tokens.
Any tips / tools on how to integrate something like this with Supabase. I am open to suggestions, using third party tools etc. Thanks!
2 Replies
Doing a quick search and I found two project which seem to do this sort of thing, not sure if they are using openAI or not but at a glimpse they seem to suggest they are not. https://github.com/vanna-ai/vanna and https://github.com/RamiAwar/dataline. There is also this video created by a Supabase team member https://www.youtube.com/watch?v=ibzlEQmgPPY
@silentworks Will take a look, thanks for a quick response!