Example of multi agent workflow in databricks
An enterprise multi-agent system designed for Shop Managers to access localized inventory, sales, and visual merchandising data using native Databricks tools. The system utilizes a hub-and-spoke orchestration model where a Supervisor routes queries to specialized agents.
Databricks-Multi-agent-workflow/
├── README.md # Project documentation
├── databricks.yml # Databricks Asset Bundle (DAB) configuration
├── config.yaml # Centralized configuration for agents (Genie IDs, VS indexes, UC functions)
├── Makefile # Automation scripts for deployment and cleanup
├── requirements.txt # Python dependencies
├── .env # Local environment variables (not committed)
├── src/ # Application source code
│ ├── app.py # Streamlit Chatbot UI with thinking trace visualization
│ ├── orchestrator.py # LangGraph workflow and Supervisor routing logic
│ ├── agents/ # Specialist agent implementations
│ │ ├── inventory_analyst.py # Databricks Genie integration
│ │ ├── visual_merchandiser.py # Mosaic AI Vector Search integration
│ │ └── creative_analyst.py # Unity Catalog Functions as tools
│ └── utils/ # Shared utilities
│ └── config_loader.py # Environment-aware configuration helper
├── setup/ # Infrastructure and setup scripts
│ ├── DDL.sql # SQL for creating demo tables and functions
│ └── deploy_instructions.md
└── .gitignore
The system is powered by LangGraph, implementing a Supervisor/Specialist pattern found in src/orchestrator.py.
The supervisor_node acts as the intelligent router. It uses ChatDatabricks to analyze the user's intent and select the most appropriate specialist:
- Inventory: Routed to the Genie Space analyst.
- Merchandiser: Routed to the Vector Search specialist.
- Creative: Routed to the UC Functions analyst.
- General: Handled directly for greetings or simple queries.
The system maintains an AgentState containing the query, message history, routing decision (next_step), and the final_response.
- Core Technology: Databricks Genie.
- Function: Provides a conversational interface over structured SQL data.
- Implementation: Uses
GenieAgentto invoke a specificgenie_space_iddefined inconfig.yaml.
- Core Technology: Mosaic AI Vector Search.
- Function: Retrieves visual display guidelines and brand placement rules.
- Implementation: Performs similarity searches on a Databricks Vector Search index using
DatabricksVectorSearch.
- Core Technology: Unity Catalog Functions & Tool Calling.
- Function: Complex sales analysis and multi-table interrogation.
- Implementation: Uses
UCFunctionToolkitto wrap SQL/Python functions as LangChain tools. It operates as a ReAct agent to autonomously find product details before running analysis.
The project is built to run as a Databricks App managed via DABs.
- Databricks CLI configured for your workspace.
- Unity Catalog access with permissions for Vector Search and UC Functions.
make deploy- MLflow Tracing: Integrated throughout the workflow. Each node in the LangGraph and every tool call is traced automatically.
- Trace Visualization: Traces can be viewed in the Databricks MLflow UI or captured directly within the Streamlit "Thinking" steps.