Picture a support bot that, about once in fifty calls, takes forever and comes back with a strange answer. You open the logs and find the question that went in and the answer that came out. Everything in between is gone. Which tools did it call? In what order? Why did it stop when it did? Nobody knows, because nobody recorded it.
That scene is the heart of the Databricks Agent Framework objective on the Generative AI Engineer Associate exam. The exam wants you to know three things: what makes a system an agent instead of a chain, how you author and log one with MLflow, and how tracing turns a run you could never watch into a record you can replay. In my book this is the chapter where an application stops answering and starts acting, and here I’ll walk through it the way I’d explain it to a friend with 30-60 minutes a day to study.
If you are still mapping the whole exam, start with my Databricks Generative AI Engineer Associate study guide. This post assumes you know what a RAG chain is; if not, read RAG on Databricks first, because the agent below reuses almost all of it.
Where the Databricks Agent Framework sits in the exam
The objective reads “Utilize MLflow and Agent Framework for developing agentic systems,” and it lives in Application Development. Two close cousins sit in other sections: defining and ordering the tools an agent uses (Design Applications) and giving it a persistent memory (Assembling and Deploying Applications). According to the official certification page, those three sections weigh 30%, 14% and 22% of the scored questions. The exam has 45 scored questions in 90 minutes and costs US$200.
Chain or agent: the one question that sorts every scenario
Most people picture an agent as the smarter chatbot, the capable version you reach for when a task is hard. The exam grades on a different axis.
A chain’s path is fixed when you write it. An agent’s path is chosen while it runs.
That is the whole distinction. A chain is a train on rails: retrieve, build the prompt, generate, every time, in the same order. An agent is a driver with a map: at every step it looks at where things stand and picks the next move. It might answer right away, or look up an order first, or look up the order, check a return window, file a request and then reply.
The Reasoning Loop
In my book I give that behavior a name: the Reasoning Loop. The agent reasons about what to do, acts through a tool, observes what came back, and reasons again, until a stopping condition you designed says it is done. The tools are its verbs, the memory is what survives between turns, and the exit is a decision, not an accident.
Notice what is not in that definition. Calling a tool does not make something an agent. A chain can call an order lookup as one of its fixed steps. Deciding whether to call it, and what to do next based on the result, is what makes it an agent.
The exit is the part everyone forgets
Reason, act and observe are the lively beats, the ones that make a system feel like it is thinking. The exit is the dull one, and it is the one that decides whether your loop is a design or a hazard. Something has to end it: a step limit, a signal the model emits when the task is complete, a tool result that closes the matter, or a handoff to a person. None of that arrives on its own. A loop with no designed way out keeps reasoning, keeps calling tools and keeps billing until a timeout or a budget alarm pulls the plug.
When the boring chain wins
An agent’s flexibility has a price, paid twice. Every run-time choice is another model call, which is latency and money. Every choice is also another place the system can surprise you, which makes it harder to test and harder to trust. A chain has none of that freedom and none of that cost.
So the honest design question is never “chain or agent,” as if agent were the upgrade. It is “does this task actually have to choose its next step?” When the steps are known in advance and never vary, the deterministic chain is the right answer, not the lazy one. This is a classic exam ambush: a scenario describes a fixed sequence that runs the same way for every input, and one option dangles the word “agent” in front of you. Read for whether the path must be chosen at run time. If it doesn’t, pick the chain.
If the question is instead whether you should code the agent at all or rent a managed one, that is a different decision, and I cover it in Databricks Agent Bricks: when to rent and when to build.
Authoring an agent with ResponsesAgent
Once you know you need an agent, the exam wants you to know how to write one the Databricks way. When you wrapped a chain for deployment, you put it in a pyfunc envelope. An agent goes in an envelope too, but a more specific one, because an agent has a shape a plain model doesn’t: it exchanges messages, emits intermediate tool-call steps and streams its output.
The current Databricks documentation recommends authoring agents with the MLflow ResponsesAgent interface. There are two older interfaces you will still see in study material: ChatAgent and, older still, ChatModel. Both are older options, not the one to reach for in new work. Here is the skeleton:
# agent.py: author the agent with the recommended interface, then mark it as the model
import mlflow
from mlflow.pyfunc import ResponsesAgent
from mlflow.types.responses import ResponsesAgentRequest, ResponsesAgentResponse
class ReturnsAgent(ResponsesAgent):
def predict(self, request: ResponsesAgentRequest) -> ResponsesAgentResponse:
# reason, act through a tool, observe, repeat
# until the exit rule you designed says the task is done
...
mlflow.models.set_model(ReturnsAgent())
The loop inside predict calls a model endpoint to reason, calls your tools to act, reads what they return and repeats until the exit fires. You can build that loop with any framework you like (LangGraph, the OpenAI Agents SDK, plain Python) and wrap it in ResponsesAgent. The docs list what the interface gives you: streaming output, the full tool-calling message history, multi-agent support, typed Python classes for authoring, and automatic tracing that aggregates streamed responses.
The signature you don’t hand-build
This is the detail I’d underline twice. For a plain chain, you learned to pass a representative input_example to log_model so MLflow could infer the model signature. With ResponsesAgent you skip that step. The Databricks docs on logging agents say it plainly: if you use ResponsesAgent, MLflow automatically infers a valid signature.
The trap is that hand-building a schema looks diligent. It was the right habit for a chain, so an answer that carefully constructs an input example and signature for an agent feels responsible. For a ResponsesAgent it is redundant work that can only introduce a mismatch between the schema you wrote and the one the agent actually exchanges. When a newer interface was built to do a manual step for you, carrying the manual step forward is not caution. It is a regression.
Logging and registering the agent with MLflow
With the agent written as a .py file, logging it is the same move you made for a RAG chain: models from code, pointed at the script rather than a pickled object. Databricks recommends this approach because the stored artifact is readable code that MLflow re-runs at load time, not a fragile pickle that breaks when a library changes.
The part that grows is the resources list. A served agent runs with no person’s credentials in the loop, so it can only reach what you declared at logging time: the model endpoint it reasons with, the index behind its knowledge tool, and every Unity Catalog function behind its action tools.
import mlflow
from mlflow.models.resources import (
DatabricksServingEndpoint, DatabricksVectorSearchIndex, DatabricksFunction,
)
mlflow.set_registry_uri("databricks-uc")
with mlflow.start_run():
info = mlflow.pyfunc.log_model(
python_model="agent.py", # models from code: the script, not a pickle
name="returns_agent",
resources=[ # everything the agent calls at run time
DatabricksServingEndpoint(endpoint_name="databricks-claude-sonnet-4-5"),
DatabricksVectorSearchIndex(index_name="main.support.docs_index"),
DatabricksFunction(function_name="main.support.file_return_request"),
],
# no input_example: a ResponsesAgent infers its own signature
)
mlflow.register_model(info.model_uri, name="main.support.returns_agent")
Two things to carry from that code. First, leave a resource off and the agent authenticates to nothing; it fails on its first real call to that tool in production. Listing a tool inside the prompt does not help, because the prompt tells the model the tool exists but does nothing for authentication. Second, register_model to Unity Catalog is the moment the agent gets a governed address, a version history in MLflow and, once served, an endpoint. If aliases and champion versions are fuzzy, my post on MLflow and Unity Catalog for GenAI covers that layer.
A note on how fast this surface moves
Be honest with yourself here, because the product moves faster than any exam guide. As of November 2026, the Databricks docs still recommend ResponsesAgent for authoring, but for new agents they now point to the Agent Bricks CLI, which deploys to Agent Runtime on Databricks Apps, so the Model Serving logging path above is no longer the first recommendation for new agents. The docs also renamed Vector Search to AI Search, even though the resource class in code is still DatabricksVectorSearchIndex. The exam tests the shape of the workflow: author with the current interface, log with resources declared, register to Unity Catalog, trace the loop. That shape has stayed stable while the names around it changed. Serving itself is a separate topic, which I cover in Model Serving vs ai_query.
MLflow tracing: the flight log for the Reasoning Loop
Now back to the bug from the top of this post. An agent’s path only exists while it runs, so unless you capture it as it happens, you are left with a black box. MLflow Tracing is that capture.
Turn it on and every run is recorded as a trace, made of spans. Each span is one step of the loop: this LLM call to reason, that tool call to act, the result it observed. The Databricks tracing overview says a trace records the inputs, outputs, latency, token usage and cost of every intermediate step. For many frameworks, turning it on is a single autolog line, and for anything autolog can’t see you add a span with the @mlflow.trace decorator:
import mlflow
mlflow.langchain.autolog() # every LLM call, tool call and step becomes a span
@mlflow.trace # add your own span where autolog can't see
def check_return_window(order_id: str) -> bool:
...
You read traces in the experiment’s Traces tab and open one to see the span tree: agent, then LLM call, then tool call. The mystery bug stops being a mystery. Open one of the slow runs and you might see the agent call the same lookup tool eleven times because its exit condition never fired, the whole runaway loop laid out as sibling spans under one parent. The trace doesn’t fix the bug. It makes the bug visible, which is exactly what you didn’t have.
My practical habit: turn tracing on before your first serious test run, not after the first confusing one. The run you most want to read is usually the one that already happened.
Trace is not evaluate
A trace records what the agent did. It does not judge whether what it did was any good. A trace of a confidently wrong answer looks exactly as clean as a trace of a right one: every span green, every tool returned, and the answer still wrong.
So when a scenario asks how to know whether an agent is answering well in production, and one option says “enable tracing so the team can see the agent’s quality,” that is the ambush. Tracing is the record. Quality is a verdict, rendered by judges and scorers that read the trace. That is evaluation and monitoring, which I break down in Databricks agent evaluation vs monitoring.
The traps to carry into the exam
If you only keep a short list, keep this one:
- Tool call is not agent. Multi-step and tool-using is not the same as agentic. Ask whether the path must be chosen at run time.
- Fixed steps mean chain. When every input takes the same steps in the same order, the deterministic chain is cheaper, faster and testable.
- No exit, no design. A loop without a designed stopping rule is a bill with no ceiling.
- ResponsesAgent over the older interfaces.
ChatAgentandChatModelare the older options, not the current recommendation. - Don’t hand-build the signature. A
ResponsesAgentinfers it; aninput_exampleis redundant there. - Declare every resource. Endpoint, index and functions go in
resources, or the served agent can’t authenticate to them. - Trace records, evaluation judges. Visibility is not quality.
In my free course I drill exactly these kinds of distinctions, one short session at a time, so they stay sharp by exam day instead of blurring together.
How I’d study this in 30-60 minutes a day
Day one, the concept. Take three product descriptions you know (a FAQ bot, a ticket router, a returns assistant) and, for each, decide whether the path is fixed or chosen. Then write the exit rule for the ones that are agents.
Day two, the code. Write the ResponsesAgent skeleton from memory, then the logging call with three resources. Say out loud why there is no input_example.
Day three, tracing. If you have a workspace, run the tracing quickstart and open a trace. If you don’t, sketch the span tree for a returns agent that looks up an order, checks a window and files a request. Then write one sentence on what that trace can and cannot tell you.
After that, move on to the agent’s tools and memory, and come back to this list the day before the exam.
FAQ
What is the Databricks Agent Framework?
It is the set of Databricks tools for authoring, logging, evaluating and deploying AI agents, built on MLflow. For the exam, the core is authoring with the ResponsesAgent interface, logging models from code with declared resources, registering to Unity Catalog and tracing every run.
Is ResponsesAgent required, or can I still use ChatAgent?
The current Databricks docs recommend ResponsesAgent. ChatAgent and ChatModel are older interfaces. If an exam option picks one of the older ones for new work, treat that as a red flag.
Do I need an input_example when logging an agent?
Not with ResponsesAgent. MLflow infers the signature automatically. Without that interface you would either define the signature manually or provide an input example so MLflow can infer it.
Does MLflow tracing tell me if my agent is accurate?
No. Tracing records inputs, outputs, latency, tokens and cost for each step. Judging correctness, groundedness or safety is the job of evaluation and monitoring, which read those traces.
When should I use a chain instead of an agent?
When the steps are known ahead of time and don’t vary by input. An agent only earns its extra latency, cost and unpredictability when the next step genuinely has to be decided at run time.
Learn it properly, for free
The Databricks Agent Framework is one of those topics where a dump would teach you the wrong reflex: you’d memorize “agent” as the answer and miss every question where the boring chain is right. Learning the Reasoning Loop, the envelope and the line between a trace and a verdict is what actually holds up when the question changes its costume.
If you want a structured path through every domain, with these traps laid out in order, take my free Databricks Generative AI Engineer Associate course. Thirty to sixty minutes a day is enough. See you there.

Leave a Reply