The DMS AI agent is a customizable and publishable agent that serves as a unified data service layer. It lets you query and analyze data using natural language, providing instant responses 24/7. This topic describes how to create, use, and share an AI agent.
Procedure
Step 1: Create a workspace
Log in to DMS 5.0.
-
Move the pointer over the
icon in the upper-left corner and choose . NoteIf you use the DMS console in normal mode, choose in the top navigation bar.
-
Click Create Workspace. In the dialog box that appears, enter a Workspace Name, select a Region, and click OK.
Note-
A workspace name can contain only letters, digits, and underscores (_).
-
You can select only the Singapore region.
-
-
In the Actions column of the target workspace, click Go to Workspace.
NoteBy default, only the creator of a workspace can access it. For collaborative development, the workspace creator must grant development permissions to other users.
Step 2: Create and use an agent
-
Create an agent.
On the File
tab, click the
icon and select AI agent. -
Add one or more tables.
The agent can answer only questions related to the tables that you add.
-
Double-click the agent you created.
-
On the Table information tab, click Add.
-
Select the target tables and click OK.
For example, select the customer and orders tables.
-
-
Add a test set and query the agent.
Adding a test set improves the accuracy of future responses and optimizes the agent.
-
Click the Test set tab, enter your question, and click OK.
Example:
Can you find the orders with status O? -
After creating the question, click regression. The agent automatically generates a response and the corresponding SQL statement.
-
If the response meets your business requirements, click Run.
NoteIf the generated SQL statement does not meet your business requirements, you can click the dislike icon below the SQL statement, then click Debug and try again. If the SQL statement generated after the retry is accurate, click Save. This improves the accuracy of future SQL statements generated by the agent.
-
Display the results as a chart.
Click the chart view toggle button in the upper-left corner to switch to the chart view. In the configuration panel on the left, set the chart type to Line chart, select O_ORDERDATE for the X-axis field and [Total] O_ORDERKEY for the Y-axis field. The line chart appears on the right. You can click Try another in the upper-right corner to switch to a different visualization, or click Download image to save the chart.
-
-
Share the AI agent.
Double-click the target agent. On the overview page, copy the agent access URL and share it with other users. They can then ask the agent questions in the conversation area and get answers.
Example question: "How many posts are there in total?"
The agent returns a result of 91966 posts and automatically generates the SQL statement
SELECT COUNT(*) AS TotalPosts FROM. In the results area, you can switch between Table view and Chart view, or click Copy or Rerun query to manage the SQL statement.codebase_community.posts;
FAQ
-
Q: What is the data query scope of an AI agent? Is there a risk of a data breach?
A: An AI agent can query data only from the tables that you have added. This prevents a data breach. The agent's query permissions are based on the permissions of the user accessing it. If a user does not have permission to query a table, the agent returns only the SQL statement without the data.
-
Q: Does an AI agent proactively access data from the added tables when no one is asking questions?
A: No. The agent accesses database, table, and column metadata, as well as business knowledge, only when it generates an SQL statement in response to a user's question.