dbx-unifiedchat

DBX-UnifiedChat Logo

DBX-UnifiedChat - Databricks Unified Chat

A multi-agent system for intelligent cross-domain data queries built with LangGraph, Databricks Genie, Lakebase, and Claude models/skills on Databricks Platform.

Python 3.10+ License LangGraph LangChain MLflow Databricks SDK Pydantic Claude Models Claude Skills


Overview

Organizations struggle to query data across multiple domains and data sources, requiring deep SQL expertise and knowledge of complex data schemas. Databricks Unified Chat solves this by providing an intelligent multi-agent system that routes natural language queries to the appropriate data sources, synthesizes results, and delivers comprehensive answers.

Built on LangGraph, Databricks Genie and Lakebase, this solution enables business users to ask questions spanning multiple data domains without needing to understand the underlying data architecture or write complex SQL queries.

Why use DBX-UnifiedChat?

Architecture

Agent Architecture

The system uses a multi-agent architecture powered by LangGraph:

The system leverages:

Key Technologies Applied:

See Architecture Documentation for detailed design.


Presentation

View Presentation Slides
πŸš€ Click here to view the Interactive Presentation Slides


Quick Start

Prerequisites

Installation

Please see the Development Guide for detailed instructions on the three supported workflows:

  1. Local Development: Fastest iteration for unit tests and logic changes.
  2. Databricks Notebook Dev: Integration testing with real services.
  3. Production Deployment (CI/CD): Final deployment to Model Serving endpoints.
# Quick clone
git clone https://github.com/databricks-solutions/dbx-unifiedchat.git
cd dbx-unifiedchat

# See docs/DEVELOPMENT_GUIDE.md for next steps

Configuration

Set up your environment variables in .env:

DATABRICKS_HOST=https://your-workspace.cloud.databricks.com
DATABRICKS_TOKEN=your-token

# Genie Configuration
GENIE_SPACE_IDS=space_id_1,space_id_2

# Vector Search Configuration
VECTOR_SEARCH_ENDPOINT=your-endpoint
VECTOR_SEARCH_INDEX=catalog.schema.index_name

# SQL Configuration
SQL_WAREHOUSE_ID=your-warehouse-id

Run Locally

# Test the agent with a sample query
python -m src.multi_agent.main --query "Show me patient demographics by region"

Deploy to Databricks

  1. Prepare your data (First time only):
    cd etl/
    python local_dev_etl.py --all --sample-size 10
    
  2. Test in Databricks notebook:
    • Open notebooks/test_agent_databricks.py in your Databricks workspace
    • Run cells to test with real services
  3. Deploy to Model Serving:
    • Open notebooks/deploy_agent.py in your Databricks workspace
    • Follow deployment instructions to create a serving endpoint

See Deployment Guide for complete instructions.


Repository Structure

.
β”œβ”€β”€ etl/                      # ETL pipeline for metadata enrichment
β”‚   β”œβ”€β”€ local_dev_etl.py     # Local ETL testing script
β”‚   └── *.py                 # ETL notebooks for Databricks
β”œβ”€β”€ src/multi_agent/          # Core agent system
β”‚   β”œβ”€β”€ agents/              # Agent implementations
β”‚   β”œβ”€β”€ core/                # Graph, state, and configuration
β”‚   β”œβ”€β”€ tools/               # Agent tools and utilities
β”‚   └── main.py              # Entry point for local execution
β”œβ”€β”€ notebooks/                # Databricks notebooks
β”‚   β”œβ”€β”€ test_agent_databricks.py   # Testing notebook
β”‚   └── deploy_agent.py      # Deployment notebook
β”œβ”€β”€ tests/                    # Test suite
β”‚   β”œβ”€β”€ unit/                # Unit tests
β”‚   β”œβ”€β”€ integration/         # Integration tests
β”‚   └── e2e/                 # End-to-end tests
β”œβ”€β”€ docs/                     # Documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md      # System architecture
β”‚   β”œβ”€β”€ DEPLOYMENT.md        # Deployment guide
β”‚   β”œβ”€β”€ LOCAL_DEVELOPMENT.md # Local development guide
β”‚   └── CONFIGURATION.md     # Configuration reference
β”œβ”€β”€ config/                   # Configuration files
β”œβ”€β”€ dev_config.yaml          # Development configuration
β”œβ”€β”€ prod_config.yaml         # Production configuration
└── pyproject.toml           # Python package configuration

Documentation

Getting Started

Reference


Testing

# Run all tests
pytest

# Run specific test suites
pytest tests/unit/              # Fast unit tests
pytest tests/integration/        # Integration tests with Databricks
pytest tests/e2e/               # End-to-end system tests

# Run with coverage
pytest --cov=src.multi_agent tests/

See Testing Guide for detailed testing documentation.


Configuration

This repository supports three configuration modes:

Configuration Environment Purpose
.env + config.py Local development Fast iteration with local Python
dev_config.yaml Databricks notebooks Testing with real Databricks services
prod_config.yaml Model Serving Production deployment configuration

All three configurations use the same agent code from src/multi_agent/.

See Configuration Guide for details.


Examples

Query Examples

from src.multi_agent.main import run_agent

# Simple query
result = run_agent("What are the top 10 customers by revenue?")

# Cross-domain query
result = run_agent("Show me patient outcomes correlated with treatment protocols")

# Complex analytical query
result = run_agent("Compare sales performance across regions for the last quarter")

Deployment Example

# Deploy to Databricks Model Serving
from databricks import agents

# Register agent as MLflow model
agents.deploy(
    model_name="dbx-unifiedchat-agent",
    model_version=1,
    endpoint_name="unified-chat-endpoint"
)

What’s Included

Component Description
Multi-Agent System LangGraph-based agent orchestration with specialized agents
Genie Integration Native integration with Databricks Genie spaces
Vector Search Semantic routing and metadata retrieval
ETL Pipeline Metadata enrichment and index building
Deployment Tools Notebooks and scripts for Databricks deployment
Test Suite Comprehensive unit, integration, and E2E tests

Contributing

We welcome contributions! Please see CONTRIBUTING.md for:

For security vulnerabilities, please see our Security Policy.


Support Disclaimer

The content provided here is for reference and educational purposes only. It is not officially supported by Databricks under any Service Level Agreements (SLAs). All materials are provided AS IS, without any guarantees or warranties, and are not intended for production use without proper review and testing.

The source code in this project is provided under the Databricks License. All third-party libraries included or referenced are subject to their respective licenses. See NOTICE.md for third-party license information.

If you encounter issues while using this content, please open a GitHub Issue in this repository. Issues will be reviewed as time permits, but there are no formal SLAs for support.


License

(c) 2026 Databricks, Inc. All rights reserved.

The source in this project is provided subject to the Databricks License. See LICENSE.md for details.

Third-Party Licenses: This project depends on various third-party packages. See NOTICE.md for complete attribution and license information.


Acknowledgments

Built with:


About Databricks Field Solutions

This repository is part of the Databricks Field Solutions collection - a curated set of real-world implementations, demonstrations, and technical content created by Databricks field engineers to share practical expertise and best practices.