Databricks GenAI Engineer Associate
Section 4 · 22%Assembling and Deploying Applications

Assemble and deploy

pyfunc chains, registering to Unity Catalog, Model Serving and Foundation Model APIs, Vector Search set-up, ai_query() batch jobs, memory stores, CI/CD, MCP servers, prompt versioning and user interfaces. The most Databricks-specific section.

PracticeS4 practice bank →

20 items, practice or timed exam mode.

Teaching cards10 cards

One-liner, how it works, must-know facts, traps and a quick check for each.

Walk the guide, line by line

This section tests how a working prototype becomes a registered, served, governed application. The biggest way people lose marks is mixing up the layers: what is logged with the model, what is granted to the endpoint, and what is configured on the search index. Each row is one line of the official guide. Read across: plain words, what a question looks like, the answer, and the trap.

Guide lineIn plain wordsA question looks likeThe answerThe trap
4.1 Code a chain using a pyfunc model with pre- and post-processingA pyfunc model is MLflow's generic Python model wrapper. You write a class whose predict method runs your chain, so you can add steps before the model call (pre-processing) and after it (post-processing).A chain must clean the user text before the model call and format the reply as a short JSON object afterward, and be served as one unit.Write a class based on mlflow.pyfunc.PythonModel. The predict method is required and holds cleaning, the chain call and formatting. load_context loads extra files once at startup, and predict_stream supports streaming. Log it with MLflow so it can be registered and served.Doing the cleaning in the client application means every client must repeat it and the served model behaves differently from the tested one.
4.2 Control access to resources from model serving endpointsA served agent calls other resources (a model endpoint, a search index, a function). You decide whose permissions it uses and declare which resources it needs.A deployed agent must read a search index and call a model endpoint, and the platform team wants least privilege.Declare the resources when logging the model, using resource classes such as DatabricksServingEndpoint, DatabricksVectorSearchIndex and DatabricksFunction. Databricks then provisions short-lived credentials for the endpoint's service principal limited to those resources. For per-user data access, use on-behalf-of-user authentication instead.Embedding a personal access token in the code works, but ties access to one person and bypasses managed credentials.
Runner-up wins when: On-behalf-of-user wins when each user must see only the data they are entitled to.
4.3 Code a simple chain according to requirementsA simple chain is a short sequence of a prompt, a model call and a parser, built to match requirements such as the input and the output shape.A requirement says: take a customer question, add a store policy snippet, call a chat model, and return plain text.Build the chain in that order: a prompt template with a slot for the policy snippet, the chat model (ChatDatabricks), and a string output parser. Keep to the listed steps; extra parts the requirement did not ask for add risk.Adding an agent loop or a retriever the requirement did not mention is over-building.
4.4 Choose the basic elements needed to create a RAG application: model flavor, embedding model, retriever, dependencies, input examples, model signatureTo package a retrieval app you need to choose and record: the model flavor (how MLflow saves it), the embedding model, the retriever, its Python dependencies, example inputs and the model signature that describes inputs and outputs.A team logs a retrieval chain and gets an error on registration, because the model has no declared input and output format.Add a signature, since new model versions in Unity Catalog must have one. Provide an input example, which lets MLflow infer it. List pip requirements so the serving environment can rebuild, and declare the retriever's index as a resource.Skipping the signature to 'move faster' fails at registration in Unity Catalog.
4.5 Register the model to Unity Catalog using MLflowRegistering saves the logged model as a versioned asset in Unity Catalog, where it can be governed and promoted between environments.A team wants a development, staging and production path for a chain and asks how to mark which version is live.Register with mlflow.set_registry_uri('databricks-uc') and a three-level name (catalog.schema.model). Stages are not supported for models in Unity Catalog; use aliases such as a Champion alias, and use separate catalogs or names per environment.Moving a version to a 'Production' stage is the legacy workspace registry pattern and is not available here.
4.6 Create and query a Vector Search indexA search index stores embeddings so that text can be found by meaning. The guide calls the product Vector Search; current docs call it AI Search. You create an endpoint to host it and then an index on a source table.A team has a Delta table of chunks and wants to create an index and query it with a filter.Create a search endpoint, then a Delta Sync index on the table, and query it by text or vector. Filters on a standard endpoint are a dictionary, for example {"title": ["Ares", "Athena"]}; on a storage-optimized endpoint they are a SQL-like string such as "language = 'en'".Using the dictionary filter style on a storage-optimized endpoint fails because the syntax differs by endpoint type.
4.7 Identify how to serve an LLM application that leverages Foundation Model APIsFoundation Model APIs host open and partner models for you. You serve an application that uses them by calling a Databricks-hosted endpoint instead of running your own GPU.A prototype with low, uneven traffic needs a hosted chat model with no infrastructure to manage.Call a pay-per-token Foundation Model API endpoint, which is the easiest start. Provisioned throughput is recommended for production with steady or high traffic, because it reserves capacity and gives predictable latency. A priority tier exists for latency-sensitive pay-per-token use at higher cost.Provisioning dedicated capacity for a small prototype pays for idle capacity.
Runner-up wins when: Provisioned throughput wins when traffic is steady and high, or latency guarantees are required.
4.8 Explain the key concepts and components of Mosaic AI Vector SearchThe key parts are: an endpoint (the compute that hosts the index), the index itself, a sync mode (how it follows the source), and an embedding model that is either managed by Databricks or supplied by you.A team has no embedding pipeline and wants the index to keep itself current as the table changes.Use a Delta Sync index with Databricks-computed embeddings: the index follows the table and generates vectors for you. Use self-managed embeddings when you already hold vectors; that choice cannot be switched later. Direct Vector Access means you update the index yourself through the API, on standard endpoints only.Direct Vector Access gives control but makes you responsible for every update.
Runner-up wins when: Direct Vector Access wins when updates arrive as events from an application, not as table changes.
4.9 Identify batch inference workloads and apply ai_query() appropriatelyai_query() is a SQL function that calls a model endpoint for each row. It suits batch jobs, such as scoring a whole table overnight.A retailer must summarize two million product reviews once a night from a table.Use ai_query in a SQL query or job against the table. It works on Databricks SQL and Databricks Runtime 15.4 LTS and above, and not on Classic SQL warehouses. Interactive per-user requests belong on a serving endpoint instead.Looping a REST call per row from a notebook is slower to build and harder to scale and retry.
Runner-up wins when: A real-time serving endpoint wins when users wait for each reply.
4.10 Configure vector search for a particular solution based on number of embeddings, update frequency, latency, and cost requirementsSearch settings should match the workload: how many vectors, how often they change, how fast queries must be, and what it costs.A team expects 600 million vectors at 768 dimensions, with updates nightly and relaxed latency.That is beyond what a standard endpoint holds (about 320 million vectors at 768 dimensions), so choose storage-optimized, which holds over a billion vectors and indexes faster. Queries add roughly 250 ms, and continuous sync is not supported, so a nightly triggered sync fits.Standard is the default choice and the only type for high queries per second, but the vector count here exceeds it.
Runner-up wins when: Standard wins when the count fits and the app needs high query throughput or low latency.
4.11 Configure a persistent datastore to store and retrieve intermediate memory or structured informationA persistent datastore holds memory or structured data between requests, such as a conversation history or a user profile, because the model itself keeps nothing.A support agent must remember earlier turns of a conversation across separate requests.Store the conversation state in a persistent store such as Lakebase, a Databricks-managed Postgres database, keyed by a conversation id, and load it at the start of each request. Declare it as a resource (DatabricksLakebase) so the endpoint may use it.Keeping memory in a Python variable inside the endpoint loses it when the replica restarts or another replica serves the next request.
4.12 Apply CI/CD best practices such as updating a Vector Search index, promoting prompts across environments, and testing individual components of an agentCI/CD means automated testing and promotion. For an agent, that covers refreshing the index, moving prompts between environments, and testing each component on its own.A team wants every merge to test the retriever and the prompt separately, then promote what passes to production.Test components individually, such as a unit test on the retriever and a scorer run on the prompt, then deploy the same code across environments with bundles. Promote prompts by registry alias, and refresh the index with a job that syncs after the source table updates.Only testing the whole agent end to end hides which part broke.
4.13 Integrate managed, external, and custom MCP servers based on a given application requirementsMCP, the Model Context Protocol, is a standard way to expose tools to agents. Databricks offers managed servers, lets you register external ones, and lets you host your own custom server.An agent needs to query a Genie space and also call a partner SaaS tool exposed over MCP.Use a managed MCP endpoint for the Databricks side (Genie, search, SQL, Unity Catalog functions) and register the partner server as an external MCP server through a Unity Catalog connection. Managed MCP endpoints are Public Preview and an admin must enable them. Host a custom server on Apps when no managed or external option exists.Writing a custom server for something already offered as managed duplicates work you must then maintain.
Runner-up wins when: A custom MCP server wins when you need tool logic that no managed or external server provides.
4.14 Apply prompt version control and manage prompt lifecyclePrompt version control stores each prompt edit as a numbered version, with aliases pointing to the live one, so changes can be reviewed and rolled back.A prompt change made the agent worse in production, and the team wants to return to the earlier text fast.Keep prompts in the MLflow Prompt Registry, which is Beta and needs mlflow[databricks]>=3.1.0. Point a production alias at a version; to roll back, repoint the alias, with no code change.Prompts hard-coded as strings in source mean a rollback needs a code release.
4.15 Develop an appropriate interactive user facing interface for an agent usage scenario (Apps, Slack, Teams, etc.)Users need a front end for the agent. Databricks Apps hosts a web app next to your data, and chat tools such as Slack and Microsoft Teams reach people where they already work.A sales team wants to talk to an agent inside the chat tool they already use all day.Connect the agent to Teams or Slack, since the best interface is the one users already have open. Choose Databricks Apps when you need a custom web interface, such as a review screen, hosted under workspace governance.Building a new web app for a team that lives in chat adds a place they must remember to visit.

