ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: How does the Execute SQL tool execute SQL generated by LLM and knowledge base, and how does its underlying logic work?

Open yuanyujia123 opened this issue 11 months ago • 2 comments

Describe your problem

Image

I make AI applications according to the DB Assistant template in the Agent, but the generated answer node on the way will return all the thought content and the SQL written, and when the data is transferred to the next node and Execute SQL, sometimes the results can be queried, sometimes the results can not be queried.

yuanyujia123 avatar Feb 18 '25 01:02 yuanyujia123

This largly depends on the data quality of DDL, DB description and Q-SQL. LLM generates SQL by the content retrieved from these 3 knowledge base as samples and clues. Upgrade to 'nightly' version of docker image. This template has been upgraded.

KevinHuSh avatar Feb 18 '25 02:02 KevinHuSh

I understand this, the current problem is that the generated answer node will also send the thought content to the Execute SQL node, how can only send the SQL statement to the next node instead of containing the thought content? Is this problem due to not using Q -> SQL Knowledge base?

yuanyujia123 avatar Feb 18 '25 03:02 yuanyujia123