SQL Expert
Javapackage: com.etendoerp.copilot.toolpack
Overview
This Agent is designed to help users read information from the database. It allows users to ask questions in natural language and get the SQL query that retrieves the information they need. Use a webhook to get the necessary information to generate the SQL query. The user can ask questions about the database, and the Agent will determine whether to return a SQL query or execute the query and return the obtained result.
Components
The SQL Expert Agent is composed of the following components:
-
DBQueryExec - Webhook: This Webhook allows the Agent to execute SQL queries in the database. The agent call the Webhook to execute the query in the database and returns the result to the Agent. This is a secure way to execute SQL queries in the database, as Etendo handles the security of the database connection and query execution.
Agent Setup
-
This module is included in the Copilot Extensions Bundle
Info
To be able to include this agent, the Copilot Extensions Bundle must be installed. To do that, follow the instructions from the marketplace: Copilot Extensions Bundle. For more information about the available versions, core compatibility and new features, visit Copilot Extensions - Release notes.
-
Check the necessary
ETENDO_HOST
variable in thegradle.properties
file.Warning
Replace http://localhost:8080/etendo with the real url of the Etendo system.
-
A new agent named SQL Expert has been created in the
Application
>Service
>Copilot
>Agent
window. -
Run Sync Agent process, loged as System Administrator role.
-
Restart Docker image using
./gradlew resources.up
tasks. -
Configure access to the agent from the Agent Access window.
-
You can use the SQL Expert agent as a System Administrator
Warning
In case of using this agent with other roles:
-
It must be verified that the role has webhooks execution enabled:
-
Access must be given to the corresponding role in the WebHooks window, in the Role tab, for the WebHook DBQueryExec. This webhook is automatically added when the module is installed.
-
Examples
Examples of questions for information retrieval
-
What is the amount of the last F&B España - Región Sur organization sales invoice? -
Can you tell me which is the invoice with the highest registered amount?
3.
Can you execute the sum of the orders in the last month of 2016?
Examples of SQL query generation
-
Query to know the name of the best 5 customer of junuary 2011? -
Query to obtain which is the invoice with the highest registered amount?
This work is licensed under CC BY-SA 2.5 ES by Futit Services S.L..