dbx-unifiedchat

Configuration Guide

This repository uses three different configuration systems depending on your workflow.

Three Configuration Systems

1. Local Development: config.py + .env

Used by: Local development and testing Purpose: Quick iteration with local Python environment

Setup:

# 1. Copy template
cp .env.example .env

# 2. Edit .env with your credentials
# DATABRICKS_HOST=https://your-workspace.cloud.databricks.com
# DATABRICKS_TOKEN=your-token
# CATALOG_NAME=your_catalog
# SCHEMA_NAME=your_schema
# ...

# 3. Run locally
python -m src.multi_agent.main --query "test"

How it works:

Pros:

Cons:


2. Databricks Testing: dev_config.yaml

Used by: Testing in Databricks notebooks Purpose: Test with real Databricks services before deploying

Setup:

# dev_config.yaml (at repo root)
catalog_name: your_catalog
schema_name: your_schema
llm_endpoint: databricks-claude-sonnet-4-5
genie_space_ids:
  - space_id_1
  - space_id_2
sql_warehouse_id: your_warehouse_id
# ...

How it works:

Pros:

Cons:


3. Production Deployment: prod_config.yaml

Used by: Model Serving deployment Purpose: Production configuration packaged with model

Setup:

# prod_config.yaml (at repo root)
catalog_name: prod_catalog
schema_name: prod_schema
llm_endpoint: databricks-claude-sonnet-4-5
genie_space_ids:
  - prod_space_id_1
  - prod_space_id_2
sql_warehouse_id: prod_warehouse_id
# ...

How it works:

Pros:

Cons:


Configuration Comparison

Feature Local (.env) Databricks Test (YAML) Production (YAML)
Code Location Local machine Databricks workspace Model Serving
Config File .env dev_config.yaml prod_config.yaml
Config Loader config.py dev_config.yaml prod_config.yaml
Agent Code src/multi_agent/ src/multi_agent/ src/multi_agent/
Real Services ❌ (can mock) ✅ Yes ✅ Yes
Use Case Development Testing Production

Key Insight: All three use the same agent code from src/multi_agent/!

Configuration Values

Required Values

All configuration systems need these values:

Databricks Connection:

Unity Catalog:

LLM Endpoints (agent-specific for optimal performance):

Genie & SQL:

Vector Search:

Lakebase (for state management):

Optional Values

Switching Between Configurations

Scenario 1: Local Development → Databricks Testing

# 1. Develop locally with .env
python -m src.multi_agent.main --query "test"

# 2. Sync code to Databricks
databricks workspace import-dir src/multi_agent /Workspace/src/multi_agent

# 3. Open notebooks/test_agent_databricks.py in Databricks
# (Uses dev_config.yaml automatically)

Scenario 2: Databricks Testing → Production

# 1. Test with dev_config.yaml
# Run notebooks/test_agent_databricks.py

# 2. Update prod_config.yaml if needed
# Compare with dev_config.yaml, adjust for production

# 3. Deploy with prod_config.yaml
# Run notebooks/deploy_agent.py
# (References prod_config.yaml at line ~5637)

Environment-Specific Configuration

Development Environment

Use smaller/cheaper resources:

Production Environment

Use production resources:

Security Best Practices

  1. Never commit .env files
    • Already in .gitignore
    • Contains sensitive credentials
  2. Use secrets for YAML configs
    • For production: Use Databricks secrets
    • Reference in YAML: ``
  3. Rotate tokens regularly
    • Update .env and YAML configs
    • Redeploy if production config changes
  4. Separate dev and prod
    • Use different catalogs/schemas
    • Different Genie spaces
    • Prevents accidental production impact

Troubleshooting

Issue: Configuration not loading

Symptom: FileNotFoundError or KeyError

Solutions:

Issue: Wrong configuration being used

Symptom: Using dev config in production

Solutions:

Issue: Can’t connect to Databricks

Symptom: Authentication errors

Solutions:

See Also


Questions? See full guide at docs/ or ask in discussions!