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

> Source: <https://dev.to/dipayan_das/how-i-built-a-databricks-ai-agent-with-no-custom-tables-openai-agents-sdk-gradio-351m>
> Published: 2026-06-26 22:27:02+00:00

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](https://medium.com/@dipayan-x-das/build-a-databricks-ai-agent-in-one-session-no-unity-catalog-or-vector-search-required-7b79f589d316?sharedUserId=dipayan-x-das)
GitHub: [github.com/dipayanthedata/DatabricksAgentDemo](https://github.com/dipayanthedata/DatabricksAgentDemo)
