Genie is great at answering questions over your data — but what about predictive questions like "Is this week's spending anomalous?" Those need a custom ML model, and historically that meant building a separate agent or app on top of Genie.
I wanted to share a lean pattern that keeps everything inside the Genie Space. 👇
A lean architecture: Genie + ai_query()
Wrap your custom model-serving endpoint in a Unity Catalog SQL function that calls ai_query(). Add that function to your Genie Space, and Genie figures out when to invoke it from the function name and parameter comments — no router, no extra orchestration agent.
How?
Train models (you can parallelize with
applyInPandas).Serve the custom MLflow model on a serverless Model Serving endpoint.
Wrap the endpoint in a UC SQL function around
ai_query(), with rich comments on each parameter.Add the function to your Genie Space — now users can ask predictive questions in plain language.
The metadata you put on the function is what makes this work: clear names and parameter descriptions are how Genie decides to reach for the model.
Note : Need to route across multiple tools (several Genie spaces, endpoints, RAG)? That's where Agent Bricks Supervisor comes in — but for a single predictive capability, this approach is much simpler.
Try it
📝 Full write-up: Medium article
💻 Full Repo: github.com/gabri-al/Databricks-Genie-with-ML
Would love to hear if others are exposing custom models through Genie this way — what use cases are you tackling? 🧱