Welcome to the Databricks for AdTech Solutions repository — a comprehensive collection of AdTech solutions, including a sophisticated AI-powered chat application with multi-agent capabilities, data analysis tools, and policy governance frameworks.
For detailed architecture information, see the individual component READMEs:
This repository contains four main components that work together to create a complete AdTech AI solution:
An AI chatbot built with Dash that features:
- Multi-agent architecture with specialized agents for data analysis and policy compliance
- Persistent chat history with PostgreSQL + pgvector for semantic search
- Integration with Databricks Genie and Knowledge Assistant agents
- Real-time streaming responses and conversation management
- Sample datasets for marketing campaigns, audience profiles, and segment definitions
- Pre-built AIBI Genie dashboard for campaign analysis
- Metric views and KPI definitions for business intelligence
- Comprehensive policy pack with 20 AdTech compliance documents
- Knowledge Assistant integration for real-time policy validation
- Coverage of privacy, brand guidelines, legal compliance, and data governance
- Custom multi-agent system with Genie, General Assistant, and Marketing Policy agents
- Knowledge Assistant powered by Databricks Agent Bricks
- Advanced conversation handling with context-aware responses
megacorp_campaigns.parquet- Marketing campaign data linking individuals to campaignsmegacorp_audience_census_profile.parquet- Demographic and behavioral profiles (age, gender, location, pet ownership)megacorp_segment_definitions.parquet- Marketing segment definitions and descriptionsmegacorp_audience_census_profile_metric_view.json- Business KPI metric definitions
MegaCorp Campaigns AIBI Demo.lvdash.json- Pre-built Lakeview dashboard for campaign analysis- Interactive widgets for segment analysis, demographic breakdowns, and match funnels
- Integration with Genie Space for natural language querying
- Genie Agent: Specialized for data analysis and database queries
- General Assistant: Synthesizes information and provides comprehensive answers
- Marketing Policy Agent: Knowledge Assistant for policy compliance validation
- Persistent conversation history with semantic search
- Context-aware responses using pgvector embeddings
- Real-time streaming responses
- Policy compliance checking and brand guideline enforcement
The knowledge_assistant_policies directory contains 20 comprehensive policy documents covering:
- Data governance and privacy protection
- Brand voice and creative guidelines
- Regional compliance and legal requirements
- Campaign approval workflows and accessibility standards
Before deploying this solution, ensure you have:
- Databricks workspace in us-east-1 or us-west-2 (required for Agent Bricks)
- Mosaic AI Agent Bricks Preview enabled
- Unity Catalog configured
- Serverless compute available
- Access to foundation models (for LLM endpoints)
- Databricks CLI configured with workspace authentication
- Terraform (>= 1.0)
- Just command runner
- UV Python package manager
- jq for JSON processing
The deployment follows a specific order due to component dependencies:
Phase 1: Data Foundation → Phase 2: Knowledge Assistant
↓ ↓
Phase 3: Dashboard & Genie → Phase 4: Chat Application
- Import datasets into Databricks
- Upload parquet files from megacorp_data/ to Unity Catalog
- Configure tables: megacorp_campaigns, megacorp_audience_census_profile, megacorp_segment_definitions
- Create Knowledge Assistant using Agent Bricks
- Upload policy documents from knowledge_assistant_policies/ into a Unity Catalog Volume
- Create & Deploy a knowledge assistant AI Brick in Agent Bricks
- Update `adtech_series/app_lakebase/resources/agent.job.yml with your agent endpoint.
- Import MegaCorp Campaigns AIBI Demo.lvdash.json
- Update Dashboard to point your imported tables
- Generate an embedded dashboard and copy the URI to the environment variable
DASHBOARD_IFRAMEin app.yml - Create Genie Space connected to your data, look at GENIE.md for instructions.
- Update
genie_space_idin the agent deployment job.
cd adtech_series/app_lakebase/
# Complete end to end deployment of the agent and application
just full-deploy-agent
# Compelte end to end deployment of the application
just full-deploy
# Or step-by-step:
just terraform-full # Deploy infrastructure
just set-secret # Setup secret for Agent Endpoint
just bundle-deploy # Deploy our asset bundle
just migrations-upgreade # Run SQL migrations
just agent-deploy # Deploy AI agents
just app-start # Start compute
just app-deploy # Deploy to computeAfter deployment, verify each component:
- Data Layer: Query tables in Unity Catalog
- Knowledge Assistant: Test policy questions via Agent Bricks UI
- Dashboard: Open Lakeview dashboard and verify data visualization
- Genie Space: Test natural language queries
- Chat Application: Access deployed app and test multi-agent conversations
Key configuration files to customize:
adtech_series/app_lakebase/databricks.yml- Workspace and bundle configurationadtech_series/app_lakebase/app/app.yml- Application environment variablesadtech_series/app_lakebase/terraform/terraform.tfvars- Infrastructure variables
- Agent Bricks Access: Ensure workspace has preview feature enabled
- Region Requirements: Must be in us-east-1 or us-west-2
- Endpoint Dependencies: Knowledge Assistant must be deployed before chat app
- Data Connections: Verify table permissions and catalog access
- Authentication: Ensure proper service principal configuration
- Databricks Agent Bricks Documentation
- Unity Catalog Setup Guide
- Lakeview Dashboard Documentation
- Genie Spaces Documentation
cd adtech_series/app_lakebase/
just venv # Set up development environment
just run # Run application locallyThe 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.
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.
© 2025 Databricks, Inc. All rights reserved. The source in this notebook is provided subject to the Databricks License [https://databricks.com/db-license-source]. All included or referenced third party libraries are subject to the licenses set forth below.