Mind map: Which layer holds the setting

People assume one place configures everything, but the model package, the endpoint and the index each hold different settings.

What you observeWhat it points toWhat to do (and when the runner-up wins)
Registration fails, no format declaredModel signature missingAdd a signature or input example. Nothing on the endpoint can fix it.
Agent cannot reach an index it needsResource not declared with the modelDeclare resources at logging. If each user needs their own access, on-behalf-of-user wins.
Index too large for the endpoint typeEndpoint type choiceStorage-optimized for huge counts. For high queries per second and a count that fits, standard wins.
Nightly job over a whole tableBatch workloadUse ai_query. If a user waits for each reply, use a serving endpoint.
Need to roll back a promptVersion and aliasRepoint the alias. Hard-coded prompts need a release.

Mind map: Choosing the model endpoint type

People assume provisioned capacity is always the production answer, but traffic shape decides.

What you observeWhat it points toWhat to do (and when the runner-up wins)
Prototype, low and uneven trafficPay-per-tokenUse it. Steady high traffic makes provisioned throughput win.
Latency-sensitive production, moderate loadPay-per-token priority tierUse it for no commitment. If load is steady and high, provisioned is cheaper.
Custom fine-tuned modelProvisioned throughputUse it, since the model is not in the shared pool.

ABuild, log and register the chain

