I've been doing some research on how to leverage a LLM model to "translate" English into a sql query that's capable to returning the desired results (like a little Q/A bot). For instance, one would ask "show me the top growth account in the last three months in the state of FL?" and it will return the results. After googling around, a lot of information I've found is at a high level where you follow the pipeline of
- Build data model --> 2. pick a LLM --> 3. prompt design --> 4. parse the question to query --> 5. execute query --> 6. parse result
I have a a few questions:
- is LLM model fine-tuning using your own data required for this type of tasks?
- where should mapping between database fields and the query components happen? In my example above, let's say i have two date fields in my database - sales_date, and invoice_date, the LLM would know to use invoice_date for the "last 3 months" request
- Any online sources that give an implementation example would be great