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 inintegrationAccessTokens; without one the request fails withUSER_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:
- Access to the Genie Agent itself: CAN VIEW or higher in its Share dialog.
USE CATALOG,USE SCHEMA, andSELECTon the Unity Catalog tables the agent uses.- 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
- Navigate to the Connectors tab in the Squid Console, click Available Connectors, and select Databricks Genie.
- 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:
| Function | What it does |
|---|---|
listGenieAgents | Lists the configured agents, with each one's Databricks title and description as the asking identity sees them. |
askGenie | Asks a question (1 to 4,000 characters), in a new conversation or, with a conversationId, as a follow-up. |
getGenieAnswer | Fetches 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:
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 resultcolumnsandrows(at most 100 rows and about 30,000 characters;truncatedsays something was cut,rowCountis the full size), andsuggestedQuestions. - When Genie needs clarification, the answer carries
followUpQuestioninstead, 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, andgetGenieAnswerresumes it without asking again. status: "FAILED"or"CANCELLED"carries Genie'serroranderrorType. A missing grant on the tables or warehouse surfaces as a failed Genie message; missing access to the agent itself is a denial.