In order for AI Agents to generate insights you will need to provide them with read access to the SQL tables containing the unstructured text data generated by your users, such as support tickets, call transcripts, or survey responses.
๐ค Required Table Columns:
ID: Unique identifier for each document
TEXT: The content to be analyzed (e.g., ticket message, survey response)
CREATION_DATE: Timestamp for temporal analysis and trend detection
USER_ID: Customer identifier for user-level insights
Before running the SQL commands:
1. Verify your application name in Data Products > Apps
2. Identify the database and schema containing your data
3. List the tables you want to analyze
Here is how you can give access to a table:
๐ค Note:
The following SQL commands typically require database admin privileges. You may need to coordinate with your data engineering team to execute these permissions.
--- Default application name used when installing the app (can be checked in Data Products > Apps). Make sure to use the correct name.
SET LANGAI_APP_NAME = 'LANGAI_APP';
--- Give the application access to the tables
GRANT USAGE ON DATABASE YOUR_DATABASE TO APPLICATION IDENTIFIER($LANGAI_APP_NAME);
GRANT USAGE ON SCHEMA YOUR_SCHEMA TO APPLICATION IDENTIFIER($LANGAI_APP_NAME);
--- NOTE: Add here the additional tables you will be using when creating AI agents
GRANT SELECT ON TABLE YOUR_DATABASE.YOUR_SCHEMA.YOUR_DATABASE TO APPLICATION IDENTIFIER($LANGAI_APP_NAME);
Once your data engineering team has granted the necessary permissions, you can create an agent by setting its SQL query:
If you have any question about creating and using views, please get in touch with your CSM.