WrenAI icon indicating copy to clipboard operation
WrenAI copied to clipboard

Global Instructions Can Also Be Introduced in the "SQL Correction" Phase

Open xpfxzxc opened this issue 7 months ago • 1 comments

I provided guidance in the global instructions on how to generate correct SQL (mainly because I observed that the LLM used some unsupported functions or syntax). However, sometimes luck isn't on our side — during the "SQL Generation" phase, it may not be possible to generate a correct SQL statement directly, leading to the "SQL Correction" phase. Since global instructions are not introduced during the "SQL Correction" phase, the corrected SQL might still be incorrect.

For example: Global instruction guidance: Do not use the xxx function During the SQL generation phase, if the generated SQL happens to be incorrect and enters the "SQL Correction" phase, if the above global instruction is not reintroduced, the LLM may use the xxx function, resulting in an SQL statement that still fails.

xpfxzxc avatar Jun 07 '25 09:06 xpfxzxc

Hi @xpfxzxc,

That’s a great point. I'm already discussing this internally with @cyyeh. We’ll keep you updated here once there’s progress or any related changes.

wwwy3y3 avatar Jun 19 '25 07:06 wwwy3y3