Skip to main content

Databricks actions

The Databricks action pack contains the following actions:

  • Search Databricks with SQL
  • Search Databricks with Genie

Overview

Glean enables users to query their Databricks workspaces using natural language queries and direct SQL via Databricks action pack. Glean users can combine Databricks data with their other connected apps and documents.

Key features

  • Real-time querying: The Glean Assistant can query your Databricks Genie space or tables in your Databricks workspace live, without needing to index any additional data.
  • Support for user OAuth: Customers can enable User OAuth for querying.
  • Combining structured and unstructured data: Glean users can combine Databricks data with any other data Glean has access to.

Usage instructions

Set Up in Agent Builder

Step 1: Create the agent

  1. In Glean, open Agents from the left navigation.
  2. Click Create agent.
  3. In the creation modal, select Start from Scratch.
  4. Enter an agent name, for example, Databricks Query Agent.

Step 2: Configure the trigger

  1. In the trigger area, select Input form.
  2. Add a Text input field.
  3. Set the field name to query.
    • This creates the field reference [[query]].

Step 3: Add the Databricks Genie step

  1. Add a new step after the trigger.

  2. Search and select the Search Databricks with Genie or Search Databricks with SQL action.

  3. In the action instructions or text box, enter the instructions as per your requirement.

    Example: For Databricks Genie, send the following natural language query to the tool as is without any modification: [[query]].

Step 4: Add the response step

  1. Add another step after Search Databricks with Genie.

  2. Select Respond.

  3. In the instructions field, enter the instructions as per your requirement.

    Example: Show me the results from the Search Databricks with Genie step only. If there are more than 3 rows, show them as a table. Use the first row in the response from the tool for column names. Always show citations.

Step 5: Test and save

  1. Click Preview in the top-right corner.
  2. Enter a sample query in the query field.
  3. Run the agent and verify that:
    • the Databricks action step runs successfully
    • the response shows only the action output
    • tabular results are formatted as a table when applicable
    • citations are included
  4. Click Save.

Step 6: Share the agent

  1. Click Share in the Agent Builder header.
  2. Grant access to the right users, groups, or departments.
  3. Share the agent from the library after you are ready.

Best practices and troubleshooting

For Databricks Genie Action

  • Specify a Genie Space ID either in the Action Pack configuration section (default space ID) or in the step configuration section in the Agent Builder.

For Databricks SQL Execution Action

  • Specify a Databricks Warehouse ID either in the Action Pack configuration section (default warehouse ID) or in the step configuration section in the Agent Builder.

If the Databricks Genie action results are not as expected

  • Refer to the SQL created in the intermediate step citation and debug.

To customize Databricks Genie behavior

If your query instructions are sometimes dropped

  • Add a specific instruction saying Send Query: [[Query]] to Databricks. If you say Send [[Query]] to Databricks, the query may get dropped by the LLM.

Execution limits

  • Databricks actions are subject to the same per-run tool-call budget and per-response payload size caps as all other actions. For guidance on batching large queries and staying within limits, see Limits and exhaustive retrieval best practices.

Known limitations

  • Multi-turn conversations in the Databricks Genie Query Fetcher action are not supported. For example, if Genie responds with a clarification question, Glean does not pass the response back to Genie.
  • Glean does not automatically retry queries on errors from the Genie API.