4.1

Chains: a simple chain, and a pyfunc with pre- and post-processing

A simple chain is prompt, then model, then output parser. When you need your own code before and after the model call, wrap it in a custom mlflow.pyfunc.PythonModel.

If you know this from Azure/Claude: Same idea as a Claude tool-use loop with your own code around the call. The Databricks part: you package the whole thing as an MLflow model, log it from code, and serve it.

How it works

  1. Simple chain (LangChain): prompt | ChatDatabricks(endpoint=...) | StrOutputParser()
  2. Custom logic: subclass mlflow.pyfunc.PythonModel; predict cleans the input, calls the LLM, then shapes the output
  3. Log it from code: mlflow.pyfunc.log_model(python_model="agent.py", ...), with mlflow.models.set_model(...) at the end of the file
  4. Test before serving with mlflow.models.predict(...) or mlflow.pyfunc.load_model(...)

Must know

  • predict is required; load_context loads extra context once; predict_stream streams.
  • Models from code saves a script instead of a pickled object, so it avoids pickle and Python-version problems. MLflow recommends it for GenAI agents and chains.
  • Packages you can't pip install go in code_paths.
  • For new agents Databricks recommends MLflow ResponsesAgent; MLflow infers a compatible signature for it.

Traps

  • Pickling a LangChain chain or a client object is the classic failure; log from code instead.
  • Pre- and post-processing belongs inside predict, not in the serving endpoint's settings.

