What you will be able to do
- Explain how prompts, versions, aliases and tags relate in the MLflow Prompt Registry
- Load a prompt in deployed agent code by alias instead of a hard-coded version
- Promote a prompt from dev to staging to production, and roll it back, by reassigning aliases
Key concept
Prompt alias — An alias is a named, movable pointer (such as dev, staging or production) to one prompt version, and the version it points to never changes. To promote or roll back a prompt you move the pointer. You don't redeploy the agent.
1.Prompts as versioned Unity Catalog assets
In a CI/CD pipeline every artifact you promote needs a version and an owner. For agent prompts, Databricks provides the MLflow Prompt Registry (currently in Beta). It is a central store for prompt templates that works much like Git: you get versioning, commit messages and the ability to roll back. Governance comes from Unity Catalog, so a prompt is a named object inside a catalog and schema, such as workspace.default.summarization_prompt. To view or create prompts you need a Unity Catalog schema on which you hold CREATE FUNCTION, EXECUTE and MANAGE permissions.
The registry has four building blocks. A prompt is the named entity in Unity Catalog. A version is a snapshot that can't be changed, and version numbers count up automatically. An alias is a pointer you can move to any version. Tags are key-value pairs attached to a specific version. Each call to register_prompt() on an existing name adds a new version and leaves the earlier ones as they were. Templates use double-brace variables such as {{question}}.
Checkpoint 1 of 4· Match them up
Match each Prompt Registry concept to its description
Tap a term, then the definition that fits it.
Versions are fixed records. Aliases are the only part that moves, which is what makes them suitable for environment promotion.
“Versions: Immutable snapshots with auto-incrementing numbers”Source: docs.databricks.com
| Function | Purpose |
|---|---|
| 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 |
2.Loading prompts by alias in deployed code
Databricks tells you to configure a deployed agent so it loads prompts by alias rather than by a hard-coded version, because this lets you change the prompt without redeploying. Your code refers to a prompt with a URI of the form prompts:/{catalog}.{schema}.{prompt_name}@{alias}. For example, prompts:/workspace.default.summarization_prompt@production resolves to whatever version the production alias points to right now.
The recommended pattern also reads the alias and prompt name from environment variables. The same code can then run in dev, staging and production, and each environment only sets a different PROMPT_ALIAS.
class ProductionApp:
def __init__(self):
# Use environment variable for flexibility
self.prompt_alias = os.getenv("PROMPT_ALIAS", "production")
self.prompt_name = os.getenv("PROMPT_URI", "workspace.default.summarization_prompt")
def get_prompt(self) -> str:
"""Load prompt from registry using alias."""
uri = f"prompts:/{self.prompt_name}@{self.prompt_alias}"
prompt = mlflow.genai.load_prompt(uri)
return promptA common worry is that calling the registry adds a network round trip to every request. It does not, because the MLflow client caches the prompt template. There is one deployment exception. If the agent is deployed using Custom Agents, it can reach the registry only through manual authentication, which means overriding security environment variables. Doing so turns off automatic passthrough for the other resources the agent depends on, so plan their credentials explicitly.
Checkpoint 2 of 4· Check yourself
A reviewer objects that loading prompts with mlflow.genai.load_prompt() in a production agent will slow every request. What is the correct response?
The docs say the client caches the template. Loading by alias therefore keeps the flexibility of the registry without slowing requests.
“The MLflow client caches the prompt template, so the prompt registry doesn't introduce latency to your agent.”Source: docs.databricks.com
Sources2
3.Promoting and rolling back across environments
After the agent loads by alias, promotion is a metadata operation. During development you register each new prompt version and point a dev alias at it, so you can test the change before it reaches production. To promote, you read the version that the source environment's alias points to and set the target environment's alias to that same version. The prompt text itself is never copied. Staging and production end up pointing at the identical version that was tested.
import mlflow
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
)
print(f"Promoted {name} v{source.version} from {from_env} to {to_env}")Checkpoint 3 of 4· Fill the gap
Which function completes this sample, which points the production alias at version 1?
import mlflow
mlflow.genai. ? (
name=f"{uc_schema}.{prompt_name}",
alias="production",
version=1
)set_prompt_alias() creates or moves an alias. register_prompt() would add a new version instead of moving a pointer.
Source: docs.databricks.comRollback uses the same mechanism. Before moving production, record the version it currently points to under a second alias. If the new version misbehaves, point production back to that recorded version. The docs also show other alias schemes: feature-branch aliases (feature-{feature}) and regional aliases (production-us, production-eu).
# Rollback-ready aliases
def safe_production_update(name: str, new_version: int):
"""Update production with rollback capability."""
try:
# Save current production
current = mlflow.genai.load_prompt(f"prompts:/{name}@production")
mlflow.genai.set_prompt_alias(name, "production-previous", current.version)
except:
pass # No current production
# Update production
mlflow.genai.set_prompt_alias(name, "production", new_version)Checkpoint 4 of 4· Exam question
A nightly ETL job appends newly ingested documents to a Delta table that backs a Delta Sync Vector Search index. The team wants the index to reflect the new rows within minutes of the ETL job finishing, but does not want a streaming pipeline running continuously between batches. Which CI/CD configuration best satisfies this requirement?
Correct answer: A — Configure the index with Triggered sync mode and invoke a sync trigger via the REST API or SDK as the final step of the ETL pipeline
- A. Triggered sync mode only refreshes the index when explicitly told to, so calling the trigger API right after the ETL job completes gives near-immediate updates without running compute in between batches. This matches the requirement of fast updates without a continuously running pipeline.
- B. Continuous sync keeps a streaming pipeline running at all times to achieve seconds-level latency, but this incurs ongoing provisioned compute cost even when no new data has landed. The scenario explicitly wants to avoid a pipeline running continuously between batches.
- C. Direct Vector Access indexes do not automatically sync from a Delta table at all; the caller is responsible for writing vectors and metadata directly via the API or SDK. This option describes behavior that direct access indexes do not have.
- D. Recreating the index from scratch after every run performs a full resync of all historical data rather than just the new rows, which is far more expensive and slower than an incremental triggered sync. It also discards the existing index state unnecessarily.
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.Calling delete_prompt_alias() removes the prompt version the alias pointed to.Why is that wrong?
Deleting an alias removes only the pointer and keeps the version. Removing versions requires delete_prompt().
Covered in Prompts as versioned Unity Catalog assets
2.An agent deployed with Custom Agents can read the Prompt Registry with no extra setup, and its other resources keep automatic credential passthrough.Why is that wrong?
Custom Agents need manual authentication to reach the registry. Overriding the security environment variables for this turns off automatic passthrough for the agent's other resources.
Covered in Loading prompts by alias in deployed code
3.Promoting a prompt to production means registering its template again in a production location.Why is that wrong?
Promotion points the target environment's alias at the version already tested in the source environment, so nothing is re-registered.
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Version and track prompts with Git-like versioning, commit messages, and rollback capabilities”
↩︎ Prompts as versioned Unity Catalog assets“Aliases: Mutable pointers to specific versions”
↩︎ Key concept“Remove aliases (versions remain)”
↩︎ Exam trap 1“Versions: Immutable snapshots with auto-incrementing numbers”
↩︎ Checkpoint - 2.https://docs.databricks.com/aws/en/mlflow3/genai/prompt-version-mgmt/prompt-registry/use-prompts-in-deployed-appsOfficial docs
“A Unity Catalog schema with CREATE FUNCTION, EXECUTE, and MANAGE permissions is required to view or create prompts.”
↩︎ Prompts as versioned Unity Catalog assets“configure them to load prompts from the MLflow Prompt Registry using aliases rather than hard-coded versions.”
↩︎ Loading prompts by alias in deployed code“The recommended approach is to use environment variables to make your application flexible and avoid hardcoding prompt references.”
↩︎ Loading prompts by alias in deployed code“Use a development alias to test prompt changes before promoting to production:”
↩︎ Promoting and rolling back across environments“Overriding these security environment variables disables automatic passthrough for other resources your agent depends on.”
↩︎ Exam trap 2“Promote prompts between environments by reassigning aliases:”
↩︎ Exam trap 3“reassign the production alias to point to a newer version without changing or redeploying your application code.”
↩︎ Prediction“The MLflow client caches the prompt template, so the prompt registry doesn't introduce latency to your agent.”
↩︎ Checkpoint - 3.https://docs.databricks.com/aws/en/mlflow3/genai/prompt-version-mgmt/prompt-registry/track-prompts-app-versionsOfficial docs
“MLflow automatically tracks the relationship between the prompt version and the application version.”
↩︎ Promoting and rolling back across environments