Deploying DB Agent on Databricks Using LabAgent

Setup work often comes before you can try an AI app. Here is how I deployed a text-to-SQL app on Databricks Free Edition with a repeatable CLI workflow, and how it can help other developers.
Disclosure: I work with beCloudReady, which maintains LabAgent.
1. Why I did this
Before a developer can try an AI app on Databricks, there is setup work: a SQL warehouse, sample data, a model endpoint, a token and the app deployment itself. That is time spent on wiring before you learn anything about the app.
I wanted to understand how an AI-powered database application can be deployed through a repeatable CLI-based workflow, so that the same steps work again for the next person or the next project.
For this I used LabAgent, an open-source CLI for building hands-on cloud and AI labs, to deploy DB Agent, an open-source text-to-SQL application, on Databricks Free Edition. DB Agent lets users question a database in plain English instead of writing SQL.
How this can help you as a developer:
- Get a working text-to-SQL app to explore without building the deployment yourself
- Preview the steps with a dry run before anything is created
- Repeat the same setup with one launch command, once your Databricks CLI is logged in
- Practise on Databricks Free Edition with sample data that is already there
2. Prerequisites
- Python 3.9 or later
- Git
- Pip
- Curl and unzip
- Databricks Free Edition account
- Linux environment (WSL is used in this walkthrough)
Repositories:
- LabAgent: github.com/becloudready/labagent
- DB Agent: github.com/db-agent/db-agent
3. Setting up LabAgent
Step 1: Clone the repository
First thing to do is clone the LabAgent repository into your local development environment.
git clone https://github.com/becloudready/labagent.git
cd labagentStep 2: Create a virtual environment
Create and activate a Python virtual environment to isolate the project's dependencies.
python3 -m venv .venv
source .venv/bin/activateStep 3: Install LabAgent
pip install labagent
Make sure to verify the installation by checking the available lab packs.
labagent packs
Among the available packs, locate db-agent, which is responsible for the DB Agent application that we will be deploying on Databricks.
4. Setting up Databricks
Step 1: Create a Databricks account
Create an account using Databricks Free Edition. Once registered, access your Databricks workspace. This is the target environment for our application.

Step 2: Install the Databricks CLI
The Databricks CLI allows LabAgent to communicate with the Databricks workspace and perform the deployment. Install the CLI using:
curl -fsSL https://raw.githubusercontent.com/databricks/setup-cli/main/install.sh | sudo shDuring installation, I encountered two issues relating to directory permissions and a missing unzip directory. Once installed, make sure to verify that the Databricks CLI has been installed successfully.

Step 3: Authenticate with Databricks
Authenticate the CLI with your Databricks workspace:
databricks auth loginComplete the authentication process through your default browser. Once authenticated, verify the connection:
databricks auth profilesThe authentication profile should then be displayed.

5. Understanding the DB Agent configuration
Before deploying the application, it can be useful to understand which database is being used. The DB Agent deployment pack is located at:
labagent/packs/db_agent/pack.pyBy default, DB Agent uses the following configuration:
| Parameter | Configuration |
|---|---|
| Catalog | samples |
| Dataset | bakehouse |

The samples.bakehouse dataset is an existing sample dataset provided by Databricks. LabAgent simply discovers and connects to this dataset rather than provisioning a new database. To inspect the dataset, navigate to the Catalog section of the Databricks workspace and locate it.

6. Deploying the DB Agent
Step 1: Preview the deployment
LabAgent provides a dry-run option that allows the user to review the deployment workflow before provisioning cloud resources.
labagent launch db-agent --name demo --dry-run
Step 2: Launch the application
Once LabAgent and Databricks are configured, initiate the deployment using:
labagent launch db-agent --name demoDuring the deployment, the first three stages complete successfully before it proceeds to provision the Databricks application. The final stage then verifies the app by asking it a test question.

7. Verifying the deployment on Databricks
Step 1: Check the application status
Open Databricks Apps.

You will then see the deployed application there.

Step 2: Access the application
After opening, go to the link that it has been deployed to. The DB Agent interface allows the user to submit natural-language questions against the configured database.




8. Understanding the deployment workflow
There are three independent components at work here together:
- LabAgent: automates the deployment and configuration process.
- DB Agent: provides the natural-language database interface.
- Databricks: provides application hosting, data access, SQL compute and AI model serving.
LabAgent runs from the local development environment, while DB Agent is deployed and executed in the Databricks cloud workspace. This approach removes the need for manual configuration while also providing a reusable deployment workflow.
9. Conclusion
This exercise demonstrates how LabAgent can be used to automate the deployment of an AI-powered database application on Databricks.
Through this walkthrough, I explored the local development setup, Databricks CLI authentication, deployment pack configuration, database integration and the application's deployment lifecycle.
The key takeaway is how LabAgent abstracts multiple cloud configuration and provisioning operations into a single repeatable workflow, simplifying the deployment of hands-on AI and data engineering environments.