Quick check: s4-q01 · s4-q02 · Source: mlflow: ml/model/python_model/ · mlflow: ml/model/models-from-code/

4.2

The parts of a RAG application you log

To serve a RAG chain you need a model flavor, an embedding model, a retriever, dependencies, an input example and a signature.

If you know this from Azure/Claude: The RAG pieces are the ones you know from Azure AI Search and Claude. What's new is that MLflow packages them, and Unity Catalog refuses a version without a signature.

How it works

  1. Pick the flavor: pyfunc (custom or ResponsesAgent) or a framework flavor such as langchain
  2. Retriever: a Vector Search index, often exposed as VectorSearchRetrieverTool (from databricks_langchain or databricks_openai)
  3. Embedding model: the endpoint the index uses (managed embeddings) or one you call yourself (self-managed)
  4. Log with input_example (or type hints) so MLflow infers the signature, plus pip_requirements and the resources the chain calls

Must know

  • New model versions in Unity Catalog must have a signature.
  • An input_example lets MLflow infer the signature (MLflow 2.5+) and checks that predict works.
  • Declaring resources (index, LLM endpoint, UC functions) is what lets the served chain authenticate to them automatically.
  • Query text and the index must use the same embedding model.

Traps

  • A model logged with no signature and no input example can't be registered to Unity Catalog.
  • Don't put the vector index inside the model artifacts; the chain queries the index at run time.

Quick check: s4-m1 · s4-q02 · Source: docs: machine-learning/manage-model-lifecycle/ · docs: generative-ai/agent-framework/unstructured-retrieval-tools

4.3

Register to Unity Catalog with MLflow

Models live in Unity Catalog as catalog.schema.model. You promote them with aliases. Stages don't exist there.

If you know this from Azure/Claude: Like Foundry model versions, but governed by Unity Catalog grants. If you know the old workspace registry, unlearn Staging and Production stages.

How it works

  1. mlflow.set_registry_uri("databricks-uc") (the default on DBR 13.3 LTS+ or MLflow 3 when the default catalog is in UC)
  2. log_model(..., registered_model_name="prod.support.rag_bot") or mlflow.register_model(...)
  3. client.set_registered_model_alias("prod.support.rag_bot", "champion", 3)
  4. Load with models:/prod.support.rag_bot@champion; move the alias to promote or roll back

Must know

  • "Stages are not supported for models in Unity Catalog." Use aliases, and the three-level name for environments.
  • Create a model: USE CATALOG, USE SCHEMA and CREATE MODEL on the schema.
  • Load by alias or version: EXECUTE on the model plus USE CATALOG and USE SCHEMA.
  • Batch jobs that load @champion pick up the new version on their next run.

Traps

  • transition_model_version_stage is an answer from the old workspace registry; it's wrong for Unity Catalog.
  • A two-level name means you're still pointing at the workspace registry.

Quick check: s4-q03 · s4-m3 · s4-o1 · Source: docs: machine-learning/manage-model-lifecycle/

BVector Search

4.4

Vector Search: endpoints, indexes and sync

An endpoint is the compute; an index lives on an endpoint and is built from a Delta table (Delta Sync) or written to directly (Direct Vector Access).

If you know this from Azure/Claude: Same job as an Azure AI Search index. The Databricks part: indexes sync from Delta tables in Unity Catalog, and you choose between two endpoint types. Name change: the docs now say AI Search (formerly Vector Search); the exam guide still says Vector Search.

