Skip to content

Commit 482f9ff

Browse files
experimental: import ai-dev-kit skills into experimental/ directory (#73)
## Summary Adds an `experimental/` directory containing 19 agent skills from [databricks-solutions/ai-dev-kit](https://github.com/databricks-solutions/ai-dev-kit) `databricks-skills/`, imported as a snapshot on a **best-effort basis**. Excluded: `databricks-model-serving` (TODO #1b — different surface than stable, heavy MCP coupling) and `databricks-spark-declarative-pipelines` (TODO #5 — different surface than stable `databricks-pipelines`). `databricks-lakebase-provisioned` is not in the upstream `experimental` branch either, so absent here. The manifest now exposes both stable and experimental skills in a **single `skills` map**. Each entry carries a `repo_dir` field (`"skills"` or `"experimental"`) that points to the directory the skill lives in. Consumers derive experimental state from `repo_dir` — there is no parallel `experimental_skills` map and no per-skill `experimental` bool. Paired with [databricks/cli#5243](databricks/cli#5243) which teaches `databricks experimental aitools skills install` to: - read `repo_dir` and skip experimental entries by default, - install all of them with `--experimental`, - install one by name (with `--experimental` required and `-experimental` suffix on the install dir). ## Source Synced from [`f9b404b`](databricks-solutions/ai-dev-kit@f9b404b) on `databricks-solutions/ai-dev-kit:experimental`. Initial import was [`9c7a5b3`](databricks-solutions/ai-dev-kit@9c7a5b3) (head of [a-d-k PR #533](databricks-solutions/ai-dev-kit#533) on the `appkit-on-experimental` branch). PR #533 has since merged into `experimental` (`7b07f18`), and the branch has two further commits worth pulling: - [`0ebc38b`](databricks-solutions/ai-dev-kit@0ebc38b) "Surface silent failures in installer + dashboard skill" — updates `databricks-aibi-dashboards/SKILL.md` (CLI flag JSON-vs-flag form). - [`f9b404b`](databricks-solutions/ai-dev-kit@f9b404b) "Replace mas_manager.py with native supervisor-agents CLI" — updates `databricks-agent-bricks/SKILL.md` + `2-supervisor-agents.md` to the new supervisor-agents CLI group (Beta, CLI 0.299.2+); removes the 667-line `scripts/mas_manager.py` shim. Both pulled in commit `10baa35`. The fork branch's installer-side fixes (`5d2e6ac` / `39c349c` / `dd2257c`) are a-d-k tooling and don't touch `databricks-skills/`, so nothing to pull from there. ~~**Landing dependency**: a-d-k PR #533 should merge before this PR so the first periodic sync from a-d-k doesn't conflict.~~ **Resolved** — PR #533 merged upstream. The rename (`databricks-app-python` → `databricks-apps-python`) is preserved in the merged version, which is what prevents a 3rd skill-name collision with d-a-s's stable `databricks-apps`. ## Direction caveat — please read In the Apr 28 thread ([Slack link](https://databricks.slack.com/archives/C0AKALZU65P/p1778088227285599?thread_ts=1774540245.454779&cid=C0AKALZU65P)), Dustin's stated plan was to move `databricks-agent-skills` skills **into** `ai-dev-kit`'s `experimental` branch as defaults. **This PR goes the other direction** (a-d-k content → d-a-s/experimental). I don't see any d-a-s commits from Dustin yet, and the timing has slipped. Opening this so we have something concrete to iterate on — happy to drop it if the original direction is still preferred. ## TODOs / caveats for iteration 1. **Name collisions.** Resolved in this PR: - **1a. `databricks-jobs` — merged into stable.** Imported the comprehensive reference content from a-d-k's `databricks-jobs` skill into `skills/databricks-jobs/`, bumping version to `0.2.0`. The merged skill keeps stable's scaffolding workflow + `parent: databricks-core` hierarchy + Codex `agents/openai.yaml` + compatibility note, and adds the experimental's full task-types reference (9 types), trigger types (6), notifications/health/retries/queues, and 7 worked end-to-end examples. Layered structure: SKILL.md as overview + four reference files (`task-types.md`, `triggers-schedules.md`, `notifications-monitoring.md`, `examples.md`). Cleanups during merge: dropped trigger-spam description, normalized `/Workspace/Users/user@example.com/...` paths to `/Workspace/Shared/...`. The experimental copy is removed. With the single-map manifest shape, collisions are no longer possible — `_add_skill` raises if the same skill name shows up under both `skills/` and `experimental/`, so any future drift fails generation loudly. - **1b. `databricks-model-serving` — dropped from this PR.** After a deep compare, the two skills cover almost entirely different surfaces: stable is **ops-focused** (manage existing endpoints via CLI: `serving-endpoints create/get/query/update-config/build-logs/put-ai-gateway/get-permissions/...`, AI Gateway, traffic config, app integration via `databricks-apps` skill); experimental is **dev-focused** (build & ship MLflow models / GenAI agents: autolog → `mlflow.pyfunc.log_model` → `databricks.agents.deploy()` → query, with full Classical ML / Custom PyFunc / `ResponsesAgent` + LangGraph / UCFunctionToolkit / VectorSearchRetrieverTool coverage). Near-zero content overlap. Experimental version also has heavy MCP-tool dependency (60+ refs to ai-dev-kit's `manage_serving_endpoint`, `manage_workspace_files`, `manage_jobs`, `manage_job_runs`, `execute_code` that don't exist in the d-a-s/`databricks experimental aitools` flow). Removed `experimental/databricks-model-serving/` from this PR; manifest regenerated. **Follow-up**: port the high-value dev-side content into the stable skill — classical-ml autolog patterns (`mlflow.{sklearn,xgboost,lightgbm,pytorch,tensorflow,spark}.autolog()`), Custom PyFunc signatures, `ResponsesAgent` pattern with the `create_text_output_item` helper-method gotcha, `UCFunctionToolkit` + `VectorSearchRetrieverTool` with resource passthrough for auth, the Foundation Model API endpoint table. Strip MCP refs; replace with CLI/SDK equivalents. Owners: @databricks/eng-apps-devex (per CODEOWNERS). 2. ~~**CODEOWNERS for `experimental/`**~~ **Resolved.** Per @simonfaltum review: the top 10 a-d-k contributors (>=10 commits at import time) are now Code Owners of `/experimental/` alongside the d-a-s maintainers (@lennartkats-db, @simonfaltum, @databricks/eng-apps-devex), so their review satisfies the Required-Code-Owner-Review branch protection. Maintainer review still works as an alternate path. 3. ~~**No sync mechanism with upstream a-d-k.**~~ **Resolved with a paired RFC.** Two-part plan: - **Pre-lock (this PR)**: periodic manual re-syncs from upstream `ai-dev-kit` into `experimental/`. Documented in `experimental/README.md`. - **Post-lock (follow-up)**: invert the direction. a-d-k becomes the consumer; `databricks-skills/imported/` in a-d-k is a `git subtree` of this repo's `experimental/`. RFC PR opened against a-d-k: databricks-solutions/ai-dev-kit#530 (draft). To make subtree work, d-a-s needs to publish an `experimental-only` branch via `git subtree split --prefix=experimental` after every push to main — that's a small workflow to add here in a follow-up PR. A one-shot preview branch `experimental-only-preview` was pushed to this repo to enable the RFC demo and should be deleted once the auto-publish workflow lands. 4. ~~**No agent metadata.**~~ **Resolved.** Imported skills install fine on Codex CLI — the missing `agents/openai.yaml` was a cosmetic gap, not a functional blocker (skill files still get copied; only the marketplace UI metadata is absent). `scripts/skills.py` now auto-generates `agents/openai.yaml` + copies shared assets for each experimental skill on `generate`, using SKILL.md frontmatter as the source. Stubs are only written when missing, so upstream a-d-k can override by shipping its own files in the skill. The auto-generated names are titlecased from the skill key — most look good (`Databricks Iceberg`, `Databricks Genie`); a few degrade gracefully (`Databricks Aibi Dashboards`). Refining those is a follow-up. 5. ~~**`databricks-pipelines` was deliberately excluded.**~~ **Resolved.** a-d-k doesn't ship a `databricks-pipelines` skill under that name, but it *does* ship `databricks-spark-declarative-pipelines` covering the same product. After a deep compare, that experimental version covers a different surface than stable: scaffolding (`databricks pipelines init` + bundle/MCP workflow A/B/C), DLT migration guide, language-selection rules, per-language performance reference. The stable skill covers feature reference (decision tree, common traps, format options, fine-grained per-feature × per-language refs). Partial overlap; experimental's DAB-coupled workflow is the exact concern Dustin flagged in the Apr 28 Slack thread for demo-generator flows. **Removed `experimental/databricks-spark-declarative-pipelines/` from this PR**. **Follow-up TODO** (post-merge): port the high-value pieces into stable `skills/databricks-pipelines/` — DLT migration guide, workflow A/B/C decision matrix, per-language performance reference, language-selection rules. Strip MCP-tool refs. Owners: @lennartkats-db / @camielstee-db (per CODEOWNERS). 6. ~~**`spark-python-data-source` naming exception.**~~ **Kept as-is.** The skill is about the OSS Apache Spark 4+ PySpark DataSource API (building custom connector libraries), not a Databricks product — only lightly flavored with Databricks idioms. The convention break is acceptable given the content. 7. ~~**Versioning.**~~ **Resolved.** Bumped the `extract_version_from_skill` fallback in `scripts/skills.py` from `0.0.0` → `0.0.1` so the manifest never reports `0.0.0` (which some tools treat as \"unset\"). Applies to skills that currently have no explicit `version:` in their SKILL.md frontmatter. Skills with an explicit version are unchanged. The change is sync-safe: when upstream a-d-k eventually adds version fields, those win; until then, the manifest reports the floor. 8. ~~**`installed_dir` for experimental skills.**~~ **All experimental skills install under a `-experimental` suffix.** Every experimental skill installs to `~/.claude/skills/<name>-experimental/` regardless of whether there's a stable skill with the colliding base name. Implemented in [databricks/cli#5243](databricks/cli#5243) via a new `SourceName` field on `SkillMeta`: the install-side manifest key (and install dir) carry the `-experimental` suffix; `SourceName` preserves the unsuffixed name for fetching from `experimental/<name>/` in this repo. Users see at a glance which installed skills are experimental. 9. ~~**Excluded a-d-k content.**~~ **Confirmed scope.** Excluded: `TEMPLATE/` (template, not a skill), `install_skills.sh` + `install_genie_code_skills.py` (a-d-k's installers — we use the cli installer instead), `databricks-builder-app/` (a Python app for a-d-k's builder UI), `databricks-mcp-server/` (the a-d-k MCP server — separate concern from skills), `databricks-tools-core/` (Python lib used by a-d-k tooling — no experimental skill references it), `hooks/hooks.json` (a-d-k plugin lifecycle hooks tied to `\${CLAUDE_PLUGIN_ROOT}/.claude-plugin/setup.sh`/`check_update.sh` — plugin-specific, not skill content), plus top-level repo metadata (`.github/`, `LICENSE.md`, `README.md`, `VERSION`, `install.{sh,ps1}`, etc.). Verified no experimental skill cross-references any excluded path. 10. ~~**README placement.**~~ **Verified.** `experimental/README.md` retains the adapted a-d-k skill list with a top warning block; the root `README.md` has an \"Experimental Skills\" section with an install-by-name example. Three concrete fixes applied during the verification pass: (a) dropped the stale `databricks-model-serving` collision example since that skill was removed from the PR, (b) install commands updated to include the `-experimental` suffix + flag per TODO #8's resolution, (c) added a short note in `experimental/README.md` explaining why the in-repo dir names don't carry the suffix (it's added at install time). 11. ~~**Manifest shape.**~~ **Resolved.** Replaced the original two-map design (top-level `skills` + `experimental_skills` plus per-skill `experimental` bool) with a single `skills` map where each entry's `repo_dir` field is the source of truth. Rationale: the directory location in the repo already determines status, so it's the natural single source. Consumers derive experimental state from `repo_dir` (see cli's `SkillMeta.IsExperimental`). The manifest generator (`scripts/skills.py`) raises a clear error if the same skill name appears under both `skills/` and `experimental/`, so future drift fails generation rather than silently overwriting. ## Test plan - [x] `python3 scripts/skills.py generate` regenerates the manifest cleanly. - [x] `python3 scripts/skills.py validate` passes. - [ ] CI green on this branch. - [ ] Manual: `databricks experimental aitools skills install` (no flag) installs only stable skills. - [ ] Manual: `databricks experimental aitools skills install --experimental` installs both. - [ ] Manual: `databricks experimental aitools skills install databricks-iceberg-experimental` errors because it's experimental. - [ ] Manual: `databricks experimental aitools skills install databricks-iceberg-experimental --experimental` installs that one skill. This pull request and its description were written by Claude.
1 parent d4ed104 commit 482f9ff

170 files changed

Lines changed: 39341 additions & 161 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
/skills/databricks-model-serving/ @databricks/eng-apps-devex
77
/skills/databricks-jobs/ @lennartkats-db @camielstee-db
88
/skills/databricks-pipelines/ @lennartkats-db @camielstee-db
9+
10+
/experimental/ @lennartkats-db @simonfaltum @calreynolds @dustinvannoy-db
11+
912
/.github/CODEOWNERS @lennartkats-db @simonfaltum @fjakobs

.github/workflows/validate-manifest.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
paths:
66
- 'skills/**'
7+
- 'experimental/**'
78
- 'assets/**'
89
- 'scripts/skills.py'
910
- 'manifest.json'

README.md

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,55 @@ Skills for AI coding assistants (Claude Code, Cursor, etc.) that provide Databri
44

55
## Installation
66

7-
**For Claude Code:**
8-
97
```bash
108
databricks experimental aitools install
119
```
1210

13-
This installs skills to `~/.claude/skills/` for use with Claude Code.
11+
This auto-detects your coding agent(s) and installs the stable skills to the
12+
right location:
13+
14+
- **Claude Code**`~/.claude/skills/`
15+
- **Cursor**, **Codex CLI**, **OpenCode**, **GitHub Copilot**, **Antigravity**
16+
→ their respective skill directories
1417

15-
**For Cursor:**
18+
For finer control, use the `aitools skills install` subcommand directly — it
19+
accepts a positional skill name and an `--experimental` flag (see the
20+
[Experimental Skills](#experimental-skills) section).
1621

17-
Run this command in chat:
22+
**For Cursor (plugin marketplace alternative):**
1823

1924
```text
2025
/add-plugin databricks-skills
2126
```
2227

2328
## Available Skills
2429

25-
- **databricks-apps** - Build full-stack TypeScript apps on Databricks using AppKit
30+
Stable skills shipped from [`skills/`](./skills/):
31+
32+
- **databricks-core** — CLI, authentication, profile selection, data exploration. Parent skill for all product skills.
33+
- **databricks-apps** — Build full-stack TypeScript apps on Databricks using AppKit.
34+
- **databricks-dabs** — Declarative Automation Bundles (formerly Asset Bundles) for deploying and managing Databricks resources.
35+
- **databricks-jobs** — Lakeflow Jobs orchestration: task types, triggers, schedules, notifications.
36+
- **databricks-lakebase** — Lakebase Postgres: projects, branching, autoscaling, synced tables, Data API.
37+
- **databricks-model-serving** — Model Serving endpoint management, AI Gateway, traffic config.
38+
- **databricks-pipelines** — Lakeflow Spark Declarative Pipelines (formerly DLT) for batch and streaming.
39+
- **databricks-serverless-migration** — Migrate classic-compute workloads to serverless compute.
40+
41+
## Experimental Skills
42+
43+
The [`experimental/`](./experimental/) directory contains additional skills
44+
imported from [databricks-solutions/ai-dev-kit](https://github.com/databricks-solutions/ai-dev-kit)
45+
on a **best-effort basis**.
46+
47+
- Experimental skills are **not officially supported** — they may be used, but
48+
do not follow the same review / quality bar as the stable skills under
49+
[`skills/`](./skills/).
50+
- They are **not installed by default** by `databricks aitools install`.
51+
Pass `--experimental` to install all of them, or install a specific one
52+
by name (with the `--experimental` flag — e.g. `databricks aitools install
53+
databricks-iceberg --experimental`).
54+
- See [`experimental/README.md`](./experimental/README.md) for the full list
55+
and caveats.
2656

2757
## Structure
2858

@@ -38,21 +68,24 @@ skill-name/
3868

3969
### Adding New Skills
4070

41-
When experimenting with new skill variations, create a "subskill" that references the main skill and adds specific guidance:
71+
For a narrower variation of an existing skill, create a subskill that declares
72+
its parent via frontmatter. This is how the stable skills are organized today
73+
— each product skill sets `parent: databricks-core`.
4274

4375
```markdown
4476
---
45-
name: "ai-databricks-apps"
46-
description: "Databricks apps with AI features"
77+
name: "databricks-apps-chatbots"
78+
description: "Databricks apps with chatbot features"
79+
parent: databricks-apps
4780
---
4881

49-
# AI powered Databricks Apps
82+
# Chatbot Apps
5083

51-
First, load the base databricks-apps skill for foundational guidance.
84+
**FIRST**: Use the parent `databricks-apps` skill for app development basics.
5285

53-
Then apply these additional patterns:
54-
- Custom pattern 1
55-
- Custom pattern 2
86+
Then apply these patterns:
87+
- Pattern 1
88+
- Pattern 2
5689
```
5790

5891
This approach:

experimental/README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
> ⚠️ **Experimental: best-effort, not officially supported**
2+
>
3+
> The skills in this directory are imported from
4+
> [databricks-solutions/ai-dev-kit](https://github.com/databricks-solutions/ai-dev-kit)
5+
> on a best-effort basis. They may be useful, but they are **not officially
6+
> supported** as part of `databricks-agent-skills`:
7+
>
8+
> - They do not follow the same review / quality bar as the skills in
9+
> [`../skills/`](../skills/).
10+
> - They may be out of date relative to upstream `ai-dev-kit`.
11+
> - They are not installed by `databricks aitools install` by default —
12+
> you have to opt in (see the root README).
13+
>
14+
> File issues against this directory in this repo; do not file issues against
15+
> `ai-dev-kit` for skills installed via `databricks-agent-skills`.
16+
17+
---
18+
19+
# Databricks Skills for Claude Code
20+
21+
Skills that teach Claude Code how to work effectively with Databricks - providing patterns, best practices, and code examples that work with Databricks MCP tools.
22+
23+
## Installation
24+
25+
These experimental skills are **not** installed by default. To install them via the Databricks CLI:
26+
27+
```bash
28+
# Install all experimental skills at once
29+
databricks aitools install --experimental
30+
31+
# Install a single experimental skill by name
32+
databricks aitools install databricks-iceberg --experimental
33+
```
34+
35+
See the root [README](../README.md) for details on the stable install path.
36+
37+
## Available Skills
38+
39+
### 🤖 AI & Agents
40+
- **databricks-ai-functions** - Built-in AI Functions (ai_classify, ai_extract, ai_summarize, ai_query, ai_forecast, ai_parse_document, and more) with SQL and PySpark patterns, function selection guidance, document processing pipelines, and custom RAG (parse → chunk → index → query)
41+
- **databricks-agent-bricks** - Knowledge Assistants, Genie Spaces, Supervisor Agents
42+
- **databricks-mlflow-evaluation** - End-to-end agent evaluation workflow
43+
- **databricks-unstructured-pdf-generation** - Generate synthetic PDFs for RAG
44+
- **databricks-vector-search** - Vector similarity search for RAG and semantic search
45+
46+
### 📊 Analytics & Dashboards
47+
- **databricks-aibi-dashboards** - Databricks AI/BI dashboards (with SQL validation workflow)
48+
- **databricks-metric-views** - Metric Views for governed metrics
49+
- **databricks-unity-catalog** - System tables for lineage, audit, billing
50+
51+
### 🔧 Data Engineering
52+
- **databricks-dbsql** - Databricks SQL warehouse patterns
53+
- **databricks-iceberg** - Apache Iceberg tables (Managed/Foreign), UniForm, Iceberg REST Catalog, Iceberg Clients Interoperability
54+
- **databricks-spark-structured-streaming** - Spark Structured Streaming patterns
55+
- **databricks-synthetic-data-gen** - Realistic test data with Faker
56+
- **databricks-zerobus-ingest** - Zerobus ingest patterns
57+
- **spark-python-data-source** - Python data sources for Spark
58+
59+
### 🚀 Development & Deployment
60+
- **databricks-apps-python** - Databricks apps. Prefers AppKit (TypeScript + React SDK) for new apps; falls back to Python frameworks (Dash, Streamlit, Gradio, Flask, FastAPI, Reflex) when Python is required
61+
- **databricks-python-sdk** - Python SDK, Connect, CLI, REST API
62+
- **databricks-execution-compute** - Execute on Databricks compute
63+
64+
> **Use the stable skill instead** for:
65+
> - **DABs / bundles** — use stable [`databricks-dabs`](../skills/databricks-dabs/)
66+
> - **Lakebase Postgres** (projects, branching, synced tables, autoscaling) — use stable [`databricks-lakebase`](../skills/databricks-lakebase/)
67+
> - **CLI auth / profiles / workspace config** — use stable [`databricks-core`](../skills/databricks-core/)
68+
>
69+
> Previously experimental copies of these (`databricks-bundles`, `databricks-lakebase-autoscale`, `databricks-config`) were already merged with the stable skills.
70+
71+
### 📚 Reference
72+
- **databricks-docs** - Documentation index via llms.txt
73+
74+
## Provenance
75+
76+
These skills are imported as a snapshot from
77+
[`databricks-solutions/ai-dev-kit/databricks-skills/`](https://github.com/databricks-solutions/ai-dev-kit/tree/main/databricks-skills).
78+
79+
**Source SHA**: [`20a92a3`](https://github.com/databricks-solutions/ai-dev-kit/commit/20a92a38144ca5228f1dfe4cc0be46da40ec9177)
80+
on the `experimental` branch of `databricks-solutions/ai-dev-kit`.
81+
82+
While `ai-dev-kit` is the upstream source, this directory receives periodic
83+
manual re-syncs.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Knowledge Assistants - Details
2+
3+
For commands, see [SKILL.md](SKILL.md).
4+
5+
## Source Types
6+
7+
Both shapes go inside the `--json` body alongside `display_name` and `description` — see SKILL.md for the full invocation.
8+
9+
### Files (Volume)
10+
11+
```json
12+
{
13+
"display_name": "...",
14+
"description": "...",
15+
"source_type": "files",
16+
"files": {"path": "/Volumes/catalog/schema/volume/folder/"}
17+
}
18+
```
19+
20+
Supported formats: PDF, TXT, MD, DOCX.
21+
22+
### Vector Search Index
23+
24+
Use an existing index instead of auto-indexing:
25+
26+
```json
27+
{
28+
"display_name": "...",
29+
"description": "...",
30+
"source_type": "index",
31+
"index": {
32+
"index_name": "catalog.schema.my_index",
33+
"text_col": "content",
34+
"doc_uri_col": "source_url"
35+
}
36+
}
37+
```
38+
39+
## Updating Content
40+
41+
1. Add/modify/remove files in the Volume
42+
2. Re-sync: `databricks knowledge-assistants sync-knowledge-sources "knowledge-assistants/{ka_id}"`
43+
44+
## Troubleshooting
45+
46+
**KA stays in CREATING:**
47+
- Wait up to 10 minutes
48+
- Check workspace quotas
49+
- Verify volume path exists
50+
51+
**Documents not indexed:**
52+
- Check file format (PDF, TXT, MD, DOCX)
53+
- Verify volume path (trailing slash matters)
54+
- Check file permissions
55+
56+
**Poor answer quality:**
57+
- Ensure documents are well-structured
58+
- Break large documents into smaller files
59+
- Add clear headings and sections
60+
61+
## Evaluation Questions
62+
63+
When testing a KA, check if the volume or project contains a `pdf_eval_questions.json` file with test questions:
64+
65+
```json
66+
{
67+
"api_errors_guide.pdf": {
68+
"question": "What is the solution for error ERR-4521?",
69+
"expected_fact": "Call /api/v2/auth/refresh with refresh_token before the 3600s TTL expires"
70+
}
71+
}
72+
```
73+
74+
Use these questions to validate retrieval accuracy. See [databricks-unstructured-pdf-generation](../databricks-unstructured-pdf-generation/SKILL.md) for generating test PDFs with eval questions.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Supervisor Agents - Details
2+
3+
For commands, see [SKILL.md](SKILL.md). All operations use the native `databricks supervisor-agents` CLI (Beta, requires CLI ≥ 0.299.2).
4+
5+
## Unity Catalog Functions
6+
7+
Call registered UC functions from the Supervisor Agent.
8+
9+
**Prerequisites:**
10+
- UC Function exists (`CREATE FUNCTION` or Python UDF)
11+
- Grant execute: `GRANT EXECUTE ON FUNCTION catalog.schema.func TO \`<agent_sp>\`;`
12+
13+
**Attach as a tool:**
14+
```bash
15+
databricks supervisor-agents create-tool supervisor-agents/<id> enricher --json '{
16+
"tool_type": "uc_function",
17+
"description": "Enriches customer records",
18+
"uc_function": {"name": "catalog.schema.enrich_data"}
19+
}'
20+
```
21+
22+
## External MCP Servers
23+
24+
Connect to external systems (ERP, CRM) via UC HTTP Connection implementing MCP protocol.
25+
26+
**1. Create UC HTTP Connection:**
27+
```sql
28+
CREATE CONNECTION my_mcp TYPE HTTP
29+
OPTIONS (
30+
host 'https://my-app.databricksapps.com',
31+
port '443',
32+
base_path '/api/mcp',
33+
client_id '<sp_id>',
34+
client_secret '<sp_secret>',
35+
oauth_scope 'all-apis',
36+
token_endpoint 'https://<workspace>.azuredatabricks.net/oidc/v1/token',
37+
is_mcp_connection 'true'
38+
);
39+
```
40+
41+
**2. Grant access:**
42+
```sql
43+
GRANT USE CONNECTION ON my_mcp TO `<agent_sp>`;
44+
```
45+
46+
**3. Attach as a tool:**
47+
```bash
48+
databricks supervisor-agents create-tool supervisor-agents/<id> operations --json '{
49+
"tool_type": "uc_connection",
50+
"description": "Execute operations: approve invoices, trigger workflows",
51+
"uc_connection": {"name": "my_mcp"}
52+
}'
53+
```
54+
55+
**Test connection:**
56+
```sql
57+
SELECT http_request(conn => 'my_mcp', method => 'POST', path => '', json => '{"jsonrpc":"2.0","method":"tools/list","id":1}');
58+
```
59+
60+
## Writing Good Descriptions
61+
62+
The `description` field drives routing. Be specific:
63+
64+
| Good | Bad |
65+
|------|-----|
66+
| "Handles billing: invoices, payments, refunds, subscriptions" | "Billing agent" |
67+
| "Answers API errors, integration issues, product bugs" | "Technical" |
68+
| "HR policies, PTO, benefits, employee handbook" | "Handles stuff" |
69+
70+
## Adding Examples
71+
72+
Examples help evaluation and routing optimization. **The serving endpoint must be ONLINE.** Right after `create-supervisor-agent` (or a structural `update-supervisor-agent`), the endpoint takes **up to ~10 minutes** to come ONLINE. Examples can be added before that — they're stored on the agent definition — but querying the endpoint to evaluate routing requires readiness.
73+
74+
```bash
75+
# Add an example (guidelines is a repeated string — must use --json)
76+
databricks supervisor-agents create-example supervisor-agents/<id> --json '{
77+
"question": "I need my invoice for March",
78+
"guidelines": ["Route to billing_agent"]
79+
}'
80+
81+
databricks supervisor-agents create-example supervisor-agents/<id> --json '{
82+
"question": "API returns 500 error",
83+
"guidelines": ["Route to tech_agent"]
84+
}'
85+
86+
# List / inspect / remove
87+
databricks supervisor-agents list-examples supervisor-agents/<id>
88+
databricks supervisor-agents get-example supervisor-agents/<id>/examples/<ex_id>
89+
databricks supervisor-agents delete-example supervisor-agents/<id>/examples/<ex_id>
90+
91+
# Check endpoint readiness before querying
92+
databricks serving-endpoints get <endpoint_name>
93+
```
94+
95+
## Troubleshooting
96+
97+
**Wrong routing:**
98+
- Improve agent descriptions (more specific, less overlap)
99+
- Add examples demonstrating correct routing
100+
101+
**Endpoint not responding:**
102+
- Verify underlying endpoints are running
103+
- Check endpoint logs
104+
105+
**Slow responses:**
106+
- Check underlying endpoint latency
107+
- Review endpoint scaling settings

0 commit comments

Comments
 (0)