How To Improve JavaScript Langchain SQLToolKit

I’m using the GPT-4 model with the JavaScript Langchain SQL toolkit to connect to my database. Additionally, I’ve added CustomDescriptions to help the model generate responses. However, I’m facing an issue where the model often lacks context awareness. For example, if I have an “orders” table with a “status” column and a user asks, “What’s the current stage of my latest order?” the model does not recognize this scenario unless the user explicitly mentions the “status” column.

How can I improve my implementation to make the model more context-aware and better understand such scenarios?

Welcome to the community!

Langchain is… … well it might be compared to a jackhammer. A useful tool, but maybe not the best to do brain surgery with even though it can definitely crack skulls.

If you want to diagnose what’s wrong with your prompt, you will likely need to figure out what exactly you’re sending to the model. Ideally the exact request after langchain is done mangling your data. Then we can go from there to try and fix your prompt, and then possibly your setup.

Thanks, for your prompt answer @Diet , how do we go about this, I am new to this community.