databricks/databricks-agent-skills/skills/databricks-genie-agents/SKILL.md
databricks-genie-agents
Create, manage, and query Databricks Genie Agents — curated, per-data natural-language agents (formerly Genie Spaces): build, export/import, migrate across workspaces, and ask questions of a *specific* Agent via the Conversation API. For general data questions or finding data across your workspace, use databricks-data-discovery (Genie One) instead.
- Source repository stars
- 277
- Declared platforms
- 0
- Static risk flags
- 2
- Last source update
- 2026-08-19
- Source checked
- 2026-08-25
Decision brief
What it does: where it fits
Create, manage, and query Genie Agents (formerly Genie Spaces) - natural language interfaces for SQL-based data exploration.
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/databricks/databricks-agent-skills --skill "skills/databricks-genie-agents"Inspect the Agent Skill "databricks-genie-agents" from https://github.com/databricks/databricks-agent-skills/blob/653db600b4c1525850d7fed9c9171914908c57b0/skills/databricks-genie-agents/SKILL.md at commit 653db600b4c1525850d7fed9c9171914908c57b0. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Step 1: Understand the Data
Before creating a Genie Agent, explore the available tables to: - Select relevant tables — typically gold layer (aggregated KPIs) and sometimes silver layer (cleaned facts) or metric views - Understand the story — what business questions can this data answer? What insights can u…
Select relevant tables — typically gold layer (aggregated KPIs) and sometimes silver layer (cleaned facts) or metric viewsUnderstand the story — what business questions can this data answer? What insights can users discover?Design meaningful sample questions — questions should reflect real use cases and lead to actionable insights in the data - 02
Step 2: Create the Genie Agent
Define your Genie Agent in a local JSON file (e.g., genieagent.json) for version control and easy iteration. See "serializedspace Format" below for the full structure.
Define your Genie Agent in a local JSON file (e.g., genieagent.json) for version control and easy iteration. See "serializedspace Format" below for the full structure. - 03
Step 3: Test and Iterate
Use the Conversation API (section below) to ask questions and verify answers. If answers are inaccurate or incomplete, improve the agent — see "Improving a Genie Agent" below.
Use the Conversation API (section below) to ask questions and verify answers. If answers are inaccurate or incomplete, improve the agent — see "Improving a Genie Agent" below. - 04
Import: same stringify pattern as Step 2 (Create)
databricks genie create-space --json "{ \"warehouseid\": \"WAREHOUSEID\", \"title\": \"Sales Analytics\", \"description\": \"Migrated agent\", \"parentpath\": \"/Workspace/Users/[email protected]/geniespaces\", \"serializedspace\": $(cat genieagent.json | jq -c '.' | jq -Rs '.') }…
databricks genie create-space --json "{ \"warehouseid\": \"WAREHOUSEID\", \"title\": \"Sales Analytics\", \"description\": \"Migrated agent\", \"parentpath\": \"/Workspace/Users/[email protected]/geniespaces\", \"serializ… - 05
1. Edit your local genieagent.json (add questions, fix SQL examples, improve instructions)
Review the “1. Edit your local genieagent.json (add questions, fix SQL examples, improve instructions)” section in the pinned source before continuing.
Review and apply the “1. Edit your local genieagent.json (add questions, fix SQL examples, improve instructions)” source section.
Permission review
Static risk signals and limitations
Writes files
The documentation asks the agent to create, modify, or delete local files.
# Create a Genie Agent from a local fileRuns scripts
The documentation asks the agent to run terminal commands or scripts.
python3 -c "import sys; p=sys.argv[1]; open(p,'w').write(open(p).read().replace('source_catalog','target_catalog'))" genie_agent.jsonEvidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 277 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- databricks/databricks-agent-skills
- Skill path
- skills/databricks-genie-agents/SKILL.md
- Commit
- 653db600b4c1525850d7fed9c9171914908c57b0
- License
- NOASSERTION
- Collected
- 2026-08-25
- Default branch
- main
View the original SKILL.md
Databricks Genie Agents
Create, manage, and query Genie Agents (formerly Genie Spaces) - natural language interfaces for SQL-based data exploration.
Overview
Genie Agents allow users to ask natural language questions about structured data in Unity Catalog. The system translates questions into SQL queries, executes them on a SQL warehouse, and presents results conversationally.
A Genie Agent is a curated agent scoped to specific data — its tables, sample questions, and instructions are authored for a particular business area. This is distinct from Genie One / the general "ask Genie" data-discovery path (see the databricks-data-discovery skill), which answers questions across your data without a curated, per-scope agent.
Creating a Genie Agent
Step 1: Understand the Data
Before creating a Genie Agent, explore the available tables to:
- Select relevant tables — typically gold layer (aggregated KPIs) and sometimes silver layer (cleaned facts) or metric views
- Understand the story — what business questions can this data answer? What insights can users discover?
- Design meaningful sample questions — questions should reflect real use cases and lead to actionable insights in the data
Use discover-schema as the default — one call returns columns, types, sample rows, null counts, and row count. If you only know the schema, list tables first with query "SHOW TABLES IN ...".
databricks experimental aitools tools discover-schema catalog.schema.gold_sales catalog.schema.gold_customers
For Genie, knowing column distribution shapes the sample questions and text instructions. If you don't already know the data, probe cardinality, ranges, and top categorical values with aggregate SQL through databricks experimental aitools tools query --warehouse <WH> "..." so your sample questions reflect what's actually in the data. Both commands auto-pick the default warehouse; set DATABRICKS_WAREHOUSE_ID or pass --warehouse <ID> to override.
Fan out independent probes with databricks experimental aitools tools statement submit (returns a statement_id immediately) + ... get (blocks until terminal: SUCCEEDED|FAILED|CANCELED|CLOSED):
SIDS=()
for q in "$@"; do
SIDS+=( "$(databricks experimental aitools tools statement submit --warehouse "$WH" "$q" | jq -r .statement_id)" )
done
for s in "${SIDS[@]}"; do databricks experimental aitools tools statement get "$s"; done
# Use `status` for non-blocking peek; `cancel` to terminate.
Step 2: Create the Genie Agent
Define your Genie Agent in a local JSON file (e.g., genie_agent.json) for version control and easy iteration. See "serialized_space Format" below for the full structure.
# List all Genie Agents
databricks genie list-spaces
# Create a Genie Agent from a local file
# IMPORTANT: sample_questions require a 32-char hex "id" and "question" must be an array
# IMPORTANT: parent_path must ALREADY EXIST — create it first, or create fails with
# "Tree node with path ... does not exist":
databricks workspace mkdirs /Workspace/Users/[email protected]/genie_spaces
databricks genie create-space --json "{
\"warehouse_id\": \"WAREHOUSE_ID\",
\"title\": \"Sales Analytics\",
\"description\": \"Explore sales data\",
\"parent_path\": \"/Workspace/Users/[email protected]/genie_spaces\",
\"serialized_space\": $(cat genie_agent.json | jq -c '.' | jq -Rs '.')
}"
# Get agent details (with full config)
databricks genie get-space SPACE_ID --include-serialized-space
# Tag the Genie Agent for resource tracking — use any tag the user indicated for their
# project; otherwise default to `ai_generated_source=databricks-agent-skills`.
# (Beta CLI surface — ignore if the command fails.)
databricks workspace-entity-tag-assignments create-tag-assignment \
geniespaces SPACE_ID ai_generated_source --tag-value databricks-agent-skills || true
# Delete a Genie Agent
databricks genie trash-space SPACE_ID
Step 3: Test and Iterate
Use the Conversation API (section below) to ask questions and verify answers. If answers are inaccurate or incomplete, improve the agent — see "Improving a Genie Agent" below.
Export & Import
Convention: genie_agent.json always holds the parsed agent object (not a JSON-string-encoded blob), so it's readable and editable. At each use site we stringify it with jq -c '.' | jq -Rs '.' — same pattern as Step 2 Create and "Improving a Genie Agent" below. jq -r '.serialized_space | fromjson' on export strips the outer quoting so the file is already a parsed object.
# Export: extract serialized_space AND unwrap it to a parsed object on disk
databricks genie get-space SPACE_ID --include-serialized-space -o json \
| jq '.serialized_space | fromjson' > genie_agent.json
# Import: same stringify pattern as Step 2 (Create)
databricks genie create-space --json "{
\"warehouse_id\": \"WAREHOUSE_ID\",
\"title\": \"Sales Analytics\",
\"description\": \"Migrated agent\",
\"parent_path\": \"/Workspace/Users/[email protected]/genie_spaces\",
\"serialized_space\": $(cat genie_agent.json | jq -c '.' | jq -Rs '.')
}"
Improving a Genie Agent
Recommendation-first: when asked to optimize, tune, or fix an Agent (or its queries/tables), start by diagnosing and presenting a recommended change — do not run mutating actions (update-space, ALTER, OPTIMIZE, liquid clustering, warehouse changes) until the user approves. Diagnose with read-only queries only.
Wrong filter values (Genie filters on a value that returns nothing — e.g. asking for cancelled when the column stores a different code or casing): fix with prompt matching / synonyms mapping the user's term to the actual categorical value, not a hardcoded text instruction.
When Genie answers are inaccurate or incomplete, improve the agent by updating questions, SQL examples, or instructions:
# 1. Edit your local genie_agent.json (add questions, fix SQL examples, improve instructions)
# 2. Push updates back to the agent
databricks genie update-space SPACE_ID --json "{\"serialized_space\": $(cat genie_agent.json | jq -c '.' | jq -Rs '.')}"
serialized_space Format
The serialized_space field is a JSON string containing the full space configuration.
Field Format Requirements
IMPORTANT: All items in sample_questions, example_question_sqls, and text_instructions require a unique id field.
| Field | Format |
|---|---|
config.sample_questions[] | {"id": "32hexchars", "question": ["..."]} |
instructions.example_question_sqls[] | {"id": "32hexchars", "question": ["..."], "sql": ["..."]} |
instructions.text_instructions[] | {"id": "32hexchars", "content": ["..."]} |
- ID format: 32-character lowercase hex, unique across all three lists combined (a duplicate between e.g.
text_instructionsandexample_question_sqlsis rejected). - Text fields are arrays:
question,sql, andcontentare arrays of strings, not plain strings. - Sort order matters:
data_sources.tablesmust be sorted byidentifier, and each table'scolumn_configsmust be sorted bycolumn_name;example_question_sqlsandtext_instructionsmust be sorted byid. (sample_questionsis silently re-sorted server-side.) text_instructionsaccepts at most one item — the API rejects more than one (text_instructions must contain at most one item). Merge all guidance (persona, table guide, investigation flow, answer style) into a single entry.- Simple ID scheme that satisfies both rules: prefix per list + monotonic counter, total 32 hex chars —
1…0001,1…0002forsample_questions;2…0001,2…0002forexample_question_sqls;3…0001fortext_instructions. Authoring order = sort order, no collisions. benchmarksis a top-level key ofserialized_space(alongsideversion/config/data_sources/instructions), not nested underinstructions. Each item takes a unique 32-char hexid.
Text Instructions
text_instructions make the Genie Agent more reliable by explaining:
- Where to find information — which tables contain which metrics
- How to answer specific questions — when a user asks X, use table Y with filter Z
- Business context — definitions, thresholds, and domain knowledge
Well-crafted instructions significantly improve answer accuracy.
Example
Top-level keys are version, config, data_sources, instructions. Every item in sample_questions, example_question_sqls, and text_instructions needs a unique 32-char hex id and all text fields are arrays:
{
"version": 2,
"config": {
"sample_questions": [
{"id": "10000000000000000000000000000001", "question": ["What is our current on-time performance?"]}
]
},
"data_sources": {
"tables": [
{"identifier": "catalog.ops.gold_otp_summary"}
]
},
"instructions": {
"example_question_sqls": [
{
"id": "20000000000000000000000000000001",
"question": ["What is our on-time performance?"],
"sql": ["SELECT flight_date, ROUND(SUM(on_time_count) * 100.0 / SUM(total_flights), 1) AS otp_pct\n", "FROM catalog.ops.gold_otp_summary\n", "WHERE flight_date >= date_sub(current_date(), 7)\n", "GROUP BY flight_date ORDER BY flight_date"]
}
],
"text_instructions": [
{
"id": "30000000000000000000000000000001",
"content": [
"On-time performance (OTP) questions: Use gold_otp_summary table. OTP target is 85%.\n",
"Delay analysis questions: Use gold_delay_analysis table. Filter by delay_code for specific delay types.\n",
"When asked about 'this week' or 'recent': Use flight_date >= date_sub(current_date(), 7).\n",
"When comparing aircraft: Join with gold_aircraft_reliability on tail_number."
]
}
]
}
}
Cross-Workspace Migration
When migrating between workspaces, catalog names often differ. Export the agent, remap with sed, then import:
python3 -c "import sys; p=sys.argv[1]; open(p,'w').write(open(p).read().replace('source_catalog','target_catalog'))" genie_agent.json
Use DATABRICKS_CONFIG_PROFILE=profile_name to target different workspaces.
Conversation API
Scope: use this to query one specific Genie Agent — typically to validate an Agent after creating or editing it, or to lean on its curated business logic and certified queries. For general natural-language data questions or finding data across your workspace, don't use this — route to the databricks-data-discovery skill (Genie One) instead.
Ask questions of a specific Agent via three CLI primitives: start-conversation, create-message (follow-ups), and get-message (state + SQL + text). --no-wait on start-conversation / create-message returns immediately with {conversation_id, message_id}; poll get-message until .status is COMPLETED, FAILED, or CANCELLED. Intermediate states you'll see: SUBMITTED, FILTERING_CONTEXT, ASKING_AI, EXECUTING_QUERY.
# Start a new conversation (async — get IDs back immediately)
databricks genie start-conversation --no-wait SPACE_ID "What were total sales last month?"
# → {"conversation_id": "...", "message_id": "..."}
# Poll state
databricks genie get-message SPACE_ID CONV_ID MSG_ID | jq '{status, error}'
# When COMPLETED, pull the generated SQL and any text reply
databricks genie get-message SPACE_ID CONV_ID MSG_ID \
| jq '.attachments[] | {sql: .query.query, description: .query.description, text: .text.content}'
# Fetch the query result rows (columns + data_array)
databricks genie get-message-attachment-query-result SPACE_ID CONV_ID MSG_ID ATTACHMENT_ID \
| jq '{columns: .statement_response.manifest.schema.columns | map({name, type: .type_name}),
rows: .statement_response.result.data_array}'
# Follow-up in the same conversation (Genie remembers context)
databricks genie create-message --no-wait SPACE_ID CONV_ID "Break that down by region"
Start a new conversation for unrelated topics. Use create-message (same CONV_ID) only for follow-ups on the same topic.
On FAILED, get-message populates .error.error with the underlying error string (e.g. [INSUFFICIENT_PERMISSIONS] ...) and .error.type (e.g. SQL_EXECUTION_EXCEPTION). Attachments may still include suggested_questions even when the primary query failed.
Troubleshooting
| Issue | Solution |
|---|---|
sample_question.id must be provided | Add 32-char hex UUID id to each sample question |
Expected an array for question | Use "question": ["text"] not "question": "text" |
| No warehouse available | Create a SQL warehouse or provide warehouse_id |
Empty serialized_space on export | Requires CAN EDIT permission on the agent |
| Tables not found after migration | Remap catalog name in serialized_space before import |
| Slow answers / query timeouts | Size up the warehouse attached to the agent; simplify or pre-aggregate tall source tables |
| Wrong or empty answers | Add example_question_sqls and text_instructions — see "Improving a Genie Agent" |
Related Skills
- databricks-data-discovery - General natural-language data exploration / "ask Genie" (Genie One) across your data; use it when you are not targeting a specific curated Genie Agent
- databricks-synthetic-data-gen - Generate data for Genie tables
- databricks-pipelines - Build bronze/silver/gold tables
Frequently asked questions
What to verify before installation and use
What does the databricks-genie-agents source document cover?
Create, manage, and query Genie Agents (formerly Genie Spaces) - natural language interfaces for SQL-based data exploration.
How do I install databricks-genie-agents?
The source record exposes this install command: npx skills add https://github.com/databricks/databricks-agent-skills --skill "skills/databricks-genie-agents". Inspect the command and pinned source before running it.
Which permission-related actions were detected?
Static rules flagged write-files, exec-script in the source; the page lists the matching lines and excerpts.
Alternatives
Compare before choosing
JasonColapietro/suede-creator-skills
suede-ab-testing
Suede-owned experimentation discipline for hypotheses, sample sizing, test duration, significance, and repeatable experiment programs. Use when comparing variants, deciding whether a result is reliable, or building an experiment backlog and cadence. NOT FOR: analytics instrumentation (use suede-analytics), post-click conversion diagnosis (use suede-site-alchemy), or writing the variant copy itself (use suede-copy).
narrative-io/narrative-skills-marketplace
design-analysis
Translate a fuzzy analytical question into a rigorous investigation plan. Interrogates the ask, grounds the plan in the available data dictionary, applies analytical best practices, and produces a structured brief of query specifications for a downstream query-writing skill. Plans, does not write SQL. Use when: "why did X drop", "is there a relationship between A and B", "who are our highest-value customers", "what's driving the change in Y", "investigate this trend", "design an analysis for", "
rampstackco/claude-skills
data-warehouse-experimentation
Running experiments out of the data warehouse instead of via dedicated experiment platforms. SQL-based assignment, exposure logging discipline, metric definitions in dbt models, statistical analysis in SQL or Python, variance reduction with CUPED, sequential testing, and the operational tradeoffs vs platforms like Statsig and Optimizely. Triggers on warehouse-native experimentation, run experiments in BigQuery, run experiments in Snowflake, dbt experiments, SQL t-test, CUPED variance reduction,
alirezarezvani/claude-skills
ab-test-setup
When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.