CertSafari
    Databricks Certified Generative AI Engineer Associate· Lessons

    Domain 4 · Lesson 41/56

    MLflow Prompt Registry: Prompt Versioning, Aliases and Lifecycle

    Apply prompt version control and manage prompt lifecycle

    16 min read
    1.79% of exam
    4 sources
    Published 3 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Explain the Prompt Registry model of prompts, versions, aliases and tags, and the Unity Catalog privileges it requires
    • Register a prompt and create new versions with commit messages and tags, using double-brace template variables
    • Load a prompt by version number or alias, search for prompts in a schema, and convert prompts for LangChain or LlamaIndex
    • Promote a prompt between environments by reassigning aliases, so deployed apps pick up the change without being redeployed
    • Link prompt versions to application versions with set_active_model() for lineage

    Key concept

    Immutable version, mutable alias — Each time you register a prompt you get a numbered snapshot that can never change. An alias such as "production" is a named pointer that you can move from one version to another. Applications load prompts through the alias, so you change what they run by moving the pointer. You never edit the prompt text in place.

    1.The Prompt Registry's Git-like model

    Prompts written as string literals inside application code are hard to track. You can't easily see which wording is running in production, you can't roll back without a code release, and a domain expert can't make a change without an engineer. The MLflow Prompt Registry fixes this. It is a central store for prompt templates that versions every change, lets you reference prompts by name, and lets non-engineers edit prompts through the UI. Because the registry is integrated with Unity Catalog, access control and audit trails come from the same governance layer as your tables and models. The feature is currently in Beta, and workspace admins enable it from the Previews page.

    The four building blocks of the Prompt Registry
    ConceptWhat it isCan it change?
    PromptA named entity in Unity CatalogThe name stays fixed; new versions are added under it
    VersionAn immutable snapshot with an auto-incrementing numberNo. Every edit creates a new version
    AliasA mutable pointer to a specific version, such as production or stagingYes. You can reassign it to another version at any time
    TagA version-specific key-value pairSet per version, for metadata such as author or use case

    Every prompt is stored in a Unity Catalog schema, so its full name has three parts, such as main.default.summarization_prompt. Prompt names can contain only letters, numbers, hyphens, underscores and dots. To use the SDK you install mlflow[databricks]. The overview page asks for version 3.1.0 or later, and the create-and-edit guide asks for 3.14.0 or later. To avoid typing the schema every time, you can tag an MLflow experiment with mlflow.promptRegistryLocation set to catalog.schema. SDKs and tools then infer the schema for that experiment automatically.

    Checkpoint 1 of 8· Check yourself

    Which statement about prompt versions and aliases in the MLflow Prompt Registry is correct?

    Sources12

    2.Registering prompts and creating new versions

    A single function, mlflow.genai.register_prompt(), creates a prompt and also adds every later version. The first call with a new name creates version 1. Each later call with the same name creates the next version. commit_message and tags are optional, but they act as your change log: the commit message records why a version exists, and tags such as author or use_case let you filter later. Template variables use double braces, for example {{content}}, and you fill them in at runtime with prompt.format(...). In the UI, you open your experiment's Prompts tab, choose a target schema and select a prompt type. Text is a single template, and Chat is a list of role-based messages.

    The two prompt template formats
    FormatPython typeDescription
    Simple promptstrSingle-message prompt template, e.g. "Hello {{name}}, how can I help you today?"
    ConversationList[dict]Each dict is one message with 'role' and 'content' keys

    Suppose you want better instructions in an existing prompt. Versions are immutable, so you can't open version 1 and edit it. You call register_prompt() again under the existing name with the new template, and MLflow stores it as version 2. Version 1 stays unchanged, which is what makes rollback possible.

    Creating version 2 by registering under an existing prompt name, with a commit message and tagspython
    # Register a new version
    updated_prompt = mlflow.genai.register_prompt(
        name=f"{uc_schema}.{prompt_name}",
        template=new_template,
        commit_message="Added detailed instructions for better output quality",
        tags={
            "author": "data-science-team@company.com",
            "improvement": "Added specific guidelines for summary quality"
        }
    )

    The UI follows the same rule. You edit a prompt from the Prompts tab and click Save, which creates a new version. The Compare button shows a text diff between two versions' templates. A text diff can't tell you which version gives better answers, though. For that, the documentation says to evaluate both versions on the same dataset and judges, which is covered in a separate lesson on evaluation.

    Checkpoint 2 of 8· Check yourself

    A reviewer finds a typo in version 3 of main.default.summarization_prompt, which is already registered. What is the correct way to fix it?

    Checkpoint 3 of 8· Exam question

    In the MLflow Prompt Registry, what happens when `register_prompt()` is called again for a prompt name that already has existing versions?

    Sources2

    3.Loading, searching and using prompts in frameworks

    The registry API has six functions. Two of them, register_prompt() and set_prompt_alias(), you have already met. The others load, search and delete. Notice which delete function removes what, because the difference is easy to miss.

    The six Prompt Registry functions
    FunctionPurpose
    register_prompt()Create new prompts or add new versions
    load_prompt()Retrieve specific prompt versions or aliases
    search_prompts()Find prompts by name, tags, or metadata
    set_prompt_alias()Create or update alias pointers
    delete_prompt_alias()Remove aliases (versions remain)
    delete_prompt()Delete entire prompts or specific versions

    Checkpoint 4 of 8· Match them up

    Match each Prompt Registry function to its effect

    Tap a term, then the definition that fits it.

    load_prompt() accepts three forms. You can use a URI with a version number (prompts:/name/2), a plain name plus a version argument, or a URI with an alias (prompts:/name@production). The first two pin an exact version, which suits experiments and lineage tracking. The alias form is the one to use in deployed applications, as the next section explains.

    Two equivalent ways to load a specific versionpython
    # Load a specific version using URI syntax
    prompt = mlflow.genai.load_prompt(name_or_uri=f"prompts:/{uc_schema}.{prompt_name}/2")
    
    # Or load from specific version
    prompt = mlflow.genai.load_prompt(name_or_uri=f"{uc_schema}.{prompt_name}", version="2")

    With Unity Catalog, search_prompts() must be scoped to a schema. The documentation marks the filter "catalog = 'main' AND schema = 'default'" as the required format, and you can add max_results to limit how many results come back. To use a prompt with another framework, keep in mind that MLflow templates use double braces. LangChain and LlamaIndex expect single-brace, f-string-style templates. Call to_single_brace_format() on the loaded prompt and pass the result to the framework's template class.

    Loading a prompt by alias and converting it for LangChainpython
    # Load from registry
    mlflow_prompt = mlflow.genai.load_prompt("prompts:/mycatalog.myschema.chat@production")
    
    # Convert to LangChain format
    langchain_template = mlflow_prompt.to_single_brace_format()
    chat_prompt = ChatPromptTemplate.from_template(langchain_template)

    Sources21

    4.Deploying with aliases and promoting across environments

    For deployed agents, the guidance is to load prompts through aliases rather than hard-coded version numbers. The URI format is prompts:/{catalog}.{schema}.{prompt_name}@{alias}. The documentation also recommends reading the alias and the prompt name from environment variables, so the same code can run against dev, staging or production depending on its configuration. Loading from the registry at runtime doesn't slow the agent down, because the MLflow client caches the prompt template.

    Checkpoint 5 of 8· Fill the gap

    Which function gives the version 1 prompt the production alias?

    mlflow.genai. ? (
        name="docs.default.customer_support",
        alias="production",
        version=1
    )

    Aliases also give you a promotion workflow. During development, each iteration registers a new version and moves a dev alias to it, so testers always get the latest draft. To promote, you look up the version that the source alias points to and point the target alias at the same version. Promotion never copies or edits the prompt text. It only moves a pointer, so the version you promote is byte-for-byte the one you tested.

    Promoting a prompt from one environment alias to anotherpython
    def promote_prompt(name: str, from_env: str, to_env: str):
        """Promote prompt from one environment to another."""
    
        # Get current version in source environment
        source = mlflow.genai.load_prompt(f"prompts:/{name}@{from_env}")
    
        # Point target environment to same version
        mlflow.genai.set_prompt_alias(
            name=name,
            alias=to_env,
            version=source.version
        )

    Checkpoint 6 of 8· Put it in order

    Put the steps of promoting a prompt from dev to production in order, as promote_prompt() performs them

    1. 1.Read the version number from the loaded prompt (source.version)
    2. 2.Load the prompt through the source alias, e.g. prompts:/{name}@dev
    3. 3.Call set_prompt_alias() to point the production alias at that same version

    Checkpoint 7 of 8· Exam question

    A team wants to promote version 4 of the registered prompt `catalog.schema.support_agent` to serve production traffic, but they do not want to redeploy or modify the application code that already references the prompt by alias. What should they do?

    Sources3

    5.Tracking prompt versions alongside application versions

    Aliases tell you which prompt is live now. Lineage tells you which prompt version a given application version used in the past, which you need when you investigate a regression. MLflow records this link when you call mlflow.set_active_model(). That call creates a LoggedModel for the application version. The LoggedModel doesn't store your code. It is a metadata hub that points to external code, such as a Git commit, records configuration parameters logged with mlflow.log_model_params(), and tracks the registry prompts your app loads.

    Starting a new application version context before loading a promptpython
    # Set the new active model
    active_model_info_v2 = mlflow.set_active_model(name=new_logged_model_name)

    The order of the calls matters. The documentation's example notes that loading the prompt after calling set_active_model() is what lets MLflow link the prompt version to the LoggedModel automatically. Traces from a function decorated with @mlflow.trace are then linked to that LoggedModel, which is in turn linked to the prompt version. To see the linked prompt version, open the experiment and go to the Versions tab. When you register an improved prompt, you set a new active model, such as customer_support_agent-v2-improved-prompt, and load the new version, so each application version records exactly which prompt it ran.

    Checkpoint 8 of 8· Exam question

    An evaluation harness should always pull whatever prompt version has most recently been approved for production, without anyone needing to redeploy the harness each time a new version is approved. How should the harness reference the prompt?

    Sources4

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.You can edit an existing prompt version in place to fix its wording.Why is that wrong?

      Versions are immutable. Any change, whether made in the UI or through register_prompt() with the existing name, creates a new version, and the old version stays available for rollback.

      Covered in Registering prompts and creating new versions

    2. 2.delete_prompt_alias() removes the version that the alias points to.Why is that wrong?

      delete_prompt_alias() removes only the pointer, and every version remains. To remove versions or a whole prompt, you use delete_prompt().

      Covered in Loading, searching and using prompts in frameworks

    3. 3.Production agents should hard-code a version number, and moving to a new prompt requires redeploying the agent.Why is that wrong?

      Deployed agents should load prompts through an alias. Reassigning the alias changes the prompt the agent uses without any code change or redeployment.

      Covered in Deploying with aliases and promoting across environments

    4. 4.Loading prompts from the registry at runtime adds a network round trip to every agent request.Why is that wrong?

      The MLflow client caches prompt templates, so the registry doesn't add latency to the agent.

      Covered in Deploying with aliases and promoting across environments

    5. 5.Lineage is recorded whenever a prompt is loaded, no matter when set_active_model() is called.Why is that wrong?

      The prompt must be loaded after set_active_model() is called. That ordering is what links the prompt version to the LoggedModel automatically.

      Covered in Tracking prompt versions alongside application versions

    Practise it for real

    Take a prompt through its lifecycle: register it, point a dev alias at it, load it by alias, and promote it to production without changing any consuming code.

    1. 1.In a schema where you hold CREATE FUNCTION, EXECUTE and MANAGE, call mlflow.genai.register_prompt() with a name such as main.default.summarization_prompt, a template containing {{num_sentences}} and {{content}}, and a commit_message.

      Why: Registering under a new name creates the prompt entity and its first immutable version.

      You should see: prompt.version prints 1.

    2. 2.Call register_prompt() again with the same name and a revised template, then call set_prompt_alias() with alias="dev" and that new version number.

      Why: Edits become new versions, and the dev alias tracks the latest draft for testers.

      You should see: Version 2 exists, and the dev alias points to it. Version 1 is unchanged.

    3. 3.Load the prompt with mlflow.genai.load_prompt("prompts:/main.default.summarization_prompt@dev") and call .format(num_sentences=1, content="...").

      Why: Consumers reference the alias, not the version number.

      You should see: The formatted string uses the version 2 template.

    4. 4.Load the prompt through @dev, read its .version, and call set_prompt_alias() with alias="production" and that version, as promote_prompt() does. Then load through @production.

      Why: Promotion only moves a pointer, so production gets the exact version you tested.

      You should see: Loading through @production returns version 2. No new version was created.

    Stuck? Get a nudge

    If load_prompt fails on the alias URI, check that you used a single slash after prompts: and the @ separator, for example prompts:/catalog.schema.name@dev.

    Sources

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “Maintain governance through Unity Catalog integration for access control and audit trails”
      ↩︎ The Prompt Registry's Git-like model
      “Collaborate without code changes by allowing non-engineers to modify prompts through the UI”
      ↩︎ The Prompt Registry's Git-like model
      “For compatibility, MLflow supports converting prompts to single-brace format”
      ↩︎ Loading, searching and using prompts in frameworks
      “Aliases: Mutable pointers to specific versions”
      ↩︎ Key concept
      “Remove aliases (versions remain)”
      ↩︎ Exam trap 2
      “Versions: Immutable snapshots with auto-incrementing numbers”
      ↩︎ Checkpoint
      “Remove aliases (versions remain)”
      ↩︎ Checkpoint
    2. 2.
      “Prompt names can contain only letters, numbers, hyphens, underscores, and dots.”
      ↩︎ The Prompt Registry's Git-like model
      “This lets SDKs and tools infer your Unity Catalog prompt schema automatically.”
      ↩︎ The Prompt Registry's Git-like model
      “Create a new version by calling mlflow.genai.register_prompt() with an existing prompt name”
      ↩︎ Registering prompts and creating new versions
      “The Compare button shows a text diff between templates.”
      ↩︎ Registering prompts and creating new versions
      “To compare which version produces better outputs, run evaluations on both versions using the same dataset and judges”
      ↩︎ Registering prompts and creating new versions
      “REQUIRED format for Unity Catalog - specify catalog and schema”
      ↩︎ Loading, searching and using prompts in frameworks
      “Prompt versions are immutable after you create them. To edit a prompt, you must create a new version.”
      ↩︎ Exam trap 1
      “A Unity Catalog schema with CREATE FUNCTION, EXECUTE, and MANAGE permissions is required in order to view or create prompts.”
      ↩︎ Prediction
      “Prompt versions are immutable after you create them. To edit a prompt, you must create a new version.”
      ↩︎ Checkpoint
    3. 3.
      “The prompt URI format is: prompts:/{catalog}.{schema}.{prompt_name}@{alias}”
      ↩︎ Deploying with aliases and promoting across environments
      “The recommended approach is to use environment variables to make your application flexible and avoid hardcoding prompt references.”
      ↩︎ Deploying with aliases and promoting across environments
      “Use a development alias to test prompt changes before promoting to production:”
      ↩︎ Deploying with aliases and promoting across environments
      “using aliases rather than hard-coded versions. This approach enables dynamic updates without redeployment.”
      ↩︎ Exam trap 3
      “The MLflow client caches the prompt template, so the prompt registry doesn't introduce latency to your agent.”
      ↩︎ Exam trap 4
      “reassign the production alias to point to a newer version without changing or redeploying your application code.”
      ↩︎ Prediction
      “Promote prompts between environments by reassigning aliases:”
      ↩︎ Checkpoint
    4. 4.
      “When you use mlflow.set_active_model() with prompts from the registry, MLflow automatically creates lineage between your prompt versions and application versions.”
      ↩︎ Tracking prompt versions alongside application versions
      “This LoggedModel doesn't store your actual application code - instead, it acts as a central record that links to your external code”
      ↩︎ Tracking prompt versions alongside application versions
      “On the Experiment page, click the Versions tab. The prompt version appears in the table as shown.”
      ↩︎ Tracking prompt versions alongside application versions
      “Loading the prompt AFTER calling set_active_model() is what enables”
      ↩︎ Exam trap 5

    Ready to test yourself?

    Practise the 6 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.