How it works

  1. Create an endpoint: endpoint_type="STANDARD" or "STORAGE_OPTIMIZED"
  2. Choose an index type: Delta Sync with Databricks-computed embeddings, Delta Sync with self-managed embeddings, or Direct Vector Access
  3. Delta Sync: choose pipeline_type TRIGGERED (sync when you call it) or CONTINUOUS
  4. Standard endpoints need Change Data Feed on the source table (tables with row tracking have it automatically)

Must know

  • Standard: about 320 million vectors at 768 dimensions; the only type that supports high QPS.
  • Storage-optimized: over 1 billion vectors, 10 to 20 times faster indexing, about 250 ms more query latency, and lower cost at large scale.
  • Storage-optimized endpoints don't support continuous sync, and the embedding dimension must be divisible by 16.
  • Direct Vector Access: you write vectors yourself with upsert; about 2 million vectors at 768 dimensions on a standard endpoint.
  • Requires a Unity Catalog workspace with serverless compute; up to 50 indexes per endpoint.
NeedChoose
Hundreds of millions to billions of vectors, cost first, a few hundred ms is fineStorage-optimized endpoint, triggered sync
High QPS, lowest latency, near real-time freshnessStandard endpoint, continuous sync
Vectors come from your own pipeline, not a Delta tableDirect Vector Access index, upsert

Traps

  • Continuous sync together with storage-optimized is an impossible combination.
  • A self-managed-embeddings index can't be converted to Databricks-managed embeddings later.

Quick check: s4-q05 · s4-q07 · s4-m2 · Source: docs: vector-search/vector-search

4.5

Create, query and keep an index fresh

Query with similarity_search: text or a vector in, top-k rows out, with optional filters, hybrid keyword search and reranking.

If you know this from Azure/Claude: Hybrid search plus a reranker is the same pattern as Azure AI Search's hybrid query plus semantic ranker. The Databricks part is the SDK calls and filter syntax.

How it works

  1. index = client.get_index(index_name="cat.sch.idx")
  2. index.similarity_search(query_text=..., columns=[...], num_results=5)
  3. Add query_type="hybrid" for vector plus keyword (combined with Reciprocal Rank Fusion), and a filters argument
  4. Triggered index: call index.sync() after the source table changes

Must know

  • Filters on a standard endpoint are a dictionary: {"title": ["Ares", "Athena"]}; on storage-optimized they're a SQL-like string: "language = 'en'".
  • Hybrid search returns at most 200 results; ANN up to 10,000.
  • Reranking: reranker=DatabricksReranker(columns_to_rerank=[...]).
  • Agent tool form: VectorSearchRetrieverTool(index_name=..., num_results=..., filters=..., query_type="HYBRID").
  • Client naming changed with the rename: newer docs use AISearchClient (package databricks-ai-search); older code uses VectorSearchClient. Index methods are the same.
client.create_delta_sync_index(
    endpoint_name="kb-endpoint",
    source_table_name="prod.support.kb_chunks",
    index_name="prod.support.kb_index",
    pipeline_type="TRIGGERED",
    primary_key="chunk_id",
    embedding_source_column="text",
    embedding_model_endpoint_name="databricks-gte-large-en")

index.similarity_search(query_text="reset router", columns=["chunk_id", "text"],
    num_results=5, query_type="hybrid", filters={"product": ["router"]})

Traps

  • A dictionary filter sent to a storage-optimized endpoint is the wrong syntax.
  • Full-text-only search is Beta; don't treat it as GA.

Quick check: s4-c1 · s4-m4 · Source: docs: vector-search/create-vector-search · docs: vector-search/query-vector-search

CServe, connect and ship

4.6

Serving an LLM app on Foundation Model APIs

Foundation Model APIs give you hosted LLMs and embedding models. Your agent calls them, and agents.deploy() puts the agent on a Model Serving endpoint.

If you know this from Azure/Claude: Pay-per-token versus provisioned throughput is the same trade-off as Azure's Standard versus provisioned (PTU) deployments.

How it works

  1. Prototype on pay-per-token (OpenAI-compatible; reach it from AI Gateway in the sidebar)
  2. Move to provisioned throughput for production throughput, performance guarantees, fine-tuned models or compliance (for example HIPAA)
  3. Register the agent in Unity Catalog, then from databricks import agents; agents.deploy(uc_name, version)
  4. Redeploy with the same UC model name to add a version to the same endpoint with no downtime

