Dotfiles databricks-agent-bricks
Create and manage Databricks Agent Bricks: Knowledge Assistants (KA) for document Q&A, Genie Spaces for SQL exploration, and Supervisor Agents (MAS) for multi-agent orchestration. Use when building conversational AI applications on Databricks.
git clone https://github.com/msbaek/dotfiles
T=$(mktemp -d) && git clone --depth=1 https://github.com/msbaek/dotfiles "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/databricks-agent-bricks" ~/.claude/skills/msbaek-dotfiles-databricks-agent-bricks && rm -rf "$T"
.claude/skills/databricks-agent-bricks/SKILL.mdAgent Bricks
Create and manage Databricks Agent Bricks - pre-built AI components for building conversational applications.
Overview
Agent Bricks are three types of pre-built AI tiles in Databricks:
| Brick | Purpose | Data Source |
|---|---|---|
| Knowledge Assistant (KA) | Document-based Q&A using RAG | PDF/text files in Volumes |
| Genie Space | Natural language to SQL | Unity Catalog tables |
| Supervisor Agent (MAS) | Multi-agent orchestration | Model serving endpoints |
Prerequisites
Before creating Agent Bricks, ensure you have the required data:
For Knowledge Assistants
- Documents in a Volume: PDF, text, or other files stored in a Unity Catalog volume
- Generate synthetic documents using the
skill if neededdatabricks-unstructured-pdf-generation
For Genie Spaces
- See the
skill for comprehensive Genie Space guidancedatabricks-genie - Tables in Unity Catalog with the data to explore
- Generate raw data using the
skilldatabricks-synthetic-data-gen - Create tables using the
skilldatabricks-spark-declarative-pipelines
For Supervisor Agents
- Model Serving Endpoints: Deployed agent endpoints (KA endpoints, custom agents, fine-tuned models)
- Genie Spaces: Existing Genie spaces can be used directly as agents for SQL-based queries
- Mix and match endpoint-based and Genie-based agents in the same Supervisor Agent
For Unity Catalog Functions
- Existing UC Function: Function already registered in Unity Catalog
- Agent service principal has
privilege on the functionEXECUTE
For External MCP Servers
- Existing UC HTTP Connection: Connection configured with
is_mcp_connection: 'true' - Agent service principal has
privilege on the connectionUSE CONNECTION
MCP Tools
Knowledge Assistant Tool
manage_ka - Manage Knowledge Assistants (KA)
: "create_or_update", "get", "find_by_name", or "delete"action
: Name for the KA (for create_or_update, find_by_name)name
: Path to documents (e.g.,volume_path
) (for create_or_update)/Volumes/catalog/schema/volume/folder
: (optional) What the KA does (for create_or_update)description
: (optional) How the KA should answer (for create_or_update)instructions
: The KA tile ID (for get, delete, or update via create_or_update)tile_id
: (optional, default: true) Auto-add examples from JSON files (for create_or_update)add_examples_from_volume
Actions:
- create_or_update: Requires
,name
. Optionally passvolume_path
to update.tile_id - get: Requires
. Returns tile_id, name, description, endpoint_status, knowledge_sources, examples_count.tile_id - find_by_name: Requires
(exact match). Returns found, tile_id, name, endpoint_name, endpoint_status. Use this to look up an existing KA when you know the name but not the tile_id.name - delete: Requires
.tile_id
Genie Space Tools
For comprehensive Genie guidance, use the
skill.databricks-genie
Use
manage_genie with actions:
- Create or update a Genie Spacecreate_or_update
- Get Genie Space detailsget
- List all Genie Spaceslist
- Delete a Genie Spacedelete
/export
- For migrationimport
See
databricks-genie skill for:
- Table inspection workflow
- Sample question best practices
- Curation (instructions, certified queries)
IMPORTANT: There is NO system table for Genie spaces (e.g.,
system.ai.genie_spaces does not exist). Use manage_genie(action="list") to find spaces.
Supervisor Agent Tool
manage_mas - Manage Supervisor Agents (MAS)
: "create_or_update", "get", "find_by_name", or "delete"action
: Name for the Supervisor Agent (for create_or_update, find_by_name)name
: List of agent configurations (for create_or_update), each with:agents
: Agent identifier (required)name
: What this agent handles - critical for routing (required)description
: Knowledge Assistant tile ID (use for document Q&A agents - recommended for KAs)ka_tile_id
: Genie space ID (use for SQL-based data agents)genie_space_id
: Model serving endpoint name (for custom agents)endpoint_name
: Unity Catalog function name in formatuc_function_namecatalog.schema.function_name
: Unity Catalog connection name (for external MCP servers)connection_name- Note: Provide exactly one of:
,ka_tile_id
,genie_space_id
,endpoint_name
, oruc_function_nameconnection_name
: (optional) What the Supervisor Agent does (for create_or_update)description
: (optional) Routing instructions for the supervisor (for create_or_update)instructions
: The Supervisor Agent tile ID (for get, delete, or update via create_or_update)tile_id
: (optional) List of example questions withexamples
andquestion
fields (for create_or_update)guideline
Actions:
- create_or_update: Requires
,name
. Optionally passagents
to update.tile_id - get: Requires
. Returns tile_id, name, description, endpoint_status, agents, examples_count.tile_id - find_by_name: Requires
(exact match). Returns found, tile_id, name, endpoint_status, agents_count. Use this to look up an existing Supervisor Agent when you know the name but not the tile_id.name - delete: Requires
.tile_id
Typical Workflow
1. Generate Source Data
Before creating Agent Bricks, generate the required source data:
For KA (document Q&A):
1. Use `databricks-unstructured-pdf-generation` skill to generate PDFs 2. PDFs are saved to a Volume with companion JSON files (question/guideline pairs)
For Genie (SQL exploration):
1. Use `databricks-synthetic-data-gen` skill to create raw parquet data 2. Use `databricks-spark-declarative-pipelines` skill to create bronze/silver/gold tables
2. Create the Agent Brick
Use
manage_ka(action="create_or_update", ...) or manage_mas(action="create_or_update", ...) with your data sources.
3. Wait for Provisioning
Newly created KA and MAS tiles need time to provision. The endpoint status will progress:
- Being created (can take 2-5 minutes)PROVISIONING
- Ready to useONLINE
- Not runningOFFLINE
4. Add Examples (Automatic)
For KA, if
add_examples_from_volume=true, examples are automatically extracted from JSON files in the volume and added once the endpoint is ONLINE.
Best Practices
- Use meaningful names: Names are sanitized automatically (spaces become underscores)
- Provide descriptions: Helps users understand what the brick does
- Add instructions: Guide the AI's behavior and tone
- Include sample questions: Shows users how to interact with the brick
- Use the workflow: Generate data first, then create the brick
Example: Multi-Modal Supervisor Agent
manage_mas( action="create_or_update", name="Enterprise Support Supervisor", agents=[ { "name": "knowledge_base", "ka_tile_id": "f32c5f73-466b-...", "description": "Answers questions about company policies, procedures, and documentation from indexed files" }, { "name": "analytics_engine", "genie_space_id": "01abc123...", "description": "Runs SQL analytics on usage metrics, performance stats, and operational data" }, { "name": "ml_classifier", "endpoint_name": "custom-classification-endpoint", "description": "Classifies support tickets and predicts resolution time using custom ML model" }, { "name": "data_enrichment", "uc_function_name": "support.utils.enrich_ticket_data", "description": "Enriches support ticket data with customer history and context" }, { "name": "ticket_operations", "connection_name": "ticket_system_mcp", "description": "Creates, updates, assigns, and closes support tickets in external ticketing system" } ], description="Comprehensive enterprise support agent with knowledge retrieval, analytics, ML, data enrichment, and ticketing operations", instructions=""" Route queries as follows: 1. Policy/procedure questions → knowledge_base 2. Data analysis requests → analytics_engine 3. Ticket classification → ml_classifier 4. Customer context lookups → data_enrichment 5. Ticket creation/updates → ticket_operations If a query spans multiple domains, chain agents: - First gather information (analytics_engine or knowledge_base) - Then take action (ticket_operations) """ )
Related Skills
- databricks-genie - Comprehensive Genie Space creation, curation, and Conversation API guidance
- databricks-unstructured-pdf-generation - Generate synthetic PDFs to feed into Knowledge Assistants
- databricks-synthetic-data-gen - Create raw data for Genie Space tables
- databricks-spark-declarative-pipelines - Build bronze/silver/gold tables consumed by Genie Spaces
- databricks-model-serving - Deploy custom agent endpoints used as MAS agents
- databricks-vector-search - Build vector indexes for RAG applications paired with KAs
See Also
- Detailed KA patterns and examples1-knowledge-assistants.md
skill - Detailed Genie patterns, curation, and examplesdatabricks-genie
- Detailed MAS patterns and examples2-supervisor-agents.md