Data Product Query
The Data Product Query agent enables natural language querying of databases associated with data products. It can execute SQL queries, retrieve schemas, and generate visualizations using charts.
How it works
Section titled “How it works”The agent follows this workflow:
- Receives a natural language question from the user
- Uses the Get Data Schema tool to understand available tables and columns
- Generates and executes SQL queries using the SQL Execution tool
- Analyzes results and may refine queries as needed
- If visualization is requested, generates a chart using the Chart Generation tool
- Returns the final consolidated results
Input parameters
Section titled “Input parameters”Required:
message(string): The natural language question or request to send to the agentdata_product_id(string): The ID of the data product to query
Optional:
auth_id(string): The ID of the authentication credentials to use for the query
Output format
Section titled “Output format”The agent produces a series of thinking, tool call, tool return, and text blocks as it works through the user request.
The final message, assuming no errors, is a string which addresses the user’s request.
Available tools
Section titled “Available tools”The agent has access to three tools:
SQL execution
Section titled “SQL execution”Executes SQL queries against the data product’s database. The tool automatically handles result serialization and may limit rows/columns for very large results.
Key parameters:
data_product_id: The data product to querysql: The SQL query to executeresult_table_name: A semantic name for the result table
Get data schema
Section titled “Get data schema”Retrieves the schema for tables in the data product. Optionally supports semantic search of sample values.
Key parameters:
data_product_id: The data product to get schema forquery: Optional semantic search query for sample values
Chart generation
Section titled “Chart generation”Generates visualizations using Altair and Python. Takes a SQL query and Python code snippet to create interactive charts.
Key parameters:
data_product_id: The data product to querysql: SQL query to generate data for the chartchart_code_snippet: Python function using Altair to create the chartimage_title: Title for the chart
Behavior notes
Section titled “Behavior notes”- The agent always uses result tables from executed queries to answer questions (never synthesizes data)
- For complex questions, it executes a final consolidated query to return all results in a single table
- When generating charts, it returns the first reasonable visualization without excessive iteration
- Charts are generated using Altair and returned as JSON representations