This topic describes how to create and use an AI agent and share the access URL of the AI agent with other users.
Procedure
Create an AI agent.
In the left-side navigation pane, click the menu item. Click the icon, and then select AI Agent.
Add one or more tables. The AI agent can answer only questions related to the information contained in the added tables.
Double-click the created AI agent.
Click the Table Information tab, and then click Add.
In the Add dialog box, select the tables that you want to add, and then click OK.
Add one or more test questions.
You can add test questions to improve the accuracy of answers provided by the AI agent to future questions and optimize its performance.
Click the Test Set tab, and then click Add. In the Add dialog box, enter the questions that you want to add, and then click OK.
Example: Query orders in the O state.
After a question is created, click Regression in the Actions column. The AI agent automatically generates an answer and an SQL statement.
If the answer meets your business requirements, click Run.
NoteIf the generated SQL statement does not meet your business requirements, click the Dislike icon below the SQL statement, and then click Debug. After debugging, click Rerun. If the SQL statement generated after the rerun is accurate, click Save. All subsequent SQL statements are accurate.
View the result in a table or chart.
Share the AI agent with other users.
Double-click the AI agent that you want to share. On the Overview page, copy and send the access URL of the AI agent to other users. Then, these users can ask the AI agent questions and receive answers in the chat interface.
Example: How many posts are there?
FAQ
Q: What is the scope of data that an AI agent has permissions to query? May data breaches occur?
A: The AI agent is authorized to query data only from tables that are added to its accessible scope. This prevents data breaches. Furthermore, the query permissions of the AI agent depend on the permissions of the agent user. If a user lacks permissions to query table data, the AI agent returns only an SQL statement without detailed data.
Q: Does the AI agent proactively access data in the added tables when no user questions are submitted?
A: No. The AI agent accesses databases, tables, column metadata, and business knowledge to generate SQL statements only when it responds to user questions.