Courses · The Ambush Method

Pick your exam.

Every guide follows the same method: short daily sessions, the traps each topic sets, and exam-style questions with an explanation for every option.

  • 100% free · no paywalls, subscriptions or ads
  • 30–60 min a day
  • Exam-style questions
  • Taught in English

Category: Study Guides

  • Prompt Version Control on Databricks: Prompts as Release Artifacts

    Prompt Version Control on Databricks: Prompts as Release Artifacts

    Picture a support assistant that has been running fine for months. On a Friday afternoon someone softens the wording of the refund instructions. No code is shipped, no pipeline runs, nobody breaks a rule. By Monday a few customers have been told something slightly different about refunds, and now someone asks a simple question: which exact instruction text was the assistant using when it answered each of those conversations? That question is the whole point of prompt version control on Databricks, and it maps to an exam objective that sounds boring until you meet it in a scenario: “Apply prompt version control and manage prompt lifecycle.” In my book it opens the chapter on releasing changes safely, and here I’ll walk you through it the way I’d explain it to a friend studying 30-60 minutes a day.

    If you are new to the exam, start with my Databricks Generative AI Engineer Associate study guide. This post leans on two earlier ones: Databricks prompt engineering (what goes inside a prompt) and MLflow + Unity Catalog for GenAI (versions and aliases for models). Today the same versions-and-aliases idea comes back, attached to a prompt, and it behaves in a way that surprises people.

    The ambush: “our prompts are already in git”

    Here is the reflex the exam is built to catch. Ask a team whether their prompts are under version control and the answer comes out instantly: yes, they live in the repository, and the repository is in git. Some teams go one step further and move prompts into a table so a product owner can edit them without waiting for an engineer.

    Both moves feel responsible. Both solve a scheduling problem. Neither gives the prompt a lifecycle of its own. The test I use is simple: can you name, with a number, the exact prompt version that served a given request, and can you put the previous one back without touching anything else? If the answer to either half is no, the prompt is versioned by accident, not on purpose.

    What git actually versions

    Git versions files. That is valuable and you should keep doing it. But the file is a container, and the prompt inside it inherits a history that belongs to the container. Three consequences follow:

    • The prompt cannot move without the code moving. A prompt change in production means a build, a pipeline and a deployment.
    • Nothing links a request to a prompt. To say which text answered a conversation you have to line up commit times against deployment times against conversation times, and hope nobody deployed twice that day.
    • Rollback is a release. Putting the old text back means reverting, rebuilding and redeploying.

    MLflow’s own documentation makes the same point in a note titled “Why not use Git?”: an application holds many prompts across many components, and tracking the change of a single prompt in one linear git history is hard.

    Why the table is not the answer either

    The table fixes the visible problem (non-engineers can edit) and quietly gives up the rest. An UPDATE overwrites, so yesterday’s text is gone. There is no pointer that separates “the version we are running” from “a version that exists,” so promotion becomes a convention someone has to remember. And nothing links a row to a request, which is the same attribution gap as git, arriving by another road.

    So the two common answers fail from opposite sides. Prompts in code have versions but no independence. Prompts in a table have independence but no versions. What you want is both, and that is not a discipline you impose. It is a mechanism you adopt.

    How prompt version control on Databricks works: the MLflow Prompt Registry

    That mechanism is the MLflow Prompt Registry. On Databricks it stores prompts in Unity Catalog, and as I write this the docs label it Beta, which is worth remembering before you build a compliance process on top of it. Its model is short enough to memorize:

    • Prompts are named entities in Unity Catalog, with the usual three-level name, catalog.schema.prompt.
    • Versions are immutable snapshots with auto-incrementing numbers. You never edit version 7; you register version 8.
    • Aliases are mutable pointers to a version, such as production or staging.
    • Tags are key-value pairs on a version.
    import mlflow
    
    mlflow.set_registry_uri("databricks-uc")
    
    # 1. Register: every call creates a new, immutable, numbered version.
    mlflow.genai.register_prompt(
        name="prod.support.refund_policy",  # catalog.schema.prompt
        template="You are a support assistant. {{policy_context}}\n\nQuestion: {{question}}",
        commit_message="Soften refusal tone; keep the 30-day window explicit.",
    )
    
    # 2. Promote: move the pointer, not the text.
    mlflow.genai.set_prompt_alias("prod.support.refund_policy", alias="production", version=7)

    Two details are worth slowing down for. First, the functions live under mlflow.genai. Second, a prompt in Unity Catalog is governed like a function. The docs ask for CREATE FUNCTION, EXECUTE and MANAGE on the schema to view or create prompts. If you already learned the Unity Catalog privilege cascade for models and tables, nothing new is needed here; it just ends in EXECUTE.

    One small asymmetry from my book that is worth knowing: the template text of a version is immutable, but the configuration recorded alongside it (model settings, tags) can be updated in place. The text is the release artifact; the metadata around it is not frozen.

    Alias names: environments, not Champion

    For models you met @Champion and @Challenger. Prompt aliases conventionally use environment names instead: dev, staging, production, with latest reserved for the newest version. Nothing breaks if you name a prompt alias Champion, but if an answer option puts @Champion on a prompt, read it as a hint that the option was written by someone thinking about models.

    If you are working through this with my free Databricks Generative AI Engineer Associate course, this is a good moment to pause and say the four words out loud: prompt, version, alias, tag. The rest of the objective is just what those four do together.

    The trap that decides rollback: who re-reads the pointer

    This is the part I think matters most, and it is the part people get backwards.

    In the model world, an alias is mostly a note to humans and tooling. When you create a serving endpoint, you hand it a version number, and from then on it serves that exact version. Move @Champion back to last week’s model and the endpoint does not care, because it was never asking. (I covered that in Model Serving vs ai_query.)

    A prompt alias is different because the running application reads it.

    import os
    import mlflow
    
    PROMPT_NAME = os.getenv("PROMPT_NAME", "prod.support.refund_policy")
    ENVIRONMENT = os.getenv("PROMPT_ALIAS", "production")
    
    # Live: re-reads the alias (cached about 60 seconds by default).
    prompt = mlflow.genai.load_prompt(f"prompts:/{PROMPT_NAME}@{ENVIRONMENT}")
    
    # Pinned: version 7 forever. Moving the alias will not touch this line.
    pinned = mlflow.genai.load_prompt(f"prompts:/{PROMPT_NAME}/7")

    Look at the first load. There is no version number in it. The application asks for whichever version the production alias currently names. MLflow caches alias-based loads with a short time-to-live, 60 seconds by default, so after about a minute the next request looks at the alias again. Version-pinned loads are cached indefinitely, which is safe because a version can never change.

    So when someone moves the production alias on a Friday afternoon, they are not leaving a note. They are changing what every running copy of the app says, within about a minute, with no deployment anywhere. The Databricks docs recommend exactly this pattern: load by alias, keep the alias name in an environment variable, and update production by reassigning the alias without redeploying code.

    When the version gets resolved

    The rule I want you to carry into the exam is not “models are one way and prompts are another.” It is this:

    • Resolved at deployment time = pinned. Moving the pointer later changes a label and nothing else.
    • Resolved at call time = live. Moving the pointer changes behavior on the next read.

    That axis cuts across artifacts. A batch job that loads a model by alias at the start of each run will pick up an alias move on its next run. An application that pinned a prompt version will ignore every alias move you make. In my book I compress it to one line: an alias only moves what re-reads it.

    Promotion and rollback: one call each way

    Here is another place where prompts and models part ways. For models, Databricks recommends separating environments by catalog (a dev catalog, a staging catalog, a prod catalog). For prompts, the docs promote by reassigning aliases on one registered prompt. My book notes there is no documented cross-catalog promotion pattern for prompts. So you end up with something like this:

    • dev points to version 9
    • staging points to version 8
    • production points to version 7

    Promoting version 8 to production is one set_prompt_alias call. Rolling back is the same call in the other direction. Both are true only if the application loads by alias. If it pinned a version number, rollback means shipping code again, which puts you right back where the git file left you.

    That is why I treat the load line as the single most important line in the app. Ask by alias and a bad prompt costs one command. Pin the version and it costs a release. Put the environment name in configuration rather than in source, so the same build runs in staging and production and only the alias differs.

    Answering “which prompt produced this answer?”

    Back to the question from the opening: which text was live for each conversation? The registry answers it, but not from the prompt page. The link lives in tracing. When an app loads a registry prompt inside a traced function, MLflow records which prompt version that trace used, and you can search traces by it.

    # Which conversations ran on version 7? Exact name/version match.
    mlflow.search_traces(filter_string='prompt = "prod.support.refund_policy/7"')

    That filter is an exact name/version match, which is fine, because an exact answer is what the question wanted. Two cautions from my book:

    • Order matters. The call that declares which application version is active has to run before the prompt is loaded. Load first and the link is simply not recorded, with no error to warn you. Make that ordering part of the app’s startup, not something a developer remembers.
    • Don’t mix up lineages. Prompt-to-trace history answers “what was in play when this ran.” It is not the same as tracing a retrieved chunk back to its source document. Exam stems sometimes describe one while the options talk about the other.

    If you want an evaluation run tied to a specific prompt version, that link also comes through tracing. I wrote about the evaluation side in Databricks agent evaluation vs monitoring.

    How the exam asks about prompt lifecycle

    Like most objectives in this exam, this one is written as a decision, not a definition. The constraint words in the stem carry the answer:

    • “Preserve version history,” “roll back to a previous version,” “promote only after approval” describe a registry with immutable versions and aliases. They rule out anything that overwrites.
    • “Which prompt produced this output” is about the trace link, not the registry listing.
    • “Reversible immediately, without a release” is about how the app loads the prompt: by alias, at call time.
    • An option that promotes a prompt by merging a branch or overwriting a row is wrong for the same reason both times: the promotion is not separable from something else.
    • An option that “fixes” a pinned app by shortening the cache is a timing answer to a resolution problem. A shorter cache helps only a client that re-reads the alias.

    My study tip for a 30-60 minute session: write the load line twice on paper, once with @production and once with /7, and next to each write what rollback costs. If you can explain that difference to someone in two sentences, you own this objective. If you want the bigger picture of where this sits in a release, my post on the Databricks Agent Framework and MLflow Tracing shows where the prompt fits inside an agent.

    FAQ

    Is keeping prompts in git enough for prompt version control on Databricks?

    No. Git versions the file, not the prompt. You cannot promote the prompt without deploying code, nothing links a request to the text that served it, and rollback is a release. Keep the file in git if you like, but give the prompt its own versions in the MLflow Prompt Registry.

    Where are prompts stored on Databricks?

    In the MLflow Prompt Registry, backed by Unity Catalog, under a three-level catalog.schema.prompt name. You need CREATE FUNCTION, EXECUTE and MANAGE on the schema to view or create prompts. The feature is labeled Beta in the docs as of this writing.

    How fast does moving a prompt alias reach a running app?

    If the app loads by alias, about a minute by default, because alias-based loads are cached for 60 seconds. If the app pinned a version number, never: the pinned version is cached indefinitely and does not re-read the alias.

    How do I roll back a bad prompt?

    Point the alias back to the previous version with set_prompt_alias. That works only when the app loads the prompt by alias. If it pinned a version, rolling back requires a code release.

    Do prompts use Champion and Challenger aliases like models?

    Conventionally no. Prompt aliases use environment names such as dev, staging and production, with latest reserved for the newest version. Champion and Challenger are model registry habits.

    Wrapping up

    A prompt is a release artifact in its own right. It has its own immutable versions, its own movable pointer and its own history, and none of the three belong to the code. Once you see that the running app is the thing reading the pointer, the exam questions on this objective stop being trivia and become one question: who re-reads, and when?

    If you want to learn the rest of this exam the same way, trap by trap, in 30-60 minutes a day and without dumps, my free Databricks Generative AI Engineer Associate course is the place to start. Next on the blog I’ll take the release one step further: what CI/CD can honestly promise for a GenAI app.

  • Agent Memory on Databricks: Context Window vs Vector Index vs Lakebase

    Agent Memory on Databricks: Context Window vs Vector Index vs Lakebase

    Picture an IT helpdesk agent. On the first turn the employee says, “My laptop is asset LT-0931 and the VPN keeps dropping.” The agent asks a couple of questions, checks a known-issues page, suggests a fix. Three turns later the employee says, “Okay, that didn’t work, please open a ticket.” And the agent replies: “Sure! What’s your asset number?”

    Nothing crashed. No error in the logs. The agent simply didn’t have the number anymore. That small, annoying moment is what agent memory on Databricks is about, and it maps to an exam objective that reads almost like a riddle: “Configure a persistent datastore to store and retrieve intermediate memory or structured information.” In my book this is the section where the agent finally remembers across turns, and here I’ll walk you through it the way I’d explain it to a friend studying 30-60 minutes a day.

    If you are new to the exam, start with my Databricks Generative AI Engineer Associate study guide. This post also builds on two earlier ones: Databricks Agent Framework and MLflow Tracing (what makes something an agent) and AI agent tools on Databricks (how the agent gets its verbs). Tools let it act. Memory lets it keep track of what it already did.

    Why this objective is a trap, not a definition

    When an exam scenario says “the agent forgets something from earlier in the conversation,” the answers usually offer you three places to put the missing fact:

    • A model with a bigger context window, so more of the conversation fits.
    • The vector index the agent already searches for documents.
    • A persistent datastore the agent writes to and reads back every turn.

    Two of those feel right and are wrong, and each one catches a different kind of reader. If you are new to LLMs, “memory” sounds like “context window,” so a forgetful agent needs a bigger one. If you have spent weeks building RAG, you reach for the index, because storing things and getting them back is literally what it does. Both instincts put the fact somewhere that can’t hold it the way the task needs.

    The ambush idea I use everywhere on this site applies perfectly here: don’t memorize “the answer is Lakebase.” Learn the one question that sorts every option, and the scenario can change costumes as much as it likes.

    Agent memory on Databricks: three places a fact can live

    I explain this with three pieces of furniture, because they make the differences hard to forget.

    The desk: the context window

    The context window is the desk the model works on during one call. Whatever is on it is in view for exactly that call. Then the desk is wiped, and the next call starts on a bare surface. If an agent ever seemed to “remember” something, it’s because your code put it back on the desk by re-sending it.

    A bigger desk holds more paper at once. It does not hold anything longer. Wiping is what a desk does, so a scenario about forgetting across turns is never solved by adding room. I covered context windows from the model selection side in how to choose an LLM on Databricks; here the point is simpler: size is not persistence.

    The library: the vector index

    The vector index is a library. You walk in with a question, search by meaning, and walk out with the passages that match. That is retrieval, and it is exactly right when the agent needs to look something up in a large body of shared documents, like the known-issues pages in my helpdesk example. If that part feels shaky, my posts on Databricks Vector Search (now branded AI Search) and RAG on Databricks cover it.

    But you don’t go to a library to write down what one employee told you three minutes ago. The index answers “what do our documents say about VPN drops,” not “what asset number did this person just give me.” Pushing per-conversation facts into it is asking a reference library to also be your diary, and it mixes private, short-lived scraps into a store meant for stable, shared knowledge.

    The notebook: a persistent datastore

    The third place is a notebook the agent keeps next to the desk. It isn’t wiped between calls, because it lives outside the call entirely, in a database. And it isn’t a corpus you search across; it holds this conversation’s state, and this user’s facts, under their own names. The asset number goes in the notebook on turn one. On turn four, the agent reads the notebook and the number is simply there.

    That is what the objective means by “a persistent datastore for intermediate memory or structured information”: a store that outlives the turn and holds the running state, the extracted fields, the decisions so far, whatever the conversation needs to stay coherent.

    The two-question sort

    Whenever a scenario asks where a fact should go, ask two questions, in this order.

    • Does it need to outlive this call? If not, it stays on the desk, in the prompt, and you’re done.
    • If it does, is it a shared document to search by meaning, or this conversation’s (or this user’s) own state? Documents go to the index. State goes to the persistent store.

    Most agent memory mistakes, on the exam and in real projects, are a fact filed by habit instead of by those two questions. Conversation state ends up in the index because retrieval was the tool already wired in.

    Short-term vs long-term memory: read the names slowly

    Databricks splits the notebook into two kinds of page, and the names are a trap if you read them fast. The thing to lock in first: both are persistent. Both outlive the call. Neither one is the context window.

    • Short-term memory is the state of one conversation. It’s kept under a conversation identifier (a thread or session id) and reloaded at the start of every turn, so a single chat stays coherent from the first message to the last. “Short-term” refers to its scope, one conversation, not to how long it lasts.
    • Long-term memory spans conversations. A user’s standing preference, a past decision, an ongoing project: anything that should still be true the next time they come back.

    So the axis between them is scope, not permanence. If an answer option calls the context window “short-term memory,” it has confused the desk with a page of the notebook. That’s your tell.

    Lakebase: the notebook has a name on Databricks

    On Databricks, the notebook is Lakebase, a fully managed Postgres database built into the platform. The fact that it’s Postgres matters. Agent memory is many small, fast reads and writes: every turn, load this conversation’s state, write the update, move on. That is transactional (OLTP) work, which is what Postgres is built for, and not what the analytical stores you’ve used so far are built for.

    When I wrote the book, the main pattern was self-managed: you point a framework’s checkpointer (LangGraph’s Postgres checkpointer, for example) at your own Lakebase instance and pass the same thread id on every turn. That still works, but the current Databricks docs label self-managed memory as a legacy approach and recommend, for new agents, the managed agent sessions and agent memory stores, which Databricks runs on Lakebase for you. At the time I’m writing this they are in Beta, so details can change.

    The managed version lines up neatly with the two kinds of page:

    • Agent sessions hold one conversation: the ordered messages, tool calls and results the agent replays to continue it. That’s short-term memory.
    • Agent memory holds durable facts and preferences that the agent recalls in later, separate conversations. That’s long-term memory.

    Here is a small sketch adapted from the patterns in the Databricks docs, using the AgentKit SDK. Read it for the shape, not the syntax:

    from databricks.sdk import WorkspaceClient
    from databricks_agentkit import AgentKitClient
    
    agentkit = AgentKitClient(WorkspaceClient())
    
    # Short-term: one conversation, read back in order every turn.
    sessions = agentkit.session_stores.create("helpdesk-agent-sessions")
    session = sessions.add(actor_id="user-123", session_id="ticket-77")
    session.append_items([{"type": "message", "role": "user",
                           "content": "My laptop is asset LT-0931 and the VPN keeps dropping."}])
    history = [i.data for i in session.list_items(order_by="create_time asc")]
    
    # Long-term: a durable fact this user will still care about next month.
    memory = agentkit.memory_stores.create("helpdesk-agent-memory")
    memory.put(actor_id="user-123", path="/preferences/contact.md",
               content="Prefers updates by email, not phone.",
               description="Contact preference")
    memory.search(actor_id="user-123", query="how does this user want to be contacted")

    Two details in there are worth knowing for the exam and for real life. First, the session is read back in order, by its id, to rebuild context each turn. That’s the “same id, same conversation” mechanism. Second, every memory call is scoped to an actor_id. The docs are explicit that you should set it in trusted code from the verified user identity, never let the model or the end user choose it, and use separate stores when tenants need strict isolation, because the actor id separates data but isn’t access control on its own.

    You’ll notice long-term memory is recalled with a natural-language search. Doesn’t that make it a vector index after all? No, and this is a nice nuance. The search runs over one actor’s own memory entries, not over your shared document corpus. The library is still for documents everyone shares. The notebook is still this user’s, even if it has a good index of its own pages.

    Where Delta fits (and where it doesn’t)

    A Delta table is persistent too, so it shows up as a distractor. You could write conversation state to one, but Delta is the analytical store: built for big scans and batch history, not for a fast read-modify-write on every turn. Its place is downstream. The live state sits in Lakebase while the conversation runs, and Delta is where that history can land afterward for analysis and audit.

    Four jobs, cleanly split:

    • Live, per-turn conversation state: the persistent operational store (Lakebase, via sessions).
    • Durable facts about a user across conversations: long-term memory (Lakebase, via memory).
    • Shared documents searched by meaning: the vector index.
    • The after-the-fact analytical record: Delta.

    The two traps, in one line each

    Trap 1: the bigger context window. It holds more in one call and still forgets between calls. When something is forgotten over time, ask whether the fix adds room or adds permanence. A cross-turn scenario is always about permanence.

    Trap 2: the vector index as memory. The index retrieves shared documents by similarity. Conversation state is read back exactly, for one conversation. You don’t want the agent to search for an asset number by meaning and hope the nearest neighbor is the right one.

    A third, quieter trap: an option that picks a persistent store but the wrong timing, like writing state only when the conversation ends. A fact needed on turn four doesn’t help anyone if it’s saved after turn ten.

    How I’d study this in 30-60 minutes a day

    • Day one, 30 minutes: draw the desk, the library and the notebook. Under each, write what it’s for and what it forgets. If you can’t explain why a bigger desk doesn’t help, reread that part.
    • Day two, 45 minutes: read the Databricks page on agent memory and sessions, and note which store holds one conversation and which holds facts across conversations.
    • Day three, 30 minutes: take ten facts from an imaginary agent (an order id, a user’s language, a policy document, yesterday’s decision) and sort each one with the two questions.
    • Day four, 30 minutes: go through scenario questions and, whenever an agent “forgets,” ask first “room or permanence?” before you read the options.

    That’s the ambush approach in practice. If you want these traps laid out domain by domain, in the order the exam guide covers them, my free Databricks Generative AI Engineer Associate course does exactly that.

    FAQ

    What is agent memory on Databricks?

    It’s a persistent store, outside the model call, where an agent keeps conversation state and durable facts so it can use them on later turns or in later conversations. On Databricks this is backed by Lakebase, a managed Postgres database, through agent sessions (one conversation) and agent memory (across conversations).

    Is short-term memory the same as the context window?

    No. Short-term memory is persistent and scoped to one conversation, reloaded each turn by its thread or session id. The context window is wiped after every call. Short-term vs long-term is about scope, not about how long the data survives.

    Why not just use a model with a bigger context window?

    A bigger window holds more within a single call but retains nothing between calls. It changes capacity, not persistence, so it can’t fix an agent that forgets across turns.

    Can I store agent memory in my Vector Search index?

    You shouldn’t. The index is for shared documents searched by meaning. Conversation state needs to be read back exactly for one conversation, and putting per-user facts in the index pollutes a store meant for shared knowledge.

    When should I use Lakebase vs a Delta table for agent state?

    Lakebase for the live state an agent reads and writes every turn, because that’s fast transactional work. Delta for the after-the-fact analytical and audit record of that state.

    Learn it properly, for free

    Agent memory is a perfect example of why dumps fail you. Memorize “the answer is Lakebase” and a question where the fact only needs to live for one call, or where the thing to store is a document, catches you anyway. Learn the desk, the library and the notebook, plus the two questions, and every version of the scenario sorts itself.

    If you want a structured path through every domain, with traps like these mapped out, take my free Databricks Generative AI Engineer Associate course. Thirty to sixty minutes a day is enough. See you there.

  • AI Agent Tools on Databricks: Knowledge vs Action, Described and Ordered

    AI Agent Tools on Databricks: Knowledge vs Action, Described and Ordered

    Imagine a support bot that explains your return policy perfectly. It knows the window, it knows the exceptions, it can walk a customer through every step. Then someone asks it to actually start the return, and it just… explains the steps again. Nothing gets filed. Nobody notices until a customer writes back asking where their return label is.

    That gap is the whole story of AI agent tools on Databricks, and it is one of the most quietly tested ideas on the Generative AI Engineer Associate exam. The objective asks you to “define and order tools that gather knowledge or take actions for multi-stage reasoning.” It sounds like a list-making exercise. It isn’t. In my book this is the section where the agent gets its verbs, and here I’ll walk you through it the way I’d explain it to a friend studying 30-60 minutes a day.

    If you are new to the exam, start with my Databricks Generative AI Engineer Associate study guide. And if the difference between a chain and an agent still feels fuzzy, read Databricks Agent Framework and MLflow Tracing first, because tools only matter once something is choosing which one to call.

    Where agent tools sit in the exam

    This objective lives in Design Applications, which Databricks lists at 14% of the exam on the official certification page. That page also lists 45 scored questions in 90 minutes. Agent topics are not confined to one corner, though. Authoring the agent sits in Application Development (30%), and giving it memory sits in Assembling and Deploying Apps (22%). Tools are the piece that connects them: an agent that reasons well but holds the wrong verbs still fails the task.

    The exam leans on two misreadings here, and both feel reasonable:

    • that a capable agent is a well-stocked one, so more tools means more capability;
    • that “order” means the position of each tool in the list you pass to the agent.

    Both are wrong, and the rest of this post is about why.

    Two kinds of tool: knowledge and action

    A tool is simply a function the agent is allowed to call. The objective itself splits tools in two, and that split is worth carrying into the exam room as a reflex.

    Knowledge tools gather information

    A knowledge tool answers a question without changing anything. It searches, looks up, reads. The retrieval pipeline you built for RAG, with all its chunking, embedding and index syncing, becomes one knowledge tool from the agent’s point of view. The agent doesn’t see the machinery. It sees a name and a promise: ask me about the return policy and I will bring back the passages that matter. If you want a refresher on that machinery, my posts on Databricks Vector Search (now branded AI Search) and RAG on Databricks cover it.

    Action tools change the world

    An action tool changes the state of something outside the agent. It files a ticket, writes a row, sends an email, schedules a callback. When it runs, something exists that didn’t exist before.

    This is the distinction that explains the bot in the opening. You can hand an agent every knowledge tool in the building and it will still be unable to start a single return, because reading about an action and performing it are different verbs. No prompt fixes a missing verb, and neither does a bigger model.

    The trap: an agent that explains but never acts

    Here’s the shape the exam likes. A scenario describes an agent that should complete a task with a real-world effect. In testing, it understands the task, describes the steps clearly, and never actually does the thing. The answer options offer a better prompt, a larger model, more documents, or more tools in general.

    The pull is strong because the agent looks so close to working. It clearly understands. But understanding and acting come from different parts of the system. When the task asks for a change in the world and the toolset only gathers information, the missing piece is an action tool.

    My habit for this kind of stem: stop grading how well the agent explains, and go count its verbs. If none of them change anything, you’ve found the answer.

    The description is how the tool gets picked

    This is the part that surprises people the first time. The agent does not pick a tool by its position in the list, or by a priority you set somewhere in code. It reads each tool’s name and description and decides which one fits the step it’s on.

    That means the description is not documentation for the next engineer. It is the interface the model selects against, and often the only thing it has to go on.

    Compare two versions of the same retriever:

    • search_docs, with no description. The model has to guess when it applies, so it sometimes calls it for questions it can’t answer and sometimes skips it for questions it could.
    • search_return_policy, described as “Look up the company’s return and warranty policy. Use this to answer whether and how an item can be returned.” Now the guess becomes a decision.

    The classic production mystery, “why did the agent never call the retriever when the answer was sitting in the index?”, usually ends here. The model didn’t fail to reason. The tool’s description never told it this was the right verb for that kind of question.

    On the exam, when an agent uses a tool at the wrong time or not at all, suspect the name and description before you suspect the model. An answer that swaps in a bigger model when the real defect is a vague tool description is reaching past the actual lever.

    What “order” really means: decomposition

    The objective says “define and order,” and “order” is the word that misleads. Reordering the tools in the list you pass to an agent doesn’t change what it does, because the model reads all the descriptions and chooses at every step anyway.

    What “order” really names is the earlier, harder work: breaking the task into its real sequence of steps and making sure each step has the tool it needs.

    Walking through the return example

    Starting a return is not one action. It’s a small chain of reasoning:

    • understand what the customer is asking for;
    • look up their order (knowledge tool);
    • check the return policy and whether the order is inside the window (knowledge tool, plus reasoning);
    • file the return request (action tool);
    • confirm back to the customer what happened.

    That sequence is the design work. Get it right, and the agent has a verb for every step plus a description telling it when each applies, so the loop can walk the sequence on its own. Get it wrong, for example by handing it the action tool but no way to check the window first, and it will happily file returns it should have refused.

    In the free course I come back to this decomposition habit again and again, because it shows up in scenario questions far beyond agents: break the requirement into steps first, then pick the piece for each step.

    Why more tools is not more capability

    Past the tools the task actually needs, every extra tool is one more option the model can choose wrongly. A pile of tools with overlapping, vague descriptions isn’t capability. It’s a bigger space to guess in. When an exam answer fixes a struggling agent by “adding more tools” without naming the specific missing verb, be suspicious.

    How AI agent tools work on Databricks

    On Databricks, the two kinds of tool usually have two concrete homes.

    For knowledge, the current docs recommend AI Bridge for new Python agents that query AI Search indexes, using VectorSearchRetrieverTool from databricks-langchain or databricks-openai. Notice that the tool takes a tool_name and a tool_description, which is exactly the label the model selects against.

    For predefined logic the agent runs with parameters it supplies, the docs point to Unity Catalog functions, wrapped with UCFunctionToolkit. In the book’s return example, the action tool is a Unity Catalog function that files the request. Here’s the shape, adapted from that example:

    from databricks_langchain import VectorSearchRetrieverTool, UCFunctionToolkit
    
    # Knowledge tool: the retriever you already tuned, exposed as one verb.
    policy_search = VectorSearchRetrieverTool(
        index_name="main.support.docs_index",
        tool_name="search_return_policy",
        tool_description=(
            "Look up the company's return and warranty policy. "
            "Use this to answer whether and how an item can be returned."
        ),
    )
    
    # Action tool: a governed Unity Catalog function that files the request.
    return_tools = UCFunctionToolkit(
        function_names=["main.support.file_return_request"]
    ).tools
    
    agent_tools = [policy_search, *return_tools]

    Two details in that snippet carry weight on the exam. Each tool has a description written for the model, not for you. And the action tool is a governed Unity Catalog function, registered under a three-part name like every other catalog object.

    EXECUTE decides what the agent can do

    Because the action tool is a Unity Catalog function, the same privilege model that governs everything else now governs what the agent is allowed to do. Calling an existing function requires EXECUTE on it, plus USE CATALOG and USE SCHEMA on its parents, and Databricks recommends granting EXECUTE on individual functions for least privilege.

    -- The agent's identity can only run what it was granted.
    GRANT USE CATALOG ON CATALOG main TO `support-agent-sp`;
    GRANT USE SCHEMA ON SCHEMA main.support TO `support-agent-sp`;
    GRANT EXECUTE ON FUNCTION main.support.file_return_request TO `support-agent-sp`;

    The service principal name above is just an example. The point is that an agent can take exactly the actions its identity was granted and not one more. That ties straight into guardrails and governance for Databricks GenAI apps, where controlling what actions can touch becomes a topic of its own.

    Where MCP fits

    The docs now also expose tools through MCP (Model Context Protocol), a standard way for agents to reach governed tools and outside services through one interface. In the workspace you find them under Unity Gateway. For a Unity Catalog function, the docs currently say new Python agents should call it directly with UCFunctionToolkit, while the MCP endpoint stays available for existing integrations. For most other tools, the docs say to start with MCPs. I covered that side, including when to rent a managed server and when to build your own, in Databricks MCP and Genie.

    Underneath whichever transport you pick, the exam reflex stays the same: knowledge or action, clearly described, one per real step.

    How I’d study this in 30-60 minutes a day

    • Day one, 30 minutes: take three tasks you know from work and decompose each into steps. Label every step knowledge or action.
    • Day two, 30 minutes: write a tool description for each step that says when to use it, not just what it is. Then ask yourself whether two of them could be confused.
    • Day three, 45 minutes: read the Databricks pages on Unity Catalog function tools and unstructured retrieval tools, and note which privileges an agent needs to call a function.
    • Day four, 30 minutes: go through scenario questions and, for every agent that fails, ask first “is a verb missing or mislabeled?” before you look at the model.

    That’s the ambush approach: you don’t memorize answers, you learn where the trap is set so you spot it however the question is worded.

    FAQ

    What are the two kinds of AI agent tools on Databricks?

    Knowledge tools, which gather information without changing anything (like a retriever over an AI Search index), and action tools, which change something outside the agent (like a Unity Catalog function that files a request).

    How does an agent decide which tool to call?

    It reads each tool’s name and description and matches them to the step it’s on. Its position in the list doesn’t matter, which is why a vague description causes wrong or skipped calls.

    Does adding more tools make an agent smarter?

    No. Beyond what the task needs, extra tools mostly add ways to choose wrong. Capability comes from the right tools, clearly described, for a well-decomposed task.

    What does “order tools” mean on the exam?

    Decomposing the task into its real sequence of steps and giving each step the tool it needs. The sequence lives in the agent’s reasoning, not in how you arrange the list.

    How do I control which actions an agent can take?

    When the action is a Unity Catalog function, grant the agent’s identity EXECUTE on that specific function, along with USE CATALOG and USE SCHEMA on its parents. It can’t run functions it wasn’t granted.

    Learn it properly, for free

    Agent tools are a great example of why dumps fail you. Memorize one answer about “adding a tool” and the next question, where adding tools is the wrong move, catches you. Learn the two verbs, the role of the description and what “order” really means, and the question can change costumes without fooling you.

    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.

  • Databricks Agent Framework and MLflow Tracing: From Chain to Agent

    Databricks Agent Framework and MLflow Tracing: From Chain to Agent

    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. ChatAgent and ChatModel are the older options, not the current recommendation.
    • Don’t hand-build the signature. A ResponsesAgent infers it; an input_example is 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.

  • How to Choose an LLM on Databricks: Gates First, Then Latency, Cost and Quality

    How to Choose an LLM on Databricks: Gates First, Then Latency, Cost and Quality

    Someone hands you a feature and one line of instructions: pick the model. No budget, no latency target, no shortlist. So you sort a leaderboard by the top score and write that name in the doc. Then Monday arrives, and every question is about cost, privacy and context size, not the leaderboard.

    That gap is exactly what the exam tests when it asks you to choose an LLM on Databricks. It is not a memory test about model names. It is a test of whether you can defend a choice in the right order. In my book I call that order the Selection Stack, and here I’ll walk through it the way I’d explain it to a friend studying for the Generative AI Engineer Associate.

    If you are still mapping the whole exam, start with my Databricks Generative AI Engineer Associate study guide. This post is the foundation under almost everything else: once you can pick a model, the rest of the exam is about feeding it, serving it and checking it.

    How to choose an LLM on Databricks: where it sits in the exam

    The objectives are short and easy to skim past. “Select model tasks to accomplish a given business requirement” lives in Design Applications. “Select a model from a model hub or marketplace for a task based on model metadata/model cards” and “Select the best LLM based on the attributes of the application to be developed” live in Application Development. According to the official certification page, those two sections weigh 14% and 30%, and Application Development is the heaviest on the paper. The exam has 45 scored questions in 90 minutes and costs US$200.

    Almost every “which model” question is one of these three objectives in disguise.

    First, what the model is actually doing

    Before choosing a model, you need the right picture of what one is. A large language model does not look facts up. It predicts the next token from patterns it learned, over and over, until the answer is done. That is why a fluent answer can be confidently wrong, and why a newer model does not repair a made-up policy. Fixing that is a grounding problem, which I cover in RAG on Databricks.

    Three words from that picture show up in every model-choice question.

    Tokens: the unit of every limit and every price

    A token is a chunk of text, usually smaller than a word. The model never sees words or characters, only tokens, so every limit and every price is counted in them. A common rule of thumb for English is about four characters per token. Treat it as an approximation, not a promise, because the split depends on the exact text. Hosted models bill for input tokens plus output tokens, which is why “shorten the prompt” and “cap the response length” are the two levers that really move a bill.

    The context window: a budget, not a memory

    The context window is the most tokens a model can handle in one call, and your input and its output share it. People call it memory, and that is the wrong word. Each call starts empty. A chat that seems to remember earlier messages is re-sending them inside every new request and paying window space for them each time. If the input alone overruns the window, the overflow is not read. Depending on the tool around the model, the call fails or quietly drops text, and the model answers from a truncated copy without telling you. That silent version is the same trap I wrote about in chunking strategies for Databricks RAG.

    Temperature: a randomness knob, not an intelligence knob

    At temperature zero the model takes the most likely token every time, so output is repeatable. Higher values let less likely tokens through, so output varies. Neither is “better.” Low fits classification, extraction and anything you will test or audit. Higher fits brainstorming and drafting. If a teammate says “it gave a different answer when I ran it again,” that is sampling, not a bug. One current-docs wrinkle worth knowing: the supported models page notes that some newer models reject sampling parameters such as temperature, so check the model’s own entry before you rely on the knob.

    The Selection Stack: three decisions, in order

    Here is the idea the whole post hangs on. Choosing a model is three decisions made top to bottom:

    • Architecture: the shape of the solution. Is this a single model call, a retrieval pipeline, an agent?
    • Model: which one fits the application’s attributes.
    • Grounding: how you supply what the model never learned, such as your private data.

    Each layer constrains the one below it, so the order cannot be shuffled. Picking a model before you know the architecture is how teams end up evaluating chat models for what is really a search problem. The rest of this post lives in the middle layer, with a short look at the first.

    Step one: name the task before the model

    A business request hides a language task. “Condense these long notes into something readable on a dashboard” is summarization. “Sort incoming emails into complaint or not” is classification. “Find tickets that mean the same thing” is not generation at all: it is an embedding task, a search problem that uses the retrieval machinery from Databricks Vector Search.

    Naming the task first matters for two reasons. It shortens the shortlist, because a classification job can often run on a small, cheap model with no large generative model anywhere in the design. And it protects you from the broad-versus-specific trap.

    The trap: the technically true answer

    When a narrow task and the broad family that contains it are both on offer, the broad one is true and still wrong. Summarization is a kind of text-to-text generation, so “text-to-text generation” is technically correct for almost anything. Think of it as a job posting that says “produce some text”: it commits you to nothing. The exam rewards the most specific category that describes the requirement.

    The tell is the verb in the stem. “Summarize,” “classify,” “translate,” “route”: the requirement usually contains the word for its own task. When a verb names a specific job, distrust the more general option sitting next to it.

    Step two: read the model card like a contract

    Once you have a shortlist, you open the model card. The mistake is reading it like a brochure. A model card has two kinds of content on one page. Some of it is contract: terms that bind you whether or not you read them. The rest is brochure: numbers someone chose to print.

    The clauses that bind

    • License. It decides what you are allowed to do. Some licenses allow commercial use freely, some limit a model to research, some allow commercial use only under a company-size threshold. A model can be excellent on every other axis and still be unusable because the license forbids what your product does.
    • Context length. A hard number. If your inputs need more tokens than the card allows, no score changes that arithmetic.
    • Training cutoff. The date after which the model has seen nothing. It bounds what the model can know on its own. A recent cutoff does not replace handing the model your current data at answer time.
    • Intended use and limitations. The fine print where makers say what the model is not for, such as languages it was not tuned for. It is the shortest section and often the most honest.

    The parts that only suggest

    Parameter count is a hint about capability and cost, never a ranking to obey. More parameters often means more capable, but it also means slower and more expensive to run, so size is a trade-off with a price, not a free upgrade. Benchmark scores are a real measurement on someone’s chosen test, and any benchmark is a proxy for your task, not your task. A high score earns a spot on the shortlist. It does not win the job.

    For the exam, remember the order: read the binding clauses first, then let the brochure impress you. A model with a license that says no is not a strong option with a caveat. It is out.

    On Databricks, the supported models page lists each hosted model with its service name (the system.ai names), supported inputs and notes. Models you pull from outside hubs or marketplaces carry the same card logic: read the clauses before you wire anything.

    Step three: choose by the application’s attributes

    This is the heart of “select the best LLM.” Five attributes of the application decide the answer, and they are not equal.

    Two gates and three trade-offs

    • Privacy is a gate. If the data is customer records or regulated data and may not leave your governed boundary, a model that sends every prompt outside it is out, however good it is.
    • License is a gate. If the application is commercial, the license must permit commercial use.
    • Latency is a trade-off. A live chat feature needs answers fast. A nightly batch job that summarizes yesterday’s tickets has no such ceiling and can use a slower, stronger model freely.
    • Cost is a trade-off. It is the price per call multiplied by the number of calls, and volume is the part that ambushes people. A model that is affordable in a demo can get expensive at high request volume.
    • Quality is a floor, not a score to maximize. Name the quality the task actually needs, clear it, and stop paying for capability above it.

    So the real decision is: clear the two gates first, then find the point among latency, cost and quality that the application can live with. These three pull against each other, since more quality usually costs more money and more time.

    If you like learning traps like this one at a time, that is how my free Databricks Generative AI Engineer Associate course is built: 30-60 minutes a day, one objective at a time, no dumps.

    The ambush: peak capability versus constrained fit

    This is the trap I would bet on. A scenario describes an application with a firm constraint, such as a tight latency budget, high request volume on a small budget, or a privacy rule. Among the answers sits the flagship model, the most capable and the most expensive. It is written to be chosen, because “most capable” feels like the safe pick that nobody gets blamed for.

    The Selection Stack disarms it. Peak capability is a property of the model. Fit is a property of the relationship between the model and the application, and the objective asks about the second. A model that violates a hard constraint is not a strong option with a drawback. It is a disqualified option, the same gate logic as the license clause, now applied to the application’s limits. The right answer is the least model that clears every constraint, not the greatest model that clears only some.

    The mirror image is overcorrecting to the smallest, cheapest model that misses the quality floor. When a stem names a constraint and one answer is the obviously most powerful model, treat the power as the distraction and the constraint as the question.

    Serving mode is part of the decision

    Cost and latency are not only model-choice levers. They are also serving-mode levers, and Databricks splits them there. Per the Foundation Model APIs docs:

    • Pay-per-token is the easiest way to start and is recommended for beginning your journey. For latency-sensitive production traffic, the docs also describe priority pay-per-token, an opt-in mode billed at a higher per-token rate.
    • Provisioned throughput is recommended for production workloads that need high throughput, performance guarantees, fine-tuned models or additional security requirements. It comes in on-demand and reserved options.
    • AI Functions optimized models are recommended for batch inference workloads.

    So two models with identical cards can cost and behave very differently depending on what sits behind them. Light or bursty traffic and prototypes point to pay-per-token. Sustained load that needs predictable latency points to provisioned throughput. A scheduled job over a table points to batch. I compare the batch and real-time paths in detail in Databricks Model Serving vs ai_query.

    Test on your own data

    A benchmark can shortlist a model, but only your data can pick one. The habit worth building is to run the same prompt through two or three candidates and compare. Here is a tiny sketch of that idea using the Foundation Model APIs from Python.

    from databricks.sdk import WorkspaceClient
    
    w = WorkspaceClient()
    client = w.serving_endpoints.get_open_ai_client()
    
    # Same prompt, two candidate models: compare quality, latency and cost on YOUR data.
    for endpoint in ["databricks-meta-llama-3-1-8b-instruct",
                     "databricks-meta-llama-3-3-70b-instruct"]:
        reply = client.chat.completions.create(
            model=endpoint,
            messages=[{"role": "user",
                       "content": "Classify this ticket as billing, bug or other: 'I was charged twice.'"}],
            temperature=0,    # repeatable output while you compare
            max_tokens=10,    # a label needs a few tokens, so cap the output (and the bill)
        )
        print(endpoint, "->", reply.choices[0].message.content)

    You are comparing quality, speed and cost on your own task, with temperature pinned so differences come from the models and not from sampling. When the comparison grows beyond a toy, you will want proper judges and ground truth, which is the subject of Databricks agent evaluation vs monitoring. And because the instructions you send shape the result as much as the model does, my post on Databricks prompt engineering is the natural next step.

    FAQ

    How do I choose an LLM on Databricks for the exam?

    Use the Selection Stack: decide the architecture, then choose the model by the application’s attributes, then decide how to ground it. Within the model step, clear the gates (privacy and license) first, then balance latency, cost and quality.

    Does a bigger model always give better answers?

    No. Bigger often means more capable, but it also means slower and more expensive, and it is never automatically best for a specific task. The exam rewards the least model that clears every constraint and meets the quality the task needs.

    What is the difference between a context window and memory?

    The context window is a per-call token budget shared by input and output. The model keeps nothing between calls. A chat only seems to remember because earlier messages are sent again with each request.

    When should I use pay-per-token versus provisioned throughput?

    Pay-per-token fits getting started, prototypes and light or bursty traffic. Provisioned throughput fits production workloads that need performance guarantees. Batch jobs use AI Functions.

    Learn the rest of the exam the same way

    Choosing a model is a small slice of the exam, but it is the one you reuse everywhere: name the task, read the clauses, clear the gates, then balance the trade-offs. If you can do that out loud, you can defend your pick to anyone, on exam day or in a Monday meeting.

    If you want every objective broken down like this, with the traps called out and short daily sessions instead of a cram weekend, take my free Databricks Generative AI Engineer Associate course. It is built for 30-60 minutes a day, and it never uses exam dumps.

  • Databricks MCP and Genie: Managed vs Custom Servers, Tables vs Documents

    Databricks MCP and Genie: Managed vs Custom Servers, Tables vs Documents

    A research assistant needs live figures from a market-data source, answers from a third-party search service that wants an API key, and a way to tell users how many orders shipped late last week. The tempting move is to write one tidy server that wraps all of it. That is exactly the instinct Databricks MCP and Genie questions are built to catch. The exam is not asking whether you can build the integration. It is asking how little of it you should build, and which specialist should answer which kind of question.

    This is the newest corner of the Generative AI Engineer Associate, and in my book it lives in the same chapter as Agent Bricks. The idea that ties them together is what I call the Abstraction Ladder: every piece of an agent sits somewhere between “write it yourself” and “rent it from Databricks,” and each rung up trades some control for speed and less to maintain. The skill being tested is naming the rung a requirement needs. Not climbing to the top, and not clinging to the bottom to prove you can code.

    If you are still mapping the whole exam, start with my Databricks Generative AI Engineer Associate study guide. If you want the top rung of the ladder (renting a whole agent), read Databricks Agent Bricks: when to rent and when to build. This post covers the two lower rungs: MCP servers for tools, and Genie for structured data.

    Where Databricks MCP and Genie sit in the exam

    The two objectives live in different sections, which is a hint in itself. “Integrate managed, external, and custom MCP servers based on a given application requirements” sits in Assembling and Deploying Apps. “Enable multi-agent systems to leverage Genie Spaces or conversational API to retrieve data” sits in Application Development. According to the official certification page, those sections weigh 22% and 30%, the two heaviest on the paper. The exam has 45 scored questions in 90 minutes and costs US$200.

    So you won’t see a dozen MCP questions. But the rent-or-build judgment shows up across design, development and deployment, and it is a cheap one to get right once you see the pattern.

    What an MCP server actually is

    MCP stands for Model Context Protocol, an open standard that gives an agent a set of tools it can discover and call through one uniform interface. An MCP server is simply a program that speaks that protocol. Instead of wiring each tool into the agent by hand, the agent points at a server and asks what tools are available.

    Here is the part people miss: MCP is the transport, not a new kind of tool. A Unity Catalog function reached over MCP is still a Unity Catalog function, still governed by EXECUTE. A retriever reached over MCP is still the retriever you built for RAG on Databricks. MCP changes how the agent reaches the tool, not what the tool is or who is allowed to run it.

    Managed, external, custom: three rungs, not three flavors

    The exam objective names three kinds of server. It is easy to read them as three equal options that differ only in where they run. They are not. They differ in how much you build and how much you agree to keep alive.

    Managed: nothing to host

    A managed server is run by Databricks. You don’t deploy it, patch it or scale it; you reference it in the agent’s configuration and move on. When a scenario says Databricks “provides a managed server” for a source, the work for that source is already done. Your job is to use it.

    One honest note on naming. When I checked the Databricks MCP docs in November 2026, the platform called these “Databricks-provided MCPs” (including Genie One, Databricks SQL, GitHub and Slack) and listed them under Unity Gateway. The exam guide still says “managed.” Same rung, newer label.

    External: rent the floor, hold the key

    An external server is hosted by someone else: a third-party service or a server your team runs outside Databricks. You can’t manage what you don’t own, so your only job is letting the agent in, which usually means holding a credential.

    That credential is where the trap lives. For the exam, the API key belongs in Databricks Secrets, fetched at run time. Never in the agent code, never in a notebook cell, never in a config file the next person will open.

    # External server: a third party hosts it, you only hold the key.
    # The key comes from Databricks Secrets at run time, never from code or config.
    search_key = dbutils.secrets.get(scope="research_agent", key="web_search_api_key")

    Past the exam, the docs now let you register an external server through the MCPs UI and manage credentials in Unity Gateway, so the platform can hold the secret for you. That is the same instinct carried one rung further. On exam day, the answer the guide wants is still “store the key in Databricks Secrets.” I wrote more about keeping credentials and permissions in their governed homes in Databricks GenAI guardrails and governance.

    Custom: build it only when the tool is truly yours

    A custom server is one you write and host yourself, on Databricks Apps. The docs describe it as the way to build custom tools or turn an HTTP REST API into MCP tools. It is real and supported, and sometimes it is exactly right: an internal API only your company has, business logic no provided server could know about, a legacy system with a shape only you can wrap.

    What it is not is a way to “unify” sources that already have servers. Every line of a custom server is a line you patch, scale and get paged about. If it exists only to re-expose what a managed server already serves, you bought all of that cost and none of the benefit.

    The MCP ambush: the unified custom wrapper

    This is the trap I’d bet on seeing in some form. A scenario lists a source Databricks already serves and a third-party API that needs a key. One answer proposes a single custom MCP server that wraps both “for a consistent interface” or “full control.” It reads like the senior engineer’s answer. It is the wrong one.

    How I sort these, in about ten seconds:

    • Source already served by Databricks: use the managed (Databricks-provided) server.
    • Third-party service that needs a key: use the external server, with the key in Databricks Secrets.
    • A tool that exists nowhere else: that is when a custom server on Databricks Apps earns its upkeep.
    • Any answer with a hard-coded key: wrong, even if the rest looks fine.
    • Any answer that caches everything in tables to “avoid” the servers: it quietly changes the requirement and gives you stale data.

    If an option’s main selling point is that it centralizes or unifies, check whether the thing it unifies was already handled by someone whose job it is to handle it.

    If you like learning these traps one at a time, in short daily sessions, that is how my free Databricks Generative AI Engineer Associate course is built: 30-60 minutes a day, one objective at a time, no dumps.

    Genie: the analyst, not the librarian

    Now the second objective. Picture an assistant with a vector index full of policy PDFs, support transcripts and help articles. Someone asks “how many refunds did we process last week?” The index does the only thing it knows: it finds passages that sound similar to the question and hands them to the model. The model reads a sentence about refunds taking five business days, a transcript where someone mentions a refund, and produces a confident number that nobody ever counted.

    A vector index retrieves by meaning. It cannot count, sum or look up a specific record. That is not a tuning problem; it is the wrong desk.

    I think of it as two desks. The librarian reads documents and answers “what does the policy say?” That is Databricks Vector Search (now branded AI Search). The analyst reads the ledger and answers “how many,” “which customer” and “where does this order stand.” On Databricks, that analyst is Genie.

    What Genie does

    Genie is a natural-language layer over governed Unity Catalog tables. You ask in plain English, it writes a read-only SQL query, runs it on a SQL warehouse, and returns the answer along with the SQL it wrote. The curated unit is a Genie Space on the exam. The current Genie Agents API docs say Genie Agents were formerly known as Genie Spaces, so if a screenshot says “Genie Agent,” it is the same thing.

    Genie is deliberately narrow: it works over structured data. Hand it a folder of contracts and it has nothing useful to say. That narrowness is a feature. A specialist that refuses the wrong questions keeps the right ones from being answered by guesswork.

    Calling Genie from a multi-agent system

    The objective says “multi-agent systems,” and that word matters. Genie rarely works alone. A coordinating agent (a supervisor) reads each question, decides whether it is an analyst question or a librarian question, and routes it. Genie is one member of that team.

    You reach it in one of two ways. Genie can sit behind a Databricks-provided MCP server, which is the lighter wiring. Or you call it through its conversation API, which gives you stateful conversations, so a follow-up like “and how many of those were over 500 dollars?” knows what “those” means. The docs describe these as Chat mode APIs with follow-up questions and history.

    from databricks.sdk import WorkspaceClient
    
    w = WorkspaceClient()
    
    # Curated in the UI first: a Genie Agent (formerly Genie Space) over governed tables.
    space_id = "<your-genie-space-id>"
    
    reply = w.genie.start_conversation_and_wait(
        space_id=space_id,
        content="How many support tickets were reopened last month?",
    )
    
    for att in reply.attachments or []:
        if att.query:
            print(att.query.query)    # the read-only SQL Genie wrote
        if att.text:
            print(att.text.content)   # the plain-English answer

    The heavy lifting is not the call. It is the curation: the docs recommend well-annotated tables with clear column comments, company-specific instructions, at least five tested example SQL queries and at least five benchmark questions. A badly curated space returns bad SQL even with a perfect integration.

    Why Genie’s numbers are safer

    The quiet reason the exam likes Genie is governance. The docs say Genie evaluates data access with the user’s own Unity Catalog permissions, so responses include only data that user can access. Row filters and column masks still apply, and activity shows up in audit logs. A number from Genie can be traced to the query and the tables that produced it. A number assembled from retrieved passages carries none of that.

    The Genie ambush: tuning the wrong tool

    A scenario says the assistant gives made-up figures for “how many” or “what was the total” questions. The options offer better chunking, a stronger embedding model, more documents, a reranker. All real techniques. All useless here, because no amount of better retrieval turns a similarity search into a COUNT. The fix is routing the question to Genie over the governed tables.

    The mirror image also shows up: a hand-built Unity Catalog function that runs one fixed SQL query, bolted on as a tool. It works until the question changes shape, and then you write another, and another. Genie turns any question over those tables into SQL, one rung up the ladder. Unless the scenario gives a reason to hand-code it, renting the specialist is the stronger answer.

    • Counts, totals, record lookups over tables: Genie.
    • “What does the document say”: the retriever.
    • Mixed questions in one assistant: a supervisor routing to both.
    • Wrong numbers from the document index: not a retrieval tuning problem.

    How the two objectives connect

    Put both on the ladder and the pattern is the same. At the bottom you write every tool and every query by hand. One rung up, a managed MCP server rents you a tool. Another rung, a Genie space rents you a whole capability: answering any question over a set of tables. At the top, an Agent Brick rents you a whole agent. What never changes is the agent’s loop underneath, and what never disappears is your responsibility for scoring it. That is the subject of Databricks agent evaluation vs monitoring, and serving it behind an endpoint is covered in Model Serving vs ai_query.

    FAQ

    What is the difference between managed, external and custom MCP servers on Databricks?

    Managed (now called Databricks-provided) servers are hosted by Databricks for sources it already serves. External servers are hosted by a third party or your own team outside Databricks, and you supply the credential. Custom servers are ones you build and host on Databricks Apps, for tools that exist nowhere else.

    Where should the API key for an external MCP server go?

    For the exam, in Databricks Secrets, read at run time. Never hard-coded in the agent code or configuration. In current Databricks, Unity Gateway can also manage credentials for registered servers.

    When should a question go to Genie instead of vector search?

    When the answer is a count, a total or a specific record in a table. Questions about what a document says go to the retriever.

    Is a Genie Space the same as a Genie Agent?

    Yes. Databricks renamed Genie Spaces to Genie Agents. The exam guide still uses “Genie Spaces.”

    Does Genie respect Unity Catalog permissions?

    Yes. Genie runs queries with the asking user’s own Unity Catalog permissions, so each user only gets data they are allowed to see.

    Learn the rest of the exam the same way

    MCP and Genie are small objectives with clean traps: the unified custom wrapper, the hard-coded key, and the document index asked to count. Learn to spot those three and you have this corner of the exam.

    If you want every objective broken down like this, with the traps called out and short daily sessions instead of a cram weekend, take my free Databricks Generative AI Engineer Associate course. It is built for 30-60 minutes a day, and it never uses exam dumps.

  • Databricks Agent Evaluation vs Monitoring: Judges, Ground Truth, AI Gateway

    Databricks Agent Evaluation vs Monitoring: Judges, Ground Truth, AI Gateway

    Two candidate assistants sit on the same dashboard. Both answer the sample questions. Both look fluent. Finance wants one number by Thursday, and \”looks good\” is not a number anyone will sign. That is the moment Databricks agent evaluation stops being a nice-to-have and becomes the skill the Generative AI Engineer Associate actually tests: turning an impression into a measured judgment, then keeping that judgment alive after the agent ships.

    In my book I call the instruments a Judgment Stack. Cheap counts sit at the bottom. LLM judges sit above them. Custom scorers encode your own definition of good. Calibrated humans sit on top. Evaluation is the half you run before release. Monitoring is the half you run on live traffic. Same scorers, different population, and the exam loves to blur them.

    If you are mapping the full exam first, start with my Databricks Generative AI Engineer Associate study guide. This post zooms into judges, ground truth, tracing, and AI Gateway.

    Where Evaluation and Monitoring sits in the exam

    According to the official certification page, Evaluation and Monitoring is 12% of the exam. Application Development is 30%, Assembling and Deploying Apps is 22%, Design Applications and Data Preparation are 14% each, and Governance is 8%. The exam has 45 scored questions in 90 minutes, and the fee is US$200. Check the official exam page before you book, because those details can change.

    Twelve percent looks small until you notice how many objectives sit under it, and how often the same ideas show up when you choose a model or compare lifecycle phases in Application Development. You do not need dumps for this section. You need to recognize which instrument answers which question.

    Why \”looks good\” is not a metric

    A generative answer has no single correct string. BLEU, ROUGE, and exact match measure how much wording overlaps a reference you supply. That is useful when the task really does have one stable reference, like translation or summarization against an editor’s gold summary. For an open-ended support reply, overlap grades coincidence of phrasing, not faithfulness, relevance, or safety. A fluent wrong answer can score high. A correct answer worded differently can score low.

    So evaluation is not one number. It is a stack:

    • Deterministic metrics: cheap counts of what can be counted.
    • LLM judges: models that read an answer for groundedness, relevance, safety, or correctness.
    • Custom scorers: your own rules, in code or as a small judge with your rubric.
    • Human experts: the people who decide what good meant before any instrument went looking.

    Climb only as far as the question forces you. Finance did not ask for a Friday labeling party. They asked for a defensible choice between two models on quality, latency, and cost measured on your task. That is an experiment, not a leaderboard. I covered logging those runs under Unity Catalog in MLflow + Unity Catalog for GenAI.

    Tracing is the flight log, scoring is the grade

    MLflow tracing records what the agent did: tool calls, retrieved passages, model steps, final answer. A full Traces tab is invaluable for debugging. It is not evaluation. A traced hallucination and a traced correct answer look equally complete. Tracing captures. Scoring judges.

    On Databricks, the harness is mlflow.genai.evaluate. You hand it a dataset, a traced predict_fn, and a list of scorers. It runs the agent per row, then the scorers read each resulting trace and attach feedback. Agent-specific scorers can grade the path, not only the destination: whether the right tools were called, and whether the path was efficient. That matters because an agent can luck into a correct answer down a wasteful path.

    A compact shape looks like this:

    import mlflow
    from mlflow.genai.scorers import (
        RetrievalGroundedness,
        RelevanceToQuery,
        Safety,
    )
    
    # Each row is one test case. Add expectations only when a judge needs ground truth.
    # eval_dataset = [{"inputs": {"question": "..."}, "expectations": {"expected_facts": [...]}}, ...]
    
    result = mlflow.genai.evaluate(
        data=eval_dataset,
        predict_fn=support_agent,
        scorers=[
            RetrievalGroundedness(),
            RelevanceToQuery(),
            Safety(),
        ],
    )

    The same scorers you attach here are the ones you later register over production. Evaluation builds the grader. Monitoring gives it the live feed. For where serving endpoints fit the lifecycle, see Model Serving vs ai_query.

    Databricks agent evaluation: which judges need ground truth

    This is the flashcard the exam almost writes for you. Sort every built-in judge by one question: what does it compare the answer against?

    Two judges need a supplied correct answer, usually as expected_response or expected_facts on the evaluation row:

    • Correctness: is the answer right against the expected answer or facts?
    • RetrievalSufficiency: did retrieval bring back enough context to produce those expected facts?

    The rest grade against material already in the run and need no labeled answer key:

    • RetrievalGroundedness: are the claims supported by the retrieved context?
    • RelevanceToQuery: does the answer address the question?
    • Safety: is the text free of harmful content?
    • Guidelines: does the answer meet natural-language rules you wrote?
    • RetrievalRelevance and ToolCallEfficiency: also reference-free; ToolCallCorrectness needs expectations.

    Confirm the current list in the built-in LLM judges docs. Names and arguments can shift, but the ground-truth split is the skill.

    Two ambushes sit next to that split. Groundedness is not correctness. An answer can be perfectly supported by bad or incomplete sources and still be wrong. And there is no built-in \”PII judge\” that replaces prevention. Leaked personal data is a perimeter failure you stop with masking and guardrails, not a quality score you compute after the fact. I covered that perimeter in Databricks GenAI guardrails.

    Custom scorers and the human layer

    Built-in judges cover general notions of quality. They do not know your house rules: a required price disclaimer, a forbidden competitor name, a tone your brand insists on. Those belong in a custom scorer, either a deterministic Python check or a small LLM judge given your rubric, dropped into the same scorers list.

    When domain experts disagree on the same answers, do not average the scores, drop the disputed cases, or hand the whole job to a model. Divergent ratings mean the standard is still ambiguous. Write a shared rubric, calibrate the experts until they converge, and use their aligned labels as expectations. Those expectations are exactly the ground truth correctness and sufficiency were missing. On Databricks, labeling sessions and the Review App are how that feedback becomes an evaluation dataset rather than a noisy spreadsheet.

    This is the kind of judgment I drill in the free course, one short 30-60 minute session at a time, because it is about reading the requirement, not memorizing a feature list. If that helps you, the Generative AI Engineer Associate course is right there.

    Evaluation vs monitoring: the inputs stop being yours

    Databricks names the phases offline evaluation and production monitoring. Monitoring is described as running evaluation on sampled production traces. Same instruments. Different population.

    In evaluation you chose the inputs and attached expectations. In monitoring the inputs choose you. That is why a passing curated suite can coexist with a support queue that says quality slipped. Growing the eval set enrols more cases you thought of. It cannot enrol the case nobody imagined. Production is the only phase that can surface that failure.

    Not every scorer crosses. Production traces carry inputs and outputs, not expectations, so judges that need ground truth stay offline. Reference-free judges such as Safety, RelevanceToQuery, RetrievalGroundedness, Guidelines, and ToolCallEfficiency can run over live traffic. Correctness comes back out of band: sample interesting traces, label them, promote them into an evaluation dataset, then run Correctness offline. Monitoring is not a replacement for evaluation. It is the supply of cases evaluation could not invent.

    Production monitoring is currently in Beta. You register a scorer against the experiment your app traces into, then start it with a sampling rate. Critical safety checks often run at full coverage. Expensive judges usually sample a fraction, because every sampled trace is a judge call you pay for. Read the current production monitoring docs before you promise a coverage number.

    Inference tables, traces, and AI Gateway

    Deploying an agent typically switches on two parallel records. An inference table in Unity Catalog holds one row per request that crossed the endpoint: identifiers, timing, status, raw request and response. MLflow traces hold what happened inside: retriever spans, tool calls, model steps. Production quality monitoring reads the traces. The table is an audit record. Nothing scores it on your behalf.

    That \”and\” in \”inference tables and monitoring\” is a conjunction, not a pipeline. The table answers what was said. The trace answers why. If a past complaint cannot be reproduced, you locate the interaction in the table, then open the matching trace and read the retriever span. Relevance failing means retrieval missed. Relevance passing while groundedness fails means retrieval worked and generation went beyond the evidence. For the retrieval pieces the exam tests, see RAG on Databricks.

    Recording is automatic. Judging is not. Tables and traces can fill for months with zero quality scores if you never register a scorer. \”We have monitoring\” is only true once you can name the scorer that is running.

    AI Gateway is the control plane sitting in front of model traffic: usage tracking, rate limiting, and inference logging as one geometry rather than four separate projects. Databricks has been evolving per-endpoint AI Gateway and Unity AI Gateway side by side, with different schemas and preview labels, so read the current AI Gateway docs rather than trusting an old screenshot. A rate limit caps throughput per minute. It is not a monthly budget. A budget is denominated in money over a billing period. Confusing those two is a classic trap when spend is the complaint.

    The traps to rehearse

    These are the ambushes I would rehearse in a 30-60 minute session:

    • Looks good versus measured. Fluency is not a metric.
    • Trace versus score. A full Traces tab is capture, not a verdict.
    • Ground truth versus no ground truth. Correctness and sufficiency need a key; groundedness, relevance, and safety do not.
    • Groundedness versus correctness. Supported by sources is not the same as actually right.
    • Average versus calibrate. Divergent experts need a rubric, not a mean.
    • Evaluated versus monitored. A green curated suite is not evidence about wild traffic.
    • Recorded versus evaluated. Tables and traces without scorers are storage, not monitoring.
    • Rate limit versus budget. Per-minute throughput is not a spend ceiling.

    A quick way to practice: take any scenario, ask where the inputs came from and what the judge must compare against, then check that the option you like can actually run on that data. If it asks for expectations you do not have, or claims a curated suite proves production quality, that option is the trap.

    FAQ

    How much of the exam is Evaluation and Monitoring?

    The official certification page lists Evaluation and Monitoring at 12%. Related model-selection and lifecycle-comparison ideas also appear in Application Development, so the topic shows up more often than the weight alone suggests.

    Which judges require ground truth?

    Correctness and RetrievalSufficiency need expected answers or expected facts. ToolCallCorrectness also needs expectations. Groundedness, relevance, safety, guidelines, and ToolCallEfficiency do not. Always confirm against the current docs.

    Is enabling tracing the same as evaluating an agent?

    No. Tracing records what happened. Evaluation runs scorers over those traces through mlflow.genai.evaluate or production monitoring. Capture is the input. Judgment is the separate act.

    Can Correctness run on live production traffic?

    Not directly. Live traces have no expectations field. Sample production traces, label them, promote them into an evaluation dataset, then run Correctness offline.

    Judge it before you trust it, watch it after you ship it

    If you take one idea from this post, make it this: evaluation measures the inputs you chose, and monitoring measures the inputs that chose you. Climb the Judgment Stack only as far as the question demands, know which judges need a key, and register reference-free scorers over production so the failures nobody curated can still be seen. You do not need dumps for this. You need to recognize the trap when the exam sets it.

    If you want a structured path with short daily sessions built around these traps, my free Databricks Generative AI Engineer Associate course walks you through every section of the exam.

  • Databricks GenAI Guardrails and Governance: Why One Gate Is Never Enough

    Databricks GenAI Guardrails and Governance: Why One Gate Is Never Enough

    Picture a support assistant that answers a customer beautifully. Clear tone, right format, confident close. And somewhere in the middle of that lovely paragraph is another customer’s account history. Nothing crashed. Every component did its job. The team had added a guardrail, one, and trusted it to hold the whole line. That is the scenario I want you to carry into the exam, because Databricks GenAI guardrails questions are almost never about whether you know a safety feature exists. They are about whether you know that one feature is never enough.

    In my book I call this the Guardrail Perimeter. Safety is not a switch you flip on a finished app. It is a set of gates, each standing where a different failure can still be caught. Add the data side, which I call the Provenance Chain, and you have the whole Governance story the Generative AI Engineer Associate expects you to see.

    If you are mapping the full exam first, start with my Databricks Generative AI Engineer Associate study guide. This post zooms into guardrails, masking, licensing, and malicious input.

    Where guardrails and governance sit in the exam

    Here is the part that surprises people. According to the official certification page, Governance is only 8% of the exam, the smallest section. Application Development is 30%, the largest. The exam has 45 scored questions in 90 minutes, and the fee is US$200. Check the official exam page before you book, because those details can change.

    So why a whole post? Because guardrail ideas show up in both sections. Reading outputs for quality and safety, and implementing guardrails to prevent negative outcomes, live in Application Development. Protecting against malicious user input and using masking to meet a performance objective live in Governance. Data licensing and problematic source text belong to the data side. Safety is not one corner of the test. It is checked from the builder’s side and the governor’s side.

    That split is also how I want you to study it:

    • Data side: where your text came from, whether you are allowed to use it, and what you cleaned before embedding.
    • Runtime side: what the user sends, what reaches the model, what comes back, and what the platform enforces on every call.

    The data side: the Provenance Chain

    Every chunk your app cites should trace back through four links: table, document, source, license. Break one and you own the consequences. Break the source link and the model answers wrongly. Break the license link and it can answer in a way you are not allowed to.

    Licenses are permits for specific uses

    This is the trap I see picked most. A data license is not a yes or no on a dataset. It names uses, and three of them come apart: training, retrieval, and display. A RAG app retrieves and displays. So a source licensed only for training can still be violated by an app that quotes it back to users.

    When a scenario mentions licensing, ask one question: which use does this system actually make? Then check the license for that use, not some other one.

    Climb the mitigation ladder only as far as you must

    When a source is a problem, there is an order of escalation: exclude, filter, mask, re-source. The exam likes answers that solve the problem with the least damage. If the issue is a few phone numbers inside otherwise great support tickets, deleting the whole source is overkill and leaving it alone is exposure. Masking in place is the move.

    On Databricks, the SQL function ai_mask masks specified entity types in text using a model. It is documented in the ai_mask function reference. A simple shape looks like this:

    -- Mask personal data in place before it lands in the corpus
    SELECT
      ticket_id,
      ai_mask(ticket_text, array('person', 'email', 'phone')) AS ticket_text_masked
    FROM main.support.raw_tickets;

    Then land the cleaned corpus in a governed Delta table with a three-part Unity Catalog name and Change Data Feed on, so the index syncs correctly. I covered the sync side in Databricks Vector Search explained.

    Junk is a governance problem too

    Boilerplate and near-duplicates do not get ignored on your behalf. They get embedded, retrieved, and spend your context window. The fix lives at preparation time, not retrieval time. Raising top-k cannot un-embed garbage. If you want the prep details, my post on chunking strategies for Databricks RAG goes deeper.

    Databricks GenAI guardrails: the four-gate perimeter

    Now the runtime side. Picture four gates, each catching what the previous one let through:

    • Input gate: what the user sends.
    • Context gate: what reaches the model, including retrieved documents.
    • Output gate: what comes back before the user sees it.
    • Platform gate: policy enforced centrally on the endpoint, over every call.

    No single gate is trusted to hold alone. Almost every wrong answer in this area is a single control offered against a plural risk.

    Read outputs like an auditor first

    Before you can guard a failure, you have to see it. The exam objective here is qualitative: assess responses to identify issues like quality and safety. I read one pass per failure type:

    • Faithfulness: does it claim something the context does not support?
    • Relevance: did it drift off the question?
    • Safety: is anything harmful in there?
    • Sensitive data: did it leak personal information?
    • Plain quality: is it actually useful?

    The instinct to kill is “it reads well, so it is fine.” Fluency is a model’s constant output. A hallucination and a leak sound exactly as confident as a correct answer. Assess the failure, never the polish.

    One boundary the exam respects: identifying issues by reading is this objective. Turning that read into automatic, repeatable scores is evaluation, which is a different objective. If an answer jumps to a formal metric when the question asks you to identify issues, it skipped a step.

    The input gate and the attack surface

    A user’s message is not only a question. It is an attack surface. Keep three shapes distinct, because the exam swaps them:

    • Direct prompt injection: a malicious instruction in the user’s message that tries to override your instructions.
    • Jailbreak: talking the model past its own safety training, not your app rules.
    • Indirect injection: an instruction hidden inside a retrieved document, so it never passes through the input at all.

    Injection overrides the developer. A jailbreak overrides the model. Match the defense to the attack the scenario actually describes.

    And here is the honest part. An input filter raises an attack’s cost. It never removes it. Every filter has a bypass, and indirect injection skips the front door entirely. The defense against that one is control over what the agent can retrieve and touch. That is why I call a lone filter a locked front door on a house with open windows.

    Masking at the right station

    Personal data can be masked at three stations: at the source before storage, in the retrieved context, or at the output on its way out. Where you stamp decides two things at once: whether the data is protected, and whether the app still works.

    Read the objective wording carefully: masking as a guardrail to meet a performance objective. A privacy requirement almost always carries a working-app requirement with it. Redacting everything gives you a black-bar assistant that answers nothing. A typed placeholder, like a tag that says a name or an account number was here, keeps enough signal for the app to function. Mask where the data would escape, and keep what the app needs.

    This is the kind of judgment I drill in the free course, one short session at a time, because it is about reading the requirement, not memorizing a feature list. If that helps you, the Generative AI Engineer Associate course is right there.

    Implementing guardrails on Databricks

    The implementation objective is: implement LLM guardrails to prevent negative outcomes. Think of four techniques at four points.

    A hardened system prompt at the entrance

    Clear role, clear refusals, clear rules about what the assistant must not reveal. It is cheap and useful, and it is the easiest gate to talk around. I covered how prompts steer and constrain in Databricks prompt engineering for the GenAI exam.

    A safety model that screens content

    A separate classifier model that reads text for harm, on the way in or on the way out. In my book I use Llama Guard as the example, as of this writing. The point for the exam is the role: a model you call to judge content, not code you wrote.

    Validation in your own post-processing

    If your app is packaged as a custom MLflow pyfunc, the code after the LLM call is yours. This is the only gate made of your own logic, so it is the only one that can enforce an app-specific rule, like a required output schema or a check that every answer cites a source. If you want the packaging side, see MLflow + Unity Catalog for GenAI.

    The platform gate on the endpoint

    The AI Gateway on Databricks lets you configure policies on serving endpoints, including guardrails that act on requests and responses, so safety and personal-data rules apply centrally to every call instead of living in each app. Databricks has been renaming and reorganizing this area, so read the current AI Gateway docs rather than trusting old screenshots. For where endpoints fit, see Model Serving vs ai_query.

    Two of these are code you write, one is a model you call, and one is platform you configure. The skill is bolting the gate that stops a given outcome onto the point where that outcome is still catchable.

    The traps to rehearse

    These are the ambushes I would rehearse in a 30-60 minute session:

    • Fluent versus safe. Polish carries no safety information.
    • Assess versus evaluate. Reading to identify issues comes before automated metrics.
    • Filter versus fortress. One input filter is never the full defense.
    • Injection versus jailbreak. Developer rules versus the model’s own training.
    • Mask all versus mask right. The app still has to work.
    • One tool versus layered gates. Several distinct risks need several gates.
    • One license use for another. Licensed for training is not licensed for display.
    • Retrieval fix for a prep problem. Clean before you embed.

    A quick way to practice: take any scenario, list every distinct risk it names, and check that the answer you like covers each one at a gate where it can still be caught. If one risk is left uncovered, that answer is the trap.

    FAQ

    How much of the exam is Governance?

    The official certification page lists Governance at 8%, the smallest section. Guardrail ideas also appear in Application Development, which is 30%, so the topic matters more than the weight suggests.

    Is a strong system prompt enough to stop prompt injection?

    No. It helps, but every input defense has a bypass, and indirect injection arrives through retrieved content instead of the user’s message. You need layered gates plus control over what the agent can retrieve.

    Where should I mask personal data?

    Where it would otherwise escape: at the source, in the retrieved context, or at the output. Pick the station that protects the data while leaving enough signal, like typed placeholders, for the app to stay useful.

    What does ai_mask do?

    It is a Databricks SQL AI function that masks specified entity types in text using a model. Check the official function reference for current behavior and requirements.

    Guard it before you ship it

    If you take one idea from this post, make it this: safety is a perimeter, not a checkpoint. Trace your data back to a license that covers the use you make, mask at the station where data escapes, and stack gates so no single failure walks out the door. You do not need dumps for this. You need to recognize the trap when the exam sets it.

    The next step in the lifecycle is judging whether the guarded agent actually answers well, which is evaluation. Until then, if you want a structured path with short daily sessions built around these traps, my free Databricks Generative AI Engineer Associate course walks you through every section of the exam.

  • MLflow + Unity Catalog for GenAI: Register, Alias, Champion

    MLflow + Unity Catalog for GenAI: Register, Alias, Champion

    Here’s a pattern I keep seeing in GenAI prep. Someone finishes a RAG chain in a notebook, calls log_model, watches a green checkmark, and assumes production will somehow notice. A week later the serving endpoint is still answering with last month’s version, the fraud rate (or the support quality) has not moved, and nobody can point to an error, because from the platform’s point of view nothing broke. MLflow Unity Catalog Databricks GenAI work is not “save the model.” It is three separate moves: register under a three-part name, give the version a signature, and move an alias like @Champion onto the version you actually want live.

    This post is the lifecycle spine the Generative AI Engineer Associate expects you to see on sight. Register is not promote. An alias is not a stage. A two-part name is not Unity Catalog. Once those three lines are automatic, the rest of the GenAI deployment questions get quieter.

    If you’re mapping the whole exam, start with my Databricks Generative AI Engineer Associate study guide. This post zooms into the MLflow and Unity Catalog lines of it.

    Where MLflow and Unity Catalog sit in the exam

    The official exam guide puts model registration in the Assembling and Deploying Applications section: register the model to Unity Catalog using MLflow. That line looks small. In practice it is the hinge between a notebook that works and an artifact the rest of the platform can find, govern, and serve.

    It also shows up sideways everywhere else. When you log a RAG application on Databricks, Unity Catalog is where the registered chain lives. When you compare Model Serving vs ai_query, the endpoint still needs a version (or an alias) to host. When you pick up Agent Bricks later, the same three-part name and privilege cascade still apply. Treat this post as the shared vocabulary those topics lean on.

    The Platform Triangle: address, history, endpoint

    Every GenAI artifact you ship on Databricks has three identities at once. I call that the Platform Triangle, because almost every platform question on the exam reduces to which corner the scenario is standing on.

    • Unity Catalog is the address. Every table, model, index, function, and prompt has a three-part name: catalog.schema.object. Access cascades with the name: USE CATALOG, then USE SCHEMA, then the object privilege.
    • MLflow is the history. An experiment is the notebook of what you tried. A registered model is the manifest of what shipped. A version is one immutable build. An alias is the movable nameplate for the version in play.
    • Model Serving is the endpoint. That is the infrastructure that hosts the live call. Registering does not create the endpoint, and the endpoint does not invent a version on its own.

    When a ticket says “model not found,” drop into the Triangle before you open more logs. Wrong catalog name is an address problem. Unpromoted alias is a history problem. Misconfigured endpoint is a serving problem. Missing EXECUTE is Unity Catalog again, in its permission mode. One corner can fail in more than one way, which is why “which corner?” is the first question, not the last.

    Unity Catalog naming: three parts or the wrong shelf

    A pull request that registers a model under ml_models.churn_predictor can look clean. It runs. The model appears. The tests are green. And it still registered to the wrong place.

    Unity Catalog addresses every artifact with three parts: catalog, schema, object. Two parts is the shape older Hive metastore names used. Hand a UC operation only two parts and it often does not error. It quietly resolves against the legacy metastore (or against whatever default catalog the session happens to hold), while the rest of the pipeline keeps looking in the governed catalog. The model exists. It is just sitting at an address nobody else is reading.

    The exam loves this tell. When a scenario is clearly about Unity Catalog and an answer registers or reads with schema.object, train your eye to count the dots. Three parts is UC. Two parts is the old world, and on a UC question it is almost always the trap.

    Permissions mirror the address. To reach a registered model you need USE CATALOG on the catalog, USE SCHEMA on the schema, and then the object privilege. For a model that privilege is EXECUTE, because Unity Catalog governs a registered model as a kind of function: you invoke it, you do not SELECT it the way you read a table. Registering a new version is a different verb again (CREATE MODEL VERSION). “I granted them access to the model and it still fails” is usually a missing door higher up the cascade, not a missing grant on the model itself.

    One more property earns the ceremony. A Unity Catalog metastore is shared across workspaces in the region. Register the model once to the right three-part name, and a notebook in development and a job in production can point at the same artifact by the same string. That shared address is why later pieces (Vector Search / AI Search indexes, serving endpoints, agent tools) can find each other without copying files between workspaces.

    MLflow Unity Catalog Databricks GenAI: log, register, then promote

    This is the section most candidates blur, and it is the one the post title is really about.

    Start in an experiment. Every training run, every prompt tweak, every retrieval metric lands there as history in the raw. When you call log_model inside a run, you pin an artifact into that notebook beside the metrics that produced it. It is saved. It is findable. It is not yet something the rest of the company can ship. Logging files the model in your experiment. It does not put it on the shared shelf.

    Registering is the separate act that lifts a chosen model out of the experiment and onto a Unity Catalog entry. The registered model is a three-part name that says: this thing exists as a shippable product, and here are its versions. Every time you register to the same name, UC adds the next immutable version: 1, then 2, then 3. You never edit version 2. You register version 3. That immutability is what makes a rollback exact: pin production back to an old version and you know to the byte what you are getting.

    Then comes the nameplate. A stack of frozen versions raises the only question that matters in production: which one is live? Not the newest by default. Not a permanent stamp. Production follows an alias, a mutable pointer you pin to exactly one version. The Databricks docs use names like Champion for the version currently in production and often Challenger for one being trialed against it. Your serving or batch job loads models:/catalog.schema.model@Champion, and from then on it serves whatever version that alias points to.

    That indirection is the entire design. Registering version 4 does not move traffic. Promotion is moving the nameplate: take Champion off version 3 and pin it to version 4. Miss that line and the endpoint loyally keeps serving last month’s model, with no error to wake you up. Because the alias is mutable while the versions are immutable, the same move is how you roll back in seconds.

    Two setup details the exam checks explicitly, and the Models in Unity Catalog docs spell out both:

    • Point MLflow at Unity Catalog with registry URI databricks-uc (not bare databricks, which is the legacy workspace registry). On current runtimes and MLflow 3 this is often the default, but older notebooks that still call set_registry_uri("databricks") will quietly ship to the deprecated registry while every log line looks healthy.
    • Give the version a model signature. New model versions in Unity Catalog must carry one. An input example at log time is the usual way to infer it. Without a signature, UC registration is refused.

    Here is the shape of the happy path for a GenAI artifact:

    import mlflow
    from mlflow import MlflowClient
    
    mlflow.set_registry_uri("databricks-uc")
    
    # Log to the experiment (history), then register under a three-part UC name
    with mlflow.start_run():
        # ... train or assemble your GenAI chain ...
        mlflow.pyfunc.log_model(
            name="support_agent",
            python_model="agent.py",
            input_example={"messages": [{"role": "user", "content": "Where is my order?"}]},
            registered_model_name="main.genai.support_agent",
        )
    
    client = MlflowClient()
    # Promote by moving the nameplate, not by transitioning a stage
    client.set_registered_model_alias("main.genai.support_agent", "Champion", 2)

    And here is how a batch or notebook workload stays decoupled from version numbers:

    import mlflow.pyfunc
    
    # Workloads follow the alias, so a promotion needs no code change
    model_uri = "models:/main.genai.support_agent@Champion"
    champion = mlflow.pyfunc.load_model(model_uri)
    champion.predict({"messages": [{"role": "user", "content": "Where is my order?"}]})

    The stage trap (and why Champion replaced it)

    If you learned MLflow before Unity Catalog, your muscle memory reaches for stages: None, Staging, Production, Archived, and transition_model_version_stage. That mechanism is gone for models in Unity Catalog. UC has no stages. The docs say it plainly: stages are not supported; use the three-level namespace for environment and aliases for deployment status.

    So when a scenario asks how to promote a model to production and one answer transitions the version to the “Production” stage, that answer is describing a platform that no longer exists for UC models. The current move is set_registered_model_alias(..., "Champion", version). The vocabulary is the tell: “transition to Production” is the ambush; “point Champion at the new version” is the platform as it is now.

    Tags are not aliases

    One quiet mix-up: a tag like validation_status:approved is evidence left on a version. An alias is a routing pointer. Tags justify moving the alias. They never route traffic themselves. If an answer promotes a model by setting a tag and stopping, it solved the paperwork and skipped the nameplate.

    Registering a GenAI app, not only a classic ML model

    The same spine applies when the artifact is a RAG chain or an agent, not a scikit-learn classifier. A chain that answers in a notebook has still only passed the “runs” test. Deploying asks whether that chain rebuilds in a container, authenticates to the services it calls, and returns a valid shape with no human watching.

    For a retrieval application, think in a short bill of materials when you log:

    • Model flavor (how MLflow serializes and calls it: LangChain flavor or pyfunc for custom / agent envelopes).
    • Resources the chain reaches at serving time (embedding endpoint, Vector Search / AI Search index, other serving endpoints or UC functions), so the served model can authenticate to them.
    • Dependencies with full mlflow pinned (Runtime ML’s mlflow-skinny is not enough for a serving container).
    • Input example, which MLflow runs to infer the signature Unity Catalog requires.

    Miss the signature and registration fails. Leave a resource undeclared and registration can succeed while every live request fails auth. Pin the wrong embedding model relative to the index and nothing errors: retrieval just returns confident nonsense. Those failure modes are why the logging arguments are not paperwork. They are the demo’s invisible context written down so production can put it back.

    If you are still shaping the retrieval side, my posts on chunking strategy and Vector Search sizing traps cover the pieces that feed this registered artifact. Prompt contracts still sit underneath the chain; see Databricks prompt engineering for format, steer, and augment.

    And if you want this lifecycle walked as a guided build rather than a blog checklist, my free Generative AI Engineer Associate course is built around the same ambushes, in 30-60 minutes a day, with no dumps.

    How I’d study this in 30-60 minutes a day

    • Day 1: Draw the Platform Triangle once from memory: address, history, endpoint. Write one sentence for what fails in each corner.
    • Day 2: Open the Models in Unity Catalog docs and practice the three-part name, databricks-uc, signature, and set_registered_model_alias flow. Say out loud why log_model alone is not registration.
    • Day 3: Drill the traps by vocabulary: two-part name, Production stage, “newest version is live,” SELECT on a model, tag instead of alias.
    • Day 4: For a tiny RAG or agent stub, list the bill of materials and match each missing piece to its failure (registration refused, auth error, container build fail, silent bad retrieval).

    FAQ

    Does registering a model to Unity Catalog deploy it?

    No. Registration adds an immutable version to the shelf. Deployment traffic follows an alias (or an explicit version) that your serving or batch job loads. Move Champion to promote or roll back.

    What is the difference between Champion and Challenger?

    They are conventional alias names, not reserved platform stages. Champion usually marks the version in production. Challenger usually marks a candidate under evaluation. You choose the strings; the important part is that workloads load the alias, not a hard-coded version number.

    Why does Unity Catalog require a model signature?

    So every registered version declares the shape of its inputs and outputs. Without a signature, UC registration is refused. Logging an input example is the common way to infer one.

    Is the workspace Model Registry still valid on the exam?

    Treat the workspace registry as legacy. Databricks recommends Models in Unity Catalog, MLflow 3 defaults the registry URI to databricks-uc, and exam-style answers that register only to the workspace registry are the wrong era of the platform.

    Which privilege loads a registered model?

    EXECUTE on the model, plus USE CATALOG and USE SCHEMA on its parents. SELECT is the table verb. A model is governed like a function.

    Ready for the next step?

    If you can walk a GenAI artifact from experiment to catalog.schema.model to @Champion without confusing log, register, and promote, you have the lifecycle spine the exam keeps probing. Next in this series is guardrails and governance: what sits in front of the endpoint once the alias is live. My guide to passing without dumps explains how I study the whole map, and the free Databricks Generative AI Engineer Associate course is where I’d go to rehearse these traps before they show up in a quieter font on exam day.

  • Databricks Prompt Engineering for the GenAI Exam: Format, Steer, Augment

    Databricks Prompt Engineering for the GenAI Exam: Format, Steer, Augment

    Here’s a pattern I see a lot in people preparing for the Generative AI Engineer Associate. They’ve been writing prompts for ChatGPT for two years, so they skip the prompting topics and go straight to Vector Search and agents. Then the exam hands them a scenario where the model “usually” returns valid JSON, and four answers that all sound reasonable, and they pick the one that just asks more firmly. Databricks prompt engineering on this exam isn’t about clever phrasing. It’s about knowing when wording is enough and when it isn’t, and the exam is built to catch the people who never made that distinction.

    This post covers the three prompting skills the exam names directly: forcing a format, steering an output from a baseline, and augmenting a prompt with what the user actually typed. Each one comes with its own trap, and each trap is designed to be the answer you pick if you’re going on instinct.

    If you’re just getting started, my Databricks Generative AI Engineer Associate study guide has the full exam map. This post zooms into the prompting lines of it.

    Where prompt engineering sits in the exam guide

    The official exam guide lists three prompting objectives, spread over two sections:

    • Section 1, Design Applications (14%): “Design a prompt that elicits a specifically formatted response.”
    • Section 3, Application Development (30%): “Create a prompt that adjusts an LLM’s response from a baseline to a desired output.”
    • Section 3 again: “Augment a prompt with additional context from a user’s input based on key fields, terms, and intents.”

    Section 3 is the heaviest part of the exam, so two of these three land in the section that carries the most weight. And none of them asks you to recite a definition. They hand you a situation and ask for the right move. That’s why I treat this topic as a set of decisions, not a set of tricks.

    Databricks prompt engineering starts with one idea: a prompt is a contract

    Before the three skills, one shift in how you think about a prompt. A prompt isn’t a polite request you hope the model honors. It’s a specification the model executes, loosely, by predicting likely next tokens. Anything you leave vague is a blank the model fills with a default.

    A prompt has a few parts, and each does one job:

    • The system message holds standing behavior: persona, tone, rules that must always apply.
    • The user message holds the actual ask for this turn.
    • Assistant turns can carry worked examples, an input paired with the exact output you want.
    • Inside those, you have the instruction, the context, the examples and the output spec.

    The exam won’t ask you to label these parts on their own. It uses them as the reason one answer is right. A classic tell: a rule that must hold on every turn is being repeated inside every user message. The cleaner fix is to put it in the system message once.

    Think of the rest of this post as a short ladder on top of that anatomy: format, then behavior, then context. You climb only as far as the task forces you.

    Skill 1: Forcing the format (ask vs. enforce)

    Picture an extractor whose output goes straight into an importer that reads one JSON record per document. If any record is malformed, the importer rejects the whole batch. In testing, the model returns clean JSON almost every time. Almost is the problem.

    The instinct is to strengthen the wording: “Return only valid JSON.” That helps. It makes JSON a more likely continuation. It does not make anything else impossible, and on the one odd input in a thousand, the model can still open with “Here’s the extracted data:” and break the parser.

    Asking well: prompt-craft for format

    Asking is still a real skill, and it’s what the objective’s wording points at. The moves that work best:

    • State the shape as an exclusion: “Return only a JSON object, no prose, no markdown fences.”
    • Show the shape: put the exact fields and types, or a filled example, in the prompt. Models copy a visible pattern more reliably than they follow a description.
    • Add one or two example turns (few-shot) with the exact output you want.
    • Fence the input with delimiters so the model can tell your instructions from the material.

    All four narrow the odds. None of them closes the door.

    Enforcing: structured outputs with response_format

    Enforcement is a different kind of move. On Databricks, chat models served through Foundation Model APIs support structured outputs through a response_format field on the request. It comes in two strengths: json_object when any valid JSON will do, and json_schema when a consumer needs specific fields. Here’s a small routing example with a strict schema:

    response = client.chat.completions.create(
        model="databricks-gpt-oss-20b",
        messages=messages,
        response_format={
            "type": "json_schema",
            "json_schema": {
                "name": "ticket_route",
                "schema": {
                    "type": "object",
                    "properties": {
                        "order_id": {"type": "string"},
                        "category": {"type": "string"},
                        "priority": {"type": "string"},
                    },
                    "required": ["order_id", "category", "priority"],
                },
                "strict": True,
            },
        },
    )

    With a strict schema, you’re not asking the model to match the shape. You’re constraining what it can return. The Databricks docs list the edges worth knowing: only a subset of JSON Schema is supported (no regex pattern, no anyOf, oneOf, allOf or $ref), there’s a limit of 64 keys, heavily nested schemas generate worse, and the extra work to keep the model on-schema costs tokens on every call. Some model families have their own rules too (Claude models, for example, only accept json_schema, not json_object), so check the limitations for the model you’re using. Flat and small is the schema that holds.

    The format trap

    The ambush looks like this: an output feeds a parser, an API or a database import, and two answers sit side by side. One adds a firmer instruction to return JSON. The other constrains the reply with a schema. The firmer instruction is the trap. It’s not wrong the way nonsense is wrong; it genuinely improves things and it passes a demo. But when the requirement is “every response must parse,” only enforcement answers the question that was asked.

    Two other distractors show up around format. Temperature 0 makes output repeatable, but a reply wrapped in a sentence will be wrapped the same way every time. And raising max_tokens fixes truncation, not shape. My rule: read the stem for who consumes the output. If a person reads it, better wording may be enough. If code reads it, enforce the shape.

    Skill 2: Steering from a baseline

    The second objective is about the output that parses fine and is still not what you wanted. Too long. Too casual. Wrong persona. The trap here isn’t a technique, it’s a habit: rewriting the whole prompt every time something is off, and breaking the parts that already worked.

    The method is two steps:

    • Name the gap. Not “it’s bad,” but “it’s three paragraphs and should be three sentences, and the tone is casual where it should be formal.”
    • Change the smallest thing that closes that gap, and nothing else, so you know what helped.

    The ladder: zero-shot, few-shot, chain-of-thought

    The tools sit in order of cost, and that order is worth memorizing:

    • Zero-shot instruction. State the constraint in words: “In three sentences or fewer, in a formal tone.” Most length, tone and persona gaps close right here.
    • Few-shot examples. When words don’t land a style, show one or two finished answers in that style. They cost tokens on every call, so they earn their place only after an instruction has failed.
    • Chain-of-thought. Ask the model to reason step by step before answering. It’s for one kind of gap: wrong answers on multi-step reasoning. It does nothing for tone or length, and it adds tokens and latency.

    Climb only as far as the gap forces. Persona belongs in the system message, not repeated in every user turn. And if the output isn’t wrong so much as different every run, that’s temperature, a randomness knob, not a quality knob. Lowering it while you iterate makes it easier to tell whether a change did anything.

    On Databricks, the natural place for this loop is the AI Playground, where you can try prompts against models side by side. The discipline that matters there is changing one variable at a time.

    The steering trap

    A scenario shows an output that’s close, with one specific thing off, and offers a small targeted fix next to something bigger: rewrite the prompt from scratch, switch to a larger model, turn on chain-of-thought, fine-tune. The bigger move is the ambush, because it looks like it’s taking the problem more seriously. It isn’t. A larger model writes just as long if nothing told it otherwise. Pick the smallest change that matches the named gap, and distrust the answer that does the most.

    Skill 3: Augmenting with the user’s input

    The third objective is the one people misread most. “Augment a prompt with additional context from a user’s input” sounds like “include the user’s message.” It means the opposite: extract what matters from it.

    Picture a customer writing ninety words about a return: the order number, a wrong size, a crushed box, years of loyalty, and, near the end, “I do NOT want another pair, I just want my money back.” The model needs three things from that: the order, the problem and the request. Pasting the whole paragraph in buries them in noise, pays for that noise on every call, and leaves stray phrases (like “another pair”) that a careless model might act on.

    Fields, terms, intent

    The objective names three things to pull, and they fail differently:

    • Fields are concrete values: order number, date, amount, destination.
    • Terms are domain words that route the request: “refund” versus “exchange,” “cancel” versus “reschedule.”
    • Intent is what the user actually wants. It’s often stated once, in passing, sometimes as a negation. Miss it and you process a tidy version of the wrong request.

    Extract first, then assemble

    The cleanest pattern is two calls. The first has one narrow job: read the raw message and return the fields, terms and intent as JSON, enforced with the same response_format from Skill 1. The second call does the real work from a template filled with those values:

    TEMPLATE = """Order: {order_id}
    Problem: {problem}
    Customer wants: {intent}
    
    Write a short, formal reply that confirms the next step."""
    
    prompt = TEMPLATE.format(**extracted)  # extracted = the JSON object from call one

    A nice side effect: the extracted object is something you can log, test and check, which you can’t do with a decision the model makes silently inside one big call.

    This is also the bridge to RAG. Filling a template slot with the user’s extracted context is the same move retrieval makes, just with fetched documents in the slot instead. If you’ve read my RAG on Databricks post, that’s the same assembly with a search step in front. And it marks a limit: extraction can only pull out what the user actually said. If the order number was never in the message, no prompt will conjure it. That needs a real data source.

    The augmentation trap

    Users type long, messy messages, and the question asks how to build a prompt that acts on them. “Include the full message and tell the model to use the relevant parts” sounds thorough. It’s the trap. So are “use a bigger model” and “raise the context window”: none of them adds structure. The answer extracts the specific fields, terms and intent into a template. The skill being tested is knowing what to leave out.

    How I’d study this in 30-60 minutes a day

    This is one of the cheapest topics on the exam to lock down, which is why skipping it hurts. Here’s how I’d spend a few short sessions:

    • Day 1: Learn the anatomy and the ask-versus-enforce line. Open the structured outputs docs and read the limitations list once.
    • Day 2: In the AI Playground, take one prompt with a length or tone problem and fix it with one change at a time. Notice how often a single instruction is enough.
    • Day 3: Take three messy messages of your own and write down the fields, terms and intent for each. Then sketch the template they fill.
    • Day 4: Practice spotting the three traps in scenario wording: “feeds another system,” “close but one thing off,” “long, unstructured user messages.”

    If you’d like that practice in a guided format, my free Generative AI Engineer Associate course walks through these scenarios one ambush at a time, with no dumps involved.

    FAQ

    Is prompt engineering a big part of the Databricks Generative AI Engineer Associate exam?

    Three objectives name prompts directly: one in Design Applications (14%) and two in Application Development (30%). Prompting also shows up indirectly in RAG, guardrails and agent questions, so it pays off well beyond those three lines.

    What’s the difference between json_object and json_schema in response_format?

    json_object guarantees valid JSON, but the model decides the fields. json_schema pins the reply to the fields and types you define. Use the schema when a specific consumer needs specific fields.

    Does temperature 0 guarantee the right format?

    No. Temperature 0 makes the output repeatable, not correct. A reply wrapped in an extra sentence will just be wrapped the same way every time. To guarantee shape, use structured outputs.

    When should I use chain-of-thought?

    When the model gets multi-step reasoning wrong by jumping to a conclusion. For tone, length or format gaps, a direct instruction or one example is cheaper and actually targets the problem.

    Should I pass the whole user message into the prompt?

    Usually not. Extract the fields, terms and intent that matter and fill them into a template. That’s what the exam means by augmenting a prompt with the user’s input.

    Ready for the next step?

    Prompting is the cheapest lever you have: no retrieval, no fine-tuning, just a contract the model can’t misread. Once these three moves feel automatic, the rest of the exam gets easier, because RAG, guardrails and agents all build on them. My guide to passing without dumps explains how I approach the whole exam, and the free Databricks Generative AI Engineer Associate course is where I’d go next. It’s built around the same idea as this post: learn the traps before they learn you, in 30-60 minutes a day.