SQL Question Answering Tool

This tool is provided by the “SQL Question Answering” plugin that must be installed.

This powerful tool is able to answer questions related to the data contained in one or several SQL datasets. All SQL datasets must be contained in the same connection.

Unlike other tools that are simple “information retrieves”, this is a “smart” tool that itself leverages AI. As such, it takes a LLM as configuration option.

When a question is asked to this tool, the LLM uses its knowledge of the selected SQL datasets to understand whether the data can respond to the question. If it thinks that the data can answer the question, the tool uses AI to generate a SQL query that answers the question. It executes the SQL query and passes the results to the LLM, that synthesizes the answer.

This tool directly answers the question, it does not return the records for the Agent to synthesize the answer.

This tool can query several datasets at once, generating joins as needed.

Important notes:

  • With this tool, data from your selected datasets will be given to the chosen LLM

  • The tool performs strict validation of the generated SQL queries to ensure that the SQL query can only be a “SELECT”

  • Extensive testing and prompt engineering is strongly advised to ensure good results

  • To obtain good results, it is critical to employ a “smart” LLM, such as GPT-4o, Claude 3.5 Sonnet, or similar. Smaller/Cheaper models tend to degrade the results quickly