DEV Community

Cover image for How I Built a Databricks AI Agent with No Custom Tables (OpenAI Agents SDK + Gradio)
Dipayan Das
Dipayan Das

Posted on

How I Built a Databricks AI Agent with No Custom Tables (OpenAI Agents SDK + Gradio)

Most Databricks agent tutorials start with "set up Unity Catalog and Vector Search first."
This one doesn't. I built a fully working conversational agent using only samples.tpch — the dataset that ships in every Databricks workspace by default. No custom tables, no Vector Search index, no catalog setup.
The stack:

  • OpenAI Agents SDK (with AsyncOpenAI — important, sync breaks it)
  • Databricks Model Serving (Llama 3.3 70B via OpenAI-compatible endpoint)
  • Databricks SQL Connector (not Spark — Apps have no Spark context)
  • MLflow for experiment tracking
  • Gradio chat UI deployed via Databricks Apps
  • OAuth credentials injected automatically — no tokens in code

The pattern that made it work:
Write an AGENTS.md instruction file with constraints, folder structure, SQL queries, and a validation checklist. Run one Codex prompt. Get a complete working codebase.
codex "implement everything described in AGENTS.md"
The three errors that will block you if you don't know:

  • AsyncOpenAI not OpenAI — the Agents SDK is async internally, sync client crashes at the model call.
  • nest_asyncio.apply() at module load — Databricks notebooks run a persistent event loop, Runner.run_sync() fails without this patch.
  • SQL Connector not Spark — Databricks Apps have no Spark context, spark.sql() crashes silently in the App runtime. Full walkthrough with all errors, architecture, deployment steps, and production caveats: 👉 Read the full article on Medium GitHub: github.com/dipayanthedata/DatabricksAgentDemo

Top comments (0)