Predefine metadata for tables for Natural Language to SQL

We are looking to make a solution using codex where we will give metadata of table structures and ask for SQL Query and in response we need a relevant SQL Query.
But the issue is if with every query we will send whole metadata then number of tokens we would be sending will be very large every time hence will cost more.
So is there any way that codex remembers the metadata beforehand and we just need to send Natural Language Query

1 Like

You can do dynamic prompt engineering. The idea is that you first classify your prompt in regards to the knowledge that would be needed to create a good answer, select only the prompt snippets that will be relevant for this particular query and submit that. There are also some science projects on an automated classification process. You can look up KnowPrompt as a method. I haven’t quite wrapped my head around that principle myself though.