This archive is a self-contained quickstart for text2sql ReAct agents on Databricks. It provides Text2SQL question-answering functionality on financial datasets found in the data_setup directory
agent_config.yaml: Contains key parameters for the ReAct Agent, including:- Model inference params: model endpoint name, temperature, max_tokens, etc.
- SQL warehouse params: warehouse id
- Databricks resource params: hostname, catalog, schema
01_sql_react_agentcontains code for the text2sql ReAct agent, implemented using LangChain02_evaluate: Tests/runs the code in01_sql_react_agent. It contains code that:- Logs the chain to MLflow
- Implements mlflow.evaluate() to evaluate agent against a benchmark dataset
- Registers the chain to Unity Catalog
- Deploys the chain to a serving endpoint and starts a review UI
data_setup: Contains data (csv) files for tables and notebook to create Delta tables for testing
- Update
agent_config.yamlwith the Databricks Resources (warehouse, hostname, catalog, schema), model resources (model endpoints, temperature, max tokens, etc.), and base prompt - Run
data_setupto create data tables for testing - Review and customize
01_sql_react_agentas needed - Test the agent code using
02_evaluate. Once the code is stabilized, register the model, run evaluation, register and deploy.
- Permissions to create schemas and tables in Databricks
- Permissions to deploy model serving endpoints
- Enablement of AI-assisted features on your Databricks workspace