Must know

  • Pay-per-token has a priority service tier for latency-sensitive production (costs more, no commitment).
  • Provisioned throughput has on-demand and reserved (1- or 3-month) options, and serves fine-tuned or custom weights registered in UC.
  • agents.deploy() creates the endpoint, short-lived credentials for declared resources, MLflow tracing, a Review App, AI Gateway inference tables and production monitoring (beta).
  • scale_to_zero_enabled=True cuts idle cost but slows the first request.
  • External models are reached through their own serving endpoint (an external model endpoint).

Traps

  • Fine-tuned weights can't run on pay-per-token; they need provisioned throughput.
  • Newer docs recommend the Agent Bricks CLI and Agent Runtime (Databricks Apps compute) for brand-new agents; the exam guide's objectives describe Model Serving.

Quick check: s4-q08 · s4-o1 · Source: docs: machine-learning/foundation-model-apis/ · docs: generative-ai/agent-framework/deploy-agent

4.7

Batch inference with ai_query()

When the job is "run an LLM over every row of a table", use ai_query() in SQL or PySpark, not a loop of REST calls.

If you know this from Azure/Claude: New for you: Azure's nearest equivalent is the Batch API. Here the batch is a SQL query over a Delta table.

How it works

  1. SELECT ai_query('endpoint', CONCAT('Classify: ', body)) FROM tickets
  2. Send the whole dataset in one query; AI Functions handle parallelism, retries and scaling
  3. Set failOnError => false for big jobs; the result becomes a struct with response and errorMessage
  4. Use responseFormat for structured output from chat models, and modelParameters for settings like temperature

Must know

  • Works on Databricks SQL and Databricks Runtime (15.4 LTS+); not on SQL Classic warehouses.
  • The query's definer needs CAN QUERY on the endpoint.
  • Databricks recommends task-specific AI Functions first (for example ai_classify), then ai_query when they don't fit.
  • Some Databricks-hosted models are optimised for batch; real-time pay-per-token models aren't recommended for large batch production.

Traps

  • Calling the endpoint row by row from a Python loop or pandas UDF is the slow, fragile answer.
  • With the default failOnError => true, one bad row fails the whole query.

Quick check: s4-q09 · Source: docs: large-language-models/ai-query · docs: sql/language-manual/functions/ai_query

4.8

Who can call what: endpoint access and front ends

A served agent reaches its tools with credentials Databricks issues for the resources you declared, with the user's own identity (on-behalf-of), or with secrets you supply.

If you know this from Azure/Claude: Like Azure managed identity plus RBAC: no keys in code. The Databricks part is declaring resources at log time and the three serving-endpoint permission levels.

How it works

  1. Automatic authentication passthrough: declare resources in log_model(resources=[...]); Databricks creates a service principal with read access and short-lived OAuth tokens
  2. On-behalf-of-user (Public Preview, admin enables it): WorkspaceClient(credentials_strategy=ModelServingUserCredentials()), created inside predict
  3. Manual: put keys in Databricks secrets and pass {{secrets/<scope>/<key>}} as environment variables to deploy()
  4. Endpoint permissions: CAN VIEW, CAN QUERY, CAN MANAGE

Must know

  • Resource classes include DatabricksServingEndpoint, DatabricksVectorSearchIndex, DatabricksFunction, DatabricksGenieSpace, DatabricksSQLWarehouse, DatabricksTable, DatabricksUCConnection and DatabricksLakebase.
  • On-behalf-of-user declares scopes with UserAuthPolicy(api_scopes=[...]); the user is only known at query time, so don't create that client in __init__.
  • Front ends: a Databricks App signs users in with their workspace identity and keeps tokens on the server; the Genie apps for Slack and Microsoft Teams let people chat with Genie in channels.
  • Overriding security environment variables turns off automatic passthrough for the agent's other resources.

Traps

  • Passthrough uses the agent's service principal, so every user sees the same data. Per-user row filters need on-behalf-of-user.
  • A PAT in browser JavaScript or in the agent's code is always wrong.

