databricks-agent-bricks について
databricks-agent-bricksは、Databricks CLIを使ったKnowledge AssistantとSupervisor Agentの作成方法を解説します。ドキュメントの参照元、下流ツールとの接続、ドキュメントQ&Aや複数エージェント連携のルーティング例を扱います。
主な機能
- 01ドキュメント対応Knowledge Assistantの作成
- 02Supervisor Agentのルーティング設定
- 03Genie、UC関数、その他リソースとの接続
- 04エージェントを導く例の追加
- 05CLIによるリソース管理
活用シーン
- 01Volume内のPDFやテキストを使ったドキュメントQ&A
- 02質問を専門エージェントへ振り分け
- 03Genie spaceによる自然言語データ検索
- 04Supervisor Agentから外部MCPサーバーを呼び出す
MCP 対応
UC HTTP Connectionを介して、外部MCPサーバーをSupervisor Agentのツールとして接続する方法を説明します。Supervisor Agentは複数のエージェントやリソースを連携させられます。
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ databricks/ databricks-agent-skills --skill databricks-agent-bricksインストール後、Claude Code で/databricks-agent-bricksを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
agents/openai.yamlassets/databricks.svgreferences/1-knowledge-assistants.md2-supervisor-agents.md詳細
Agent Bricks
Agent Bricks は、Databricks の会話型インターフェースを提供する、事前構築済みの AI タイルです。このスキルでは、Knowledge Assistants と Supervisor Agents を扱います。
| Brick | 目的 | このスキル |
|---|---|---|
| Knowledge Assistant (KA) | Volumes 内の PDF/テキストを対象に、RAG を使用したドキュメント Q&A | ✓ |
| Supervisor Agent | 複数のエージェント(KA、エンドポイント、UC 関数、MCP)をオーケストレーション | ✓ |
Knowledge Assistant
# Find volumes
databricks volumes list CATALOG SCHEMA
databricks experimental aitools tools query --warehouse WH "LIST '/Volumes/catalog/schema/volume/'"
# Create KA
databricks knowledge-assistants create-knowledge-assistant "Name" "Description"
# Add knowledge source. With --json, pass ONLY the PARENT as a positional arg
# and put display_name / description / source_type / the source body (files|index|file_table)
# inside the JSON. Mixing positional DISPLAY_NAME/DESCRIPTION/SOURCE_TYPE with --json errors.
databricks knowledge-assistants create-knowledge-source \
"knowledge-assistants/{ka_id}" \
--json '{
"display_name": "Docs",
"description": "Documentation files",
"source_type": "files",
"files": {"path": "/Volumes/catalog/schema/volume/"}
}'
# Sync and check status
databricks knowledge-assistants sync-knowledge-sources "knowledge-assistants/{ka_id}"
databricks knowledge-assistants get-knowledge-assistant "knowledge-assistants/{ka_id}"
# List/manage
databricks knowledge-assistants list-knowledge-assistants
databricks knowledge-assistants delete-knowledge-assistant "knowledge-assistants/{ka_id}" # destructive & irreversible — confirm the id first
ソースの種類: files(Volume パス)または index(Vector Search:index.index_name、index.text_col、index.doc_uri_col)
ステータス: CREATING(2~5 分)→ ONLINE → OFFLINE
Supervisor Agent
ネイティブ CLI:databricks supervisor-agents(ベータ版、CLI ≥ v1.0.0 が必要)。リソースパスは supervisor-agents/{id} のような形式です。各コマンドには、その完全なパスか、同じ形式の PARENT を指定します。list-supervisor-agents と list-examples/list-tools は、JSON 配列をそのまま返します。
# Create the supervisor agent (display name positional, description/instructions as flags)
databricks supervisor-agents create-supervisor-agent "My Supervisor" \
--description "Routes queries to specialized agents" \
--instructions "Route data questions to analyst, document questions to docs_agent."
# → returns {name: "supervisor-agents/<uuid>", endpoint_name: "mas-<short>-endpoint", ...}
# List / get / find by name
databricks supervisor-agents list-supervisor-agents
databricks supervisor-agents get-supervisor-agent supervisor-agents/<id>
databricks supervisor-agents list-supervisor-agents | jq '.[] | select(.display_name == "My Supervisor")'
# Update — UPDATE_MASK + new DISPLAY_NAME are positional; description/instructions optional flags
databricks supervisor-agents update-supervisor-agent supervisor-agents/<id> \
"display_name,description,instructions" "My Supervisor (v2)" \
--description "..." --instructions "..."
# Delete (destructive & irreversible — confirm the id first)
databricks supervisor-agents delete-supervisor-agent supervisor-agents/<id>
Tools(Supervisor が呼び出すエージェント)
各ツールは、Supervisor を下流のリソースに接続します。tool_type は --json 内に指定します(--json を使う場合、CLI は位置引数としての指定を受け付けません)。各タイプにはタイプ固有のブロック(genie_space、knowledge_assistant など)があり、識別子フィールドはタイプによって異なります。以下の表を参照してください。
# Attach a Genie space — find its space_id with `databricks genie list-spaces`
databricks supervisor-agents create-tool supervisor-agents/<id> analyst --json '{
"tool_type": "genie_space",
"description": "SQL analytics on the analytics warehouse",
"genie_space": {"id": "<genie_space_id>"}
}'
# Attach a Knowledge Assistant — find ka_id with `databricks knowledge-assistants list-knowledge-assistants`
databricks supervisor-agents create-tool supervisor-agents/<id> docs_agent --json '{
"tool_type": "knowledge_assistant",
"description": "Answers from product documentation",
"knowledge_assistant": {"knowledge_assistant_id": "<ka_id>"}
}'
# List / get / delete tools
databricks supervisor-agents list-tools supervisor-agents/<id>
databricks supervisor-agents get-tool supervisor-agents/<id>/tools/<tool_id>
databricks supervisor-agents delete-tool supervisor-agents/<id>/tools/<tool_id>
ツールのタイプ(tool_type の値 → タイプ固有のブロック):
tool_type | ブロック | 用途 |
|---|---|---|
genie_space | {"id": "<space_id>"} | Genie による自然言語から SQL への変換 |
knowledge_assistant | {"knowledge_assistant_id": "<ka_id>"} | KA によるドキュメント Q&A |
uc_function | {"name": "catalog.schema.func"} | UC SQL/Python 関数 |
uc_connection | {"name": "<connection_name>"} | UC HTTP Connection 経由の外部 MCP サーバー |
volume | {"name": "<full_volume_name>"} | UC Volume の参照 |
app | {"name": "<app_name>"} | Databricks App |
その他のタイプ(serving_endpoint、lakeview_dashboard、supervisor_agent、uc_table、vector_search_index、catalog、schema、web_search) | ブロック名とフィールド形式はタイプによって異なります | databricks supervisor-agents create-tool --help を実行して調べてください。これらのタイプは、ここではエンドツーエンドで検証していません。 |
Examples(Supervisor のトレーニング)
Examples には --json を使用する必要があります。位置引数の GUIDELINES は repeated string であるため、エンコーディングを指定できません。
databricks supervisor-agents create-example supervisor-agents/<id> --json '{
"question": "What were Q4 revenue numbers?",
"guidelines": ["Route to analyst Genie space", "Always group by region"]
}'
databricks supervisor-agents list-examples supervisor-agents/<id>
databricks supervisor-agents get-example supervisor-agents/<id>/examples/<ex_id>
databricks supervisor-agents delete-example supervisor-agents/<id>/examples/<ex_id>
エンドポイントの準備状況: create-supervisor-agent の実行後、Serving Endpoint がオンラインになり、クエリに応答できるようになるまで最大約 10 分かかります。get-supervisor-agent はエンドポイント名をすぐに返しますが、クエリの実行はエンドポイント自体の準備が整うまで待つ必要があります。databricks serving-endpoints get <endpoint_name> で確認してください。
リファレンス
| トピック | ファイル |
|---|---|
| KA のソースの種類、インデックス、トラブルシューティング | references/1-knowledge-assistants.md |
| UC 関数、MCP サーバー、Examples | references/2-supervisor-agents.md |