Coming back to this, not sure if you already fixed it but I got it working this way: Use the prompt to query your db and then use db output again as prompt to answer questions. ChatGPT is way better at this than GPT3, hope that API