Quick check: s4-q10 · s4-q11 · s4-m5 · s4-q15 · Source: docs: generative-ai/agent-framework/agent-authentication-model-serving · docs: generative-ai/agent-framework/agent-authentication · docs: security/auth/access-control/ · docs: integrations/msft-teams

4.9

Tools and memory: MCP servers and Lakebase

Give an agent tools through managed MCP servers (Databricks hosts them), external MCP servers (registered through a Unity Catalog connection) or custom ones (built on Databricks Apps). Give it memory with stores backed by Lakebase.

If you know this from Azure/Claude: MCP is the protocol you know from Claude. The Databricks part: managed servers sit behind Unity Catalog permissions, and memory is a managed Postgres-backed store, not your own database.

How it works

  1. Managed: point the agent at a URL such as /api/2.0/mcp/functions/{catalog}/{schema}/{function} or /api/2.0/mcp/genie/{space_id}
  2. External: register the server in the MCPs UI on an HTTP Unity Catalog connection; users need USE CONNECTION
  3. Custom: build your own tools, or turn a REST API into MCP tools, with Databricks Apps templates
  4. Memory: sessions hold one conversation's state; memory holds facts recalled in later conversations; both are managed stores backed by Lakebase

Must know

  • Managed workspace MCP endpoints (Genie, AI Search, Databricks SQL, UC functions) are Public Preview, and an admin must enable them.
  • Managed endpoints use the permissions on the underlying table, index, function or Genie space.
  • Registering an external MCP needs CREATE SERVICE on the schema plus a connection (CREATE CONNECTION or USE CONNECTION).
  • Sessions and memory are separate stores: deleting a session doesn't delete its memories. The older UC-governed managed memory is legacy.

Traps

  • Building a custom MCP server for something a managed server already exposes (UC functions, Genie) adds maintenance for nothing.
  • Session state doesn't carry over to a new conversation; cross-conversation recall needs the memory store.

Quick check: s4-q13 · s4-q14 · Source: docs: generative-ai/mcp/ · docs: generative-ai/mcp/managed-mcp · docs: ai-gateway/register-mcp-service · docs: generative-ai/agent-framework/stateful-agents

4.10

Prompt registry and CI/CD

Version prompts in the MLflow Prompt Registry (stored in Unity Catalog), point environments at aliases, and test each agent part before you promote it.

If you know this from Azure/Claude: Same release discipline you'd use for Azure prompt flows or Claude system prompts in Git. The Databricks part: prompts are Unity Catalog objects with immutable versions and movable aliases.

How it works

  1. mlflow.genai.register_prompt(name="cat.sch.support_prompt", template="... {{question}} ...") makes a new immutable version
  2. mlflow.genai.set_prompt_alias(...) moves staging or production; the app loads prompts:/cat.sch.support_prompt@production
  3. Pipeline: unit-test tools and the retriever, evaluate in staging, then move aliases (model and prompt) for production
  4. Index refresh step: after the source Delta table is updated, call index.sync() on a triggered index

Must know

  • The Prompt Registry on Databricks is Beta (needs mlflow[databricks]>=3.1.0).
  • Template variables use double braces {{question}}; prompt.format(question=...) fills them; to_single_brace_format() converts for LangChain.
  • Prompt permissions: CREATE FUNCTION, EXECUTE and MANAGE on the schema.
  • Databricks LLMOps guidance: separate dev, staging and prod environments; you often promote the pipeline (prompts, chains, agents), not a model.
  • Bundles (Databricks Asset Bundles, now called Declarative Automation Bundles in the docs) define jobs, endpoints and indexes as code; deploy with databricks bundle deploy -t prod.

Traps

  • Hard-coding a prompt version number in the app means every prompt change needs a code release.
  • Rebuilding the index from scratch on every deployment wastes time; sync it.

Quick check: s4-q12 · s4-m4 · Source: docs: mlflow3/genai/prompt-version-mgmt/prompt-registry/ · docs: machine-learning/mlops/llmops · docs: dev-tools/bundles/resources