Skip to main content

Databricks Genie

Let agents ask Databricks Genie Agents questions about your data, as the signed-in user or as a shared service principal​

Overview​

The Databricks Genie connector lets a Squid AI agent delegate data questions to Databricks Genie Agents (formerly Genie Spaces). Genie answers with text, the SQL it ran, and result rows, and Databricks applies the Unity Catalog grants, row filters, and column masks of the identity that asks, so two users asking the same question can get different rows.

Authentication Mode decides who that identity is:

  • user (the default): the requesting user. Each request must carry the user's Databricks token in integrationAccessTokens; without one the request fails with USER_TOKEN_REQUIRED. See Connector access modes.
  • servicePrincipal: one shared service principal. The connector mints its tokens with OAuth M2M (client ID and secret), and a token the caller passes is ignored.

Neither mode falls back to the other, and Squid stores nothing per user.

Databricks setup​

For each Genie Agent the connector lists, the asking identity (each user, or the service principal) needs:

  1. Access to the Genie Agent itself: CAN VIEW or higher in its Share dialog.
  2. USE CATALOG, USE SCHEMA, and SELECT on the Unity Catalog tables the agent uses.
  3. CAN USE on the agent's SQL warehouse.

For servicePrincipal mode, create a service principal with workspace access, generate an OAuth secret for it, and grant it the three items above.

Adding the connector​

  1. Navigate to the Connectors tab in the Squid Console, click Available Connectors, and select Databricks Genie.
  2. Provide the configuration:

Connector ID: A string that uniquely identifies the connector in your code.

Workspace Host: The bare workspace hostname, such as dbc-1234abcd-5678.cloud.databricks.com, without https://, port, or path.

Authentication Mode: user or servicePrincipal.

Client ID and Client Secret: The service principal's OAuth credentials; servicePrincipal mode only. The secret is stored as a Squid secret.

Genie Agents: 1 to 50 agents, each with its agentId (the last segment of the agent's URL, /genie/rooms/<agentId>) and a description of up to 500 characters, which is what the model reads when choosing an agent.

Using the connector​

Connect it to an agent in Studio like any other connector ability. The agent gets three functions:

FunctionWhat it does
listGenieAgentsLists the configured agents, with each one's Databricks title and description as the asking identity sees them.
askGenieAsks a question (1 to 4,000 characters), in a new conversation or, with a conversationId, as a follow-up.
getGenieAnswerFetches the answer to a question Genie already accepted, such as one an earlier call returned as IN_PROGRESS.

In user mode, the frontend passes the user's Databricks token with the ask:

Client code
await squid.ai().agent('data-copilot').ask('Which region booked the most revenue in Q3?', {
integrationAccessTokens: {
// Keyed by the connector ID. On AWS/GCP: a Databricks OAuth (U2M) access
// token or personal access token. On Azure: those, or an Entra ID token for
// the Azure Databricks resource.
'databricks-genie': databricksToken,
},
});

Behavior and limits​

  • A finished answer carries the text, the SQL query, the result columns and rows (at most 100 rows and about 30,000 characters; truncated says something was cut, rowCount is the full size), and suggestedQuestions.
  • When Genie needs clarification, the answer carries followUpQuestion instead, and the agent continues in the same conversation.
  • One call takes at most 90 seconds end to end. An answer not finished by then returns status: "IN_PROGRESS" with the conversation and message IDs, and getGenieAnswer resumes it without asking again.
  • status: "FAILED" or "CANCELLED" carries Genie's error and errorType. A missing grant on the tables or warehouse surfaces as a failed Genie message; missing access to the agent itself is a denial.