Think first How do you wrap a model with pre- and post-processing code so it can be served?
Why it matters: Questions describe a model that needs extra code around it and ask how to package, log or test it.
A custom pyfunc model wraps any Python code, so input preprocessing and output post-processing travel with the model. You subclass PythonModel, log it with its dependencies and signature, test it offline, then register and serve it.
Reported, thanks
Step 2 of 8
Term
Meaning
pyfunc
MLflow's Python function flavor, which can deploy any piece of Python code or any Python model.
load_context
Holds anything loaded only once, so fewer artifacts load during predict.
predict
Holds all the logic that runs every time an input request is made.
Model signature
Required for logging models to Unity Catalog; adding one with an input example is recommended.
code_path
A log_model parameter that logs shared code modules for use by custom pyfunc models.
Reported, thanks
Step 3 of 8
Use pyfunc when a model needs code before or after it runs. Typical cases are preprocessing inputs before predict, or post-processing raw outputs for consumption. Custom logging with pyfunc also deploys arbitrary Python code alongside your model.
Reported, thanks
Step 4 of 8
Subclass mlflow.pyfunc.PythonModel and implement predict. Put one-time loading in load_context, so fewer artifacts load during predict and inference runs faster. predict holds all logic that runs on every request.
Example: A minimal custom pyfunc model whose predict method doubles its input.
class Model(mlflow.pyfunc.PythonModel):
def predict(self, context, model_input):
return model_input * 2
mlflow.pyfunc.PythonModel: the base class every custom pyfunc model subclasses
Exam trap Loading a model file inside predict repeats that work on every request. One-time loading belongs in load_context.
Reported, thanks
Step 5 of 8
Add dependencies explicitly for a custom pyfunc model. Native flavor models capture theirs automatically. On Databricks Runtime ML, pin an exact mlflow== version in pip_requirements, because Model Serving needs mlflow, not mlflow-skinny. Use code_path to log shared code modules.
Exam trap Leaving only mlflow-skinny in conda.yaml breaks serving. Model Serving cannot build the container image without full mlflow.
Reported, thanks
Step 6 of 8
Unity Catalog needs a model signature. Adding an input example is recommended too. Test offline with mlflow.models.predict; its default env_manager="virtualenv" rebuilds dependencies in an isolated environment. Use validate_serving_input to check the JSON input format.
Reported, thanks
Step 7 of 8
Register the logged model in Unity Catalog, the recommended registry. Keep model computation short on the endpoint. Requests time out if computation takes longer than 597 seconds.
Reported, thanks
Step 8 of 8
Use a custom pyfunc model when inputs need preprocessing or outputs need post-processing.
Load once in load_context; run per-request logic in predict.
On Databricks Runtime ML, pin an exact mlflow== version in pip_requirements.
A signature is required to log a model to Unity Catalog.
Think first Why should a team identity, not a person, own the identity behind a model serving endpoint?
Why it matters: Questions describe a new or failing serving endpoint and ask which identity, grant or permission fixes it.
Every serving endpoint records the identity that created it. That creator reaches Unity Catalog resources for the endpoint, so its grants and workspace membership decide whether the endpoint keeps working.
Reported, thanks
Step 2 of 11
Term
Meaning
Recorded creator
The identity saved when an endpoint is created; it accesses Unity Catalog for the endpoint and cannot be changed.
Service principal
The recommended endpoint creator: a long-lived identity owned by your team instead of a personal account.
Workspace-access entitlement
Needed, along with workspace membership, by both caller and creator to create or update an endpoint.
CAN MANAGE
The minimum endpoint permission needed to change who can use a serving endpoint.
CAN QUERY
An endpoint permission level you can grant to an individual user so they can query it.
Reported, thanks
Step 3 of 11
The creator identity is fixed when the endpoint is created. Databricks saves the calling identity as the creator, typically a service principal. That identity reaches Unity Catalog resources for the endpoint. You cannot swap it later, so choose it with care.
Exam trap You cannot reassign an endpoint to a new creator. If the creator loses its grants or leaves the workspace, you delete the endpoint and recreate it under a suitable service principal.
Reported, thanks
Step 4 of 11
Make a long-lived, team-owned service principal the creator. A personal account can be deactivated or removed from the workspace later. Once the creator is gone, updates to the endpoint fail with PERMISSION_DENIED.
Exam trap A caller with valid permissions cannot rescue the update. It still fails once the recorded creator has left the workspace.
Reported, thanks
Step 5 of 11
Caller and creator both need membership and workspace access. To create or update an endpoint, each must be a workspace member holding the workspace-access entitlement. On every update, Databricks checks the creator's membership and served entity grants again.
Reported, thanks
Step 6 of 11
The creator needs USE CATALOG, USE SCHEMA and EXECUTE. These grants on the catalog, the schema and the model are validated when you create or update the endpoint. If the model declares transitive function dependencies, the creator also needs EXECUTE on those upstream functions.
Reported, thanks
Step 7 of 11
Query-time grants are not validated upfront. An endpoint can be created without errors and still fail later. A missing query-time grant shows up as a runtime error once the endpoint serves traffic.
When missing creator grants come to light
Feature
Unity Catalog model grants
Query-time grants
When validated
At endpoint creation or update
Not validated upfront
Where a gap shows
While creating or updating the endpoint
As runtime errors while serving traffic
Exam trap A successful create does not prove every grant is in place. Grants needed only at query time are tested when requests arrive.
Reported, thanks
Step 8 of 11
A grant on a container flows down to its children. A privilege on a container object applies to all its current and future child objects. Reading a table still needs USE CATALOG and USE SCHEMA on its parents, not only SELECT.
Exam trap SELECT on a table alone is not enough to read it. Without USE CATALOG or USE SCHEMA on the parent objects, the read is denied.
Reported, thanks
Step 9 of 11
CAN MANAGE is needed to change endpoint permissions. With CAN MANAGE you can give others access. For example, you can grant a single user the CAN QUERY permission on the endpoint.
Reported, thanks
Step 10 of 11
Advanced configuration links the endpoint to other resources. Add an instance profile when the endpoint must reach AWS resources. Add environment variables to connect to other resources, or to log your feature lookup DataFrame to the inference table.
Reported, thanks
Step 11 of 11
The recorded creator reaches Unity Catalog for the endpoint and can never be changed.
Make a long-lived, team-owned service principal the creator, not a personal account.
Serving a Unity Catalog model needs USE CATALOG, USE SCHEMA and EXECUTE for the creator.
Query-time grants are not checked upfront, so gaps appear as runtime errors.
Think first How do you build, trace and package a simple chain so it meets its requirements?
Why it matters: Questions give a chain's requirements and ask which step, setting or code fits them.
A RAG chain takes a user query, retrieves relevant data and generates a grounded answer. You compose its steps in code, trace them with MLflow, and package the chain with load_context and predict.
Reported, thanks
Step 2 of 9
Term
Meaning
RAG chain
A chain that retrieves data for a user query and grounds its answer on that data.
Query understanding
Opening steps that analyze and transform the query to show intent and help retrieval.
Prompt augmentation
Joining the user's query and retrieved context in a template that tells the model how to use each.
Hybrid search
Semantic search first, then keyword search on that smaller set, with both scores combined to rank.
Reported, thanks
Step 3 of 9
Query in, relevant data retrieved, grounded answer out. Query understanding may come first to clarify intent. Prompt augmentation then joins the query and the context. Optional post-processing can apply business logic, add citations or refine the text with predefined rules.
Reported, thanks
Step 4 of 9
The pipe operator joins the steps into one chain. Calling mlflow.langchain.autolog() first enables MLflow Tracing for LangChain. Each chain call then logs nested traces to the active MLflow experiment.
Works: Turns on LangChain tracing, then builds a chain from a prompt, a model and an output parser.
prompt_template | llm: the pipe operator composes the steps into one chain
Fails: This turns LangChain auto tracing off globally instead of turning it on.
mlflow.langchain.autolog(disable=True)
Reported, thanks
Step 5 of 9
Serverless clusters do not turn on LangChain autologging for you. Call mlflow.langchain.autolog() explicitly there. For production deployments, use the mlflow-tracing package, which is optimized for production use.
Exam trap Do not assume tracing is on in serverless compute. Autologging stays off there until you call mlflow.langchain.autolog().
Reported, thanks
Step 6 of 9
Embed the query with the same model used for the chunks. How many chunks you retrieve, and how you combine them with the query, can strongly affect answer quality. Hybrid search runs semantic search first, then keyword search on that smaller set.
Exam trap Query rewriting is not a standalone change. It must go together with changes to the retrieval component.
Reported, thanks
Step 7 of 9
Different LLM steps can use different models. A chain with query understanding and generation steps can pick a model for each. An expensive general-purpose model may be overkill for a task like detecting a user's intent.
Exam trap One large model for every step is not required. Simpler tasks such as intent detection may not need it.
Reported, thanks
Step 8 of 9
A custom pyfunc model needs load_context and predict. Put anything loaded one time in load_context, which keeps predict fast. predict holds the logic that runs on every input request.
Exam trap Do not load artifacts inside predict. It runs on every request, so one-time loading belongs in load_context.
Reported, thanks
Step 9 of 9
Compose a simple chain with the pipe operator: prompt_template | llm | StrOutputParser().
Call mlflow.langchain.autolog() explicitly on serverless compute to trace LangChain.
Embed the retrieval query with the same model used to embed the chunks.
Load artifacts once in load_context; keep per-request logic in predict.
Think first Which pieces must you choose and package before a RAG application on Databricks can embed, retrieve and serve answers?
Why it matters: Questions describe a RAG build and ask which embedding model, index, endpoint or model packaging choice fits.
When you create a retriever index, you choose whether Databricks computes the embeddings or you supply them. A Delta Sync Index stays in sync with its source table. Your own models are packaged in the MLflow format so they can be served.
Reported, thanks
Step 2 of 9
Term
Meaning
Compute embeddings
The index option where Databricks creates embeddings from a text column, instead of Use existing embeddings.
Custom model
A Python model packaged in MLflow format and registered in Unity Catalog or the workspace model registry.
Model signature
The declared input and output schema of a logged model.
Input example
A sample input logged with the model alongside its signature.
Reported, thanks
Step 3 of 9
For production, use databricks-qwen3-embedding-0-6b. On standard endpoints, Databricks recommends that foundation model with a provisioned throughput serving endpoint. In LangChain, the DatabricksEmbeddings class with its endpoint parameter connects to a Foundation Model APIs embedding model.
Reported, thanks
Step 4 of 9
Turn off Scale to zero on embedding endpoints. A scaled-down endpoint can take a couple of minutes to warm up, so the first index query can time out. Use CPU endpoints only for small datasets and tests, and GPU endpoints for larger data.
Exam trap Keeping the default Scale to zero risks a timeout on the first index query, because a scaled-down endpoint can take a couple of minutes to warm up.
Reported, thanks
Step 5 of 9
model_endpoint_name_for_query splits ingest from queries. This optional parameter points queries at a second endpoint that hosts the same embedding model. Ingestion can then use a high-throughput endpoint while queries use a low-latency one.
Reported, thanks
Step 6 of 9
Delta Sync follows a table; Direct Vector Access is yours to write. Creating either index needs CREATE TABLE on the target schema. On standard endpoints, the source table of a Delta Sync Index must have a change data feed.
The two index types compared
Feature
Delta Sync Index
Direct Vector Access Index
Updates
Automatic and incremental from the source table
Written by you through the REST API or Python SDK
Where vectors come from
Synced from its source table as the data changes
Vectors and metadata you read and write directly
Exam trap You cannot create a Direct Vector Access Index from the UI; it needs the REST API or Python SDK.
Reported, thanks
Step 7 of 9
Store precomputed vectors as array[float]. You choose between letting Databricks compute embeddings and using your own. On storage-optimized endpoints, the embedding dimension must divide evenly by 16.
Reported, thanks
Step 8 of 9
Log your own embedding model as a custom MLflow pyfunc. Its signature takes a single ColSpec string as input and returns a TensorSpec, with embeddings in a NumPy array. Log it with pinned pip_requirements, the signature and an input_example.
Exam trap A custom embedding model should not declare several input columns; the signature expects one ColSpec string.
Reported, thanks
Step 9 of 9
For production on standard endpoints, use databricks-qwen3-embedding-0-6b with provisioned throughput.
Remove Scale to zero on embedding endpoints to avoid first-query timeouts.
A custom embedding model is a custom MLflow Python model with a ColSpec string input and TensorSpec output.
Log the model with pip_requirements, a signature and an input_example.
Check: Choose the basic elements needed to create a RAG application: model flavor, embedding model, retriever, dependencies, input examples, model signature
Cards to recall, then questions on this topic. About 2 minutes. Nothing is saved without an account.
Think first What does a team need before it can register, share and load a model in Unity Catalog?
Why it matters: Questions describe a team registering or using a model in Unity Catalog and ask which namespace, privilege or grant applies.
A registered model in Unity Catalog is an MLflow model that Unity Catalog treats as a type of function. It lives in a three-level namespace, holds versions, and follows the same permissions model as functions.
Reported, thanks
Step 2 of 8
Term
Meaning
Registered model
An MLflow model stored in Unity Catalog and implemented there as a kind of function.
Model version
One entry inside a model container; MLflow stores each training run's artifacts and metadata as one.
Three-level namespace
The catalog.schema.object naming that models share with tables, views and functions.
EXECUTE
The model privilege needed to load it, view all version metadata and download model files.
Reported, thanks
Step 3 of 8
Unity Catalog implements registered models as functions. That is why models share the functions permissions model. A model sits at catalog.schema.object and acts as a container for many versions.
Reported, thanks
Step 4 of 8
Creating a model needs CREATE MODEL on the schema or catalog. Granted on a catalog, CREATE MODEL lets you create models in any of its schemas. Workspace users already have it on the default schema of the workspace catalog.
Model privileges and what each allows
Feature
CREATE MODEL VERSION
APPLY TAG
EXECUTE
What it allows
Registering new versions only
Adding and editing tags
Loading the model and downloading its files
What it covers
New versions of the model
The model and its versions
Metadata of every version, plus model files
Reported, thanks
Step 5 of 8
Use GRANT ON FUNCTION to grant privileges on a model. Because a model is a function, the grant names FUNCTION and the model's full three-level name.
Works: Grants a group the EXECUTE privilege on a registered model.
GRANT EXECUTE ON FUNCTION prod.ml_team.iris_model
TO my_group;
Fails: Privileges on a registered model are granted with GRANT ON FUNCTION, not with a MODEL securable.
GRANT EXECUTE ON MODEL prod.ml_team.iris_model
TO my_group;
Exam trap Writing the grant against a MODEL object is the common slip. A registered model is a function, so the grant must say ON FUNCTION.
Reported, thanks
Step 6 of 8
Loading needs USE CATALOG, USE SCHEMA and EXECUTE. The usage privileges go on the parent catalog and schema; EXECUTE goes on the model. EXECUTE on a schema or catalog covers every current and future model inside it.
Exam trap EXECUTE on the model alone is not enough. The user also needs USE CATALOG and USE SCHEMA on the parents.
Reported, thanks
Step 7 of 8
Only a metastore admin can transfer model ownership freely. This rule prevents privilege escalation. Unity Catalog also tracks lineage automatically, from source data through models to services and dashboards.
Reported, thanks
Step 8 of 8
Registered models are functions in Unity Catalog, so grants use GRANT ON FUNCTION.
CREATE MODEL on the parent schema or catalog is required to create a model.
Loading a model needs USE CATALOG, USE SCHEMA and EXECUTE.
CREATE MODEL VERSION adds versions without letting the user execute or tag the model.
Think first When would you build a Delta Sync Index instead of a Direct Vector Access Index, and how would you then query it?
Why it matters: Questions describe a retrieval need and ask which index type, sync mode, privilege or query option fits it.
A Vector Search index either follows a source table on its own or takes vectors you write directly. You then pick how it syncs and query it through a short list of interfaces.
Reported, thanks
Step 2 of 9
Term
Meaning
Delta Sync Index
An index that updates itself incrementally as its source table changes.
Direct Vector Access Index
An index whose vectors and metadata you read and write yourself through the REST API or Python SDK.
Sync mode
How a Delta Sync Index picks up changes: Continuous or Triggered.
ann
Approximate nearest neighbor, the default query type.
Reported, thanks
Step 3 of 9
Delta Sync follows a table; Direct Vector Access is yours to update. Choose Delta Sync when your data already lives in a table that changes over time. Choose Direct Vector Access when your own code must write vectors.
Delta Sync Index and Direct Vector Access Index compared
Feature
Delta Sync Index
Direct Vector Access Index
Who updates it
Syncs from its source table incrementally
You, through the REST API or Python SDK
Use in the UI
A Triggered sync can be started from the UI
Cannot be created in the UI; use the REST API or SDK
Exam trap A Direct Vector Access Index cannot be created in the UI, and it never updates itself from a table.
Reported, thanks
Step 4 of 9
On standard endpoints, the source table needs a change data feed. Schema changes to the source table, such as new or modified columns, require you to rebuild the index. By default every column is synced; columns_to_sync picks a subset, but the primary key and embedding columns always stay.
Exam trap Adding a column to the source table does not flow into the index; the index must be rebuilt.
Reported, thanks
Step 5 of 9
The embedding column must be array[float]. When you use existing embeddings, you name the column that holds them and give the embedding dimension.
Reported, thanks
Step 6 of 9
Continuous is fast but costly; Triggered syncs on demand. Continuous runs a compute cluster for its streaming pipeline, which is why it costs more. Storage-optimized endpoints support only Triggered mode.
Continuous and Triggered sync modes compared
Feature
Continuous
Triggered
Freshness
In sync within seconds
Updated when you start a sync
How it runs
Automatic, on a streaming pipeline
Started from the UI, Python SDK or REST API
Exam trap Continuous mode is not available on storage-optimized endpoints, which allow Triggered sync only.
Reported, thanks
Step 7 of 9
Creating needs CREATE TABLE; querying needs three grants. To create an index you need CREATE TABLE on the target schema. To query it you need USE CATALOG on the catalog, USE SCHEMA on the schema and SELECT on the index.
Reported, thanks
Step 8 of 9
Query through the Python SDK, REST API or vector_search(). The default query type is ann. Set query_type to hybrid for keyword plus similarity search, which returns at most 200 results by default. Filters are a dictionary on standard endpoints and a SQL-like string on storage-optimized ones.
Exam trap A filter dictionary written for a standard endpoint will not suit a storage-optimized index, which expects a SQL-like filter string.
Reported, thanks
Step 9 of 9
Delta Sync follows a source table; Direct Vector Access is updated by you and cannot be made in the UI.
Continuous sync is near real time but costs more; storage-optimized endpoints allow Triggered only.
Querying needs USE CATALOG, USE SCHEMA and SELECT on the index.
The default query type is ann; hybrid returns up to 200 results by default.
Think first How would you serve an LLM application on Foundation Model APIs, from first prototype to production?
Why it matters: Questions describe an application's stage, load and requirements and ask which serving mode or setup fits.
Foundation Model APIs let you call Databricks-hosted models without running your own deployment. You pick a mode by workload: pay-per-token to start, provisioned throughput for production, AI Functions optimized models for batch.
Reported, thanks
Step 2 of 9
Term
Meaning
Pay-per-token
The Foundation Model APIs mode recommended for getting started.
Provisioned throughput
A mode with dedicated capacity, recommended for demanding production workloads.
Model unit
The chunk in which provisioned throughput capacity is bought.
Unity Gateway
The layer every foundation model request passes through, where rate limits, budgets and guardrails apply.
Reported, thanks
Step 3 of 9
Each Foundation Model APIs mode fits a different workload. Pay-per-token is the easiest start. Provisioned throughput suits production that needs fine-tuned models, extra security, high throughput or performance guarantees. AI Functions optimized models suit batch inference.
Exam trap Pay-per-token is the recommended starting point, not the pick for production that needs performance guarantees. That calls for provisioned throughput.
Reported, thanks
Step 4 of 9
With the OpenAI client, pass the serving endpoint name as the model. Install the databricks-openai package on your cluster; its OpenAI client comes with authorization already set up. In production, authenticate with machine-to-machine OAuth tokens.
Reported, thanks
Step 5 of 9
Capacity comes in model units, so you buy exactly the throughput you need. These endpoints run on serverless compute and offer compliance certifications such as HIPAA. Reserved provisioned throughput sets aside capacity for a fixed term of 1 or 3 months.
Exam trap Reserved provisioned throughput is not open-ended. Its term is fixed at 1 or 3 months.
Reported, thanks
Step 6 of 9
Deploy provisioned throughput from the models pre-installed in system.ai. Databricks recommends these Unity Catalog models, found in catalog system, schema ai. Databricks-hosted Claude models also support prompt caching through Foundation Model APIs.
Reported, thanks
Step 7 of 9
Set service_tier to "priority" to get ahead of standard traffic. Priority is opt-in per request, needs no commitment and costs more per token. In return, latency stays more consistent under load.
Standard and priority pay-per-token requests
Feature
Standard
Priority
Admission
Best effort
Ahead of standard best-effort traffic
Per-token rate
Standard rate
Higher rate
Exam trap Priority pay-per-token is not a capacity reservation. Each request opts in on its own, with no commitment.
Reported, thanks
Step 8 of 9
Every foundation model request passes through Unity Gateway. That holds for Databricks-hosted and external models alike. There you can set rate limits, budgets and guardrails, keeping cost and access in check.
Reported, thanks
Step 9 of 9
Start with pay-per-token; move to provisioned throughput for demanding production workloads.
Use AI Functions optimized models for batch inference.
With the OpenAI client, the model value is the serving endpoint name.
Production calls should authenticate with machine-to-machine OAuth tokens.
Think first Which parts of a vector search setup would you choose differently for a small precise app versus a billion-vector archive?
Why it matters: Questions describe a retrieval need and ask which endpoint, index type or search mode of Vector Search fits it.
Databricks AI Search, formerly Vector Search, is built into the Databricks platform. An endpoint serves each index, and Unity Catalog governs the indexes. You pick the endpoint type for scale and cost, and you choose who computes the embeddings.
Reported, thanks
Step 2 of 9
Term
Meaning
Endpoint
What serves an AI Search index; you query and update it with the REST API or the SDK.
HNSW
Hierarchical Navigable Small World, the algorithm used for approximate nearest neighbor search.
Hybrid search
Similarity search and keyword search together, with results merged by Reciprocal Rank Fusion.
Direct Vector Access Index
An index you read and write directly, keeping it updated yourself through the API or SDK.
Reported, thanks
Step 3 of 9
Searches use HNSW with the L2 distance metric. For cosine similarity, normalize embeddings before indexing. With normalized vectors, L2 distance ranks results in the same order as cosine similarity.
Exam trap There is no switch to pick cosine similarity at query time. You get cosine behavior only by normalizing embeddings first.
Reported, thanks
Step 4 of 9
Pick the endpoint type by scale, latency and cost. Storage-optimized endpoints suit 10M+ vectors when you can accept some extra latency. They cost up to 7x less per vector.
Endpoint types compared at dimension 768
Feature
Standard
Storage-optimized
Capacity
320 million vectors
Over one billion vectors
Indexing speed
Baseline
10-20x faster
Query latency
Baseline
About 250 ms more
Reported, thanks
Step 5 of 9
Databricks computes embeddings, or you bring your own. When you create the index, either let Databricks embed a text column or point it at precomputed embeddings. A self-managed embedding index cannot later become Databricks-managed.
Exam trap Switching to managed embeddings is not a setting change. You must create a new index and recompute the embeddings.
Reported, thanks
Step 6 of 9
You own the updates of a direct access index. It allows direct reads and writes of vectors and metadata. Keep it current yourself through the REST API or the Python SDK.
Reported, thanks
Step 7 of 9
Add keyword search when exact terms matter. Keyword relevance is scored with Okapi BM25, and Reciprocal Rank Fusion merges it with similarity results. This helps RAG when data holds unique terms such as SKUs or identifiers.
Reported, thanks
Step 8 of 9
Unity Catalog governs indexes, but not row by row. Row and column level permissions are not supported. To restrict results per user, build application-level ACLs with the filter API.
Exam trap Unity Catalog row filters will not limit what a user retrieves from an index. Use the filter API for application-level ACLs.
Reported, thanks
Step 9 of 9
Vector Search uses HNSW and L2 distance; normalize embeddings to get cosine ranking.
Standard endpoints hold 320 million vectors; storage-optimized hold over one billion.
Hybrid search merges BM25 keyword and similarity results with Reciprocal Rank Fusion.
A self-managed embedding index cannot be converted to a Databricks-managed one.
Think first When a table of millions of rows needs an LLM's judgment, how would you run that work efficiently from SQL?
Why it matters: Questions describe a large data-processing task and ask whether and how to use ai_query for batch inference.
ai_query is the general-purpose AI Function for calling a model from SQL or Python over many rows. Reach for it when no task-specific function fits, send the whole dataset at once, and let AI Functions handle scaling.
Reported, thanks
Step 2 of 10
Term
Meaning
ai_query
A general-purpose AI Function that queries a supported model with full control of model, prompt and parameters.
Task-specific AI Function
A function built and optimized for one task; the recommended starting point before ai_query.
system.ai model services
Databricks-hosted, fully managed model services that scale automatically for batch work.
failOnError
A setting that, when false, lets a job finish and return errors for failed rows only.
Reported, thanks
Step 3 of 10
Start with a task-specific function; use ai_query when none fits. ai_query gives full control over model, prompt and parameters. It can call traditional ML models, even fully custom ones, on Model Serving endpoints, and it can query an agent on Model Serving from SQL.
Reported, thanks
Step 4 of 10
ai_query needs Databricks Runtime 15.4 LTS or above. For the best performance, use Runtime 18.2 or later. The function is not available on Classic SQL warehouses.
Exam trap A Classic SQL warehouse cannot run ai_query. Pick a compute type that supports AI Functions.
Reported, thanks
Step 5 of 10
Prefer system.ai model services for batch jobs. They are fully managed and scale without provisioning. Pick a model optimized for batch inference; a non-optimized one can cut throughput and slow the job. Fine-tuned foundation models are different: they need a provisioned throughput endpoint.
Two ways to serve the model behind ai_query
Feature
system.ai model services
Provisioned throughput endpoint
Setup
Fully managed, no provisioning
You create it in Model Serving
When needed
Recommended default for batch work
Required for fine-tuned foundation models
Scaling for batch
Scales automatically
AI Functions manages it, not the endpoint's compute
Reported, thanks
Step 6 of 10
Send the full dataset in a single query. AI Functions handle parallelization, retries and scaling for you. Splitting rows into small manual batches can lower throughput.
Exam trap Chunking the table into small batches yourself is not safer. It can reduce throughput, because AI Functions already parallelize the work.
Reported, thanks
Step 7 of 10
Set failOnError to false for large workloads. The job then completes and returns error messages for the failed rows. You keep the successful results and avoid reprocessing the whole dataset.
Reported, thanks
Step 8 of 10
Calls to system.ai services go through Unity Gateway. Usage tracking, budget integration and permission checks apply to them. Guardrails, rate limits, fallbacks, external model providers, and inference or tracing tables do not.
Exam trap Routing through Unity Gateway does not bring inference tables or guardrails. Those features are not supported for routed ai_query requests.
Reported, thanks
Step 9 of 10
Batch pipelines can run on a schedule or as a stream. Write the pipeline in SQL or Python. Deploy it as a Lakeflow pipeline, a scheduled Databricks workflow or a Structured Streaming inference workflow.
Reported, thanks
Step 10 of 10
Use ai_query when a task-specific AI Function does not meet your needs.
Submit the full dataset in one query; manual batching can reduce throughput.
Set failOnError to false so large jobs keep their successful rows.
ai_query needs Runtime 15.4 LTS or above and does not run on Classic SQL warehouses.
Think first How would you pick an endpoint type, sync mode and query capacity for a vector search workload?
Why it matters: Questions give a vector count, update frequency, latency need and budget, and ask which endpoint or setting fits.
Three choices shape a vector search setup: the endpoint type, the sync mode and any extra query capacity. Standard endpoints favor low latency, while storage-optimized endpoints favor scale and cost per vector. Faster index updates and reserved throughput both raise the bill.
Reported, thanks
Step 2 of 9
Term
Meaning
Vector search unit
Capacity covering up to 2 million vectors at dimension 768 on standard endpoints, or 64 million on storage-optimized.
Triggered sync
You call the API or Python SDK to update the index; the most cost-effective sync option.
Continuous sync
The index follows the source Delta table in near real time, using a streaming cluster.
Target QPS
Extra query capacity you provision on a standard endpoint, charged regardless of actual traffic.
Hybrid search
A search mode that is resource-heavy and can significantly reduce throughput.
Reported, thanks
Step 3 of 9
Pick standard for latency, storage-optimized for scale and cost. Standard endpoints fit when latency is critical and the index is well under 320M vectors. Storage-optimized endpoints hold over one billion vectors at dimension 768.
The two endpoint types compared
Feature
Standard
Storage-optimized
Best fit
Latency is critical; index well under 320M vectors
10M+ vectors; some extra latency is acceptable
Vectors per unit at dimension 768
Up to 2 million
Up to 64 million
Query latency
The choice when latency is critical
About 250 ms of extra latency
Cost and speed
Supports high QPS (target QPS)
Up to 7x cheaper per vector; 10-20x faster indexing
Exam trap Storage-optimized is not simply a bigger standard endpoint. Its queries add about 250 ms, and it does not support high QPS.
Reported, thanks
Step 4 of 9
A standard unit covers up to 2 million vectors at dimension 768. Higher dimensions count more: 1 million vectors at dimension 1536 also fill one unit. On storage-optimized endpoints, one unit covers up to 64 million vectors at dimension 768.
Exam trap Count dimensions as well as vectors. One million vectors at dimension 1536 use a whole standard unit, not half of one.
Reported, thanks
Step 5 of 9
Triggered sync is the most cost-effective option. You call the API or Python SDK to update the index. Continuous sync follows the source Delta table in near real time, but its streaming cluster makes it cost more. Choose triggered sync when seconds of latency are not critical.
Exam trap Continuous sync does not come free. Its streaming cluster adds cost, so use it only when near real-time updates matter.
Reported, thanks
Step 6 of 9
High QPS is recommended above 50 QPS of sustained throughput. Setting a target QPS provisions extra capacity, and you pay for it regardless of actual query traffic. High QPS is available for standard endpoints only.
Exam trap Target QPS capacity is not billed by use. You pay for the extra capacity even when traffic is low.
Reported, thanks
Step 7 of 9
Hybrid search is resource-heavy and can significantly reduce throughput. Embedding size matters too. Halving embedding dimensionality, for example from 768 to 384, typically improves QPS by about 1.5x and cuts latency by about 20%.
Exam trap A scale-to-zero embedding endpoint is a poor fit for real-time production. Cold starts can delay responses by minutes or even cause failures.
Reported, thanks
Step 8 of 9
One endpoint can serve up to 50 indexes. Combining smaller workloads on a single endpoint can lower total costs. An endpoint is charged only after an index exists, and charges stop 24 hours after its last index is deleted.
Reported, thanks
Step 9 of 9
Standard endpoints suit critical latency; storage-optimized suit 10M+ vectors at lower cost per vector.
Triggered sync is the cheapest; continuous sync costs more for near real-time updates.
Target QPS capacity is billed regardless of traffic and exists only on standard endpoints.
One endpoint serves up to 50 indexes, so combine small workloads to save cost.
Think first How would you give a Databricks agent memory that lasts across conversations while keeping each user's data safely apart?
Why it matters: Questions describe an agent that must remember things and ask which memory option, key or setting fits the need.
Agents need two kinds of memory. Short-term memory holds context inside one conversation, while agent memory keeps facts across conversations in Lakebase. Databricks runs the storage, indexing and search for you.
Reported, thanks
Step 2 of 11
Term
Meaning
Memory store
A workspace-scoped container for memory entries, backed by Lakebase that Databricks provisions for you.
Memory entry
One stored memory, identified by its actor_id, session_id and path together.
actor_id
The key that groups memories by actor, such as an end user; it is not a permission check.
Short-term memory
Context kept inside one conversation session through thread IDs and checkpointing.
Reported, thanks
Step 3 of 11
Pick the memory type by how long the context must last. Conversation history inside a single interaction belongs in agent sessions. Facts the agent should recall in later conversations belong in agent memory, which works with agents built on any framework.
Short-term memory and agent memory compared
Feature
Short-term memory
Agent memory
How long it lasts
One conversation session
Across conversations
How it works
Thread IDs and checkpointing
Entries in a memory store on Lakebase
Typical tool
Agent sessions
Agent memory, currently in Beta
Exam trap Agent memory is not the place for turn-by-turn chat history inside one interaction; use agent sessions for that.
Reported, thanks
Step 4 of 11
A memory store is scoped to the workspace. Creating a store sets up its Lakebase storage automatically, so you manage no database yourself. Choose the store's ID with care: it is fixed after creation, and only the description can change later.
Exam trap A memory store's ID is fixed once the store exists. After creation, only the description can be updated.
Reported, thanks
Step 5 of 11
The store, not actor_id, is the security boundary. An entry is keyed by actor_id, session_id and path. Anyone who can reach a store can read and write every actor's entries. For strict isolation between tenants or users, give each boundary its own store.
Exam trap Separating users by actor_id alone does not stop one principal reading another user's memories in the same store.
Reported, thanks
Step 6 of 11
add() refuses an existing path; put() creates or updates. Use add() when a second write to a path should fail with ALREADY_EXISTS. Use put() for an upsert. Because put() is not atomic, two writes to the same path at once can overwrite each other.
Exam trap put() is not atomic, so it does not guard against concurrent writers: parallel writes to one path can overwrite each other.
Reported, thanks
Step 7 of 11
Search ranks an actor's entries by relevance. You pass a natural-language query for one actor. Matching mixes full-text BM25 with semantic matching over content and description. One search returns at most 100 entries, with no pagination.
Reported, thanks
Step 8 of 11
Set actor_id in trusted code, never by the model. When an agent gets memory tools, your application should fill actor_id from the verified end-user identity. Letting the model pick it would let it reach memories that belong to someone else.
Reported, thanks
Step 9 of 11
Self-managed memory on Lakebase suits SQL needs. The legacy self-managed approach uses Lakebase, a managed Postgres OLTP database, when you need direct SQL access or a custom schema. The agent-langgraph-advanced template uses LangGraph checkpointing with Lakebase for both memory types.
Reported, thanks
Step 10 of 11
You pay only for the Lakebase instance. While agent memory is in preview, the underlying Lakebase instance that holds the entries is billed. Agent memory itself carries no extra charge.
Reported, thanks
Step 11 of 11
Use agent sessions for one conversation and agent memory for facts that must last across conversations.
An entry is unique by actor_id, session_id and path together.
Isolate tenants with separate memory stores, because actor_id is not an access control.
put() upserts but is not atomic; add() fails with ALREADY_EXISTS on an existing path.
Search returns up to 100 entries ranked by relevance, without pagination.
Apply CI/CD best practices such as updating a Vector Search index, promoting prompts across environments, and testing individual components of an agent
Think first How do you ship changes to an agent's prompts and retrieval without breaking production?
Why it matters: Questions describe a change to a deployed agent and ask which practice updates, promotes or tests it safely.
Treat prompts as versioned assets that the agent loads by alias. You promote a prompt by moving an alias, not by redeploying code. Test each piece on its own: prompts on fixed data, the search endpoint under load.
Reported, thanks
Step 2 of 10
Term
Meaning
Prompt Registry
The MLflow store where prompts are registered, versioned and loaded.
Alias
A named pointer, such as production, that the agent loads instead of a fixed version.
LoggedModel
The record mlflow.set_active_model() creates, linking code, settings and prompts.
Load test
A test that simulates real traffic levels to size an AI Search endpoint.
Reported, thanks
Step 3 of 10
Deployed agents should load prompts by alias, not a hard-coded version. Then a prompt can change without a redeploy. The MLflow client caches templates, so loading from the registry adds no latency.
Exam trap Hard-coding a prompt version means every prompt change needs a redeploy. Loading by alias avoids that.
Reported, thanks
Step 4 of 10
Create prompts with mlflow.genai.register_prompt(). Template variables use double braces, like {{variable}}. Reference an aliased prompt with prompts:/{catalog}.{schema}.{prompt_name}@{alias}. The schema needs CREATE FUNCTION, EXECUTE and MANAGE permissions.
Reported, thanks
Step 5 of 10
Promote a prompt by pointing its alias at a newer version. Aliases let you iterate in development and move a prompt through environments with no change to application code. To update production, reassign the production alias; nothing gets redeployed.
Reported, thanks
Step 6 of 10
mlflow.set_active_model() links prompt versions to app versions. MLflow builds that lineage automatically for registry prompts. The LoggedModel holds no application code; it points to a Git commit, configuration parameters and the prompts used.
Exam trap The LoggedModel is not a code archive. It only links to code kept elsewhere, such as a Git commit.
Reported, thanks
Step 7 of 10
Evaluate every prompt version on the same dataset. A shared dataset makes the comparison fair. Keep evaluating after deployment as well, so you catch quality drops in production.
Reported, thanks
Step 8 of 10
Load-test an AI Search endpoint before production. The test runs the endpoint under several traffic levels that mimic real use, so you can size it for production needs.
Reported, thanks
Step 9 of 10
Use a service principal with an OAuth token in production. An agent deployed with Custom Agents needs manual authentication and overridden security environment variables to reach the prompt registry.
Reported, thanks
Step 10 of 10
Load prompts by alias so prompt updates need no redeploy.
Promote or update a prompt by reassigning its alias to a newer version.
Compare prompt versions on the same evaluation dataset, and keep evaluating after deployment.
Load-test AI Search endpoints to size them for production traffic.
Check: Apply CI/CD best practices such as updating a Vector Search index, promoting prompts across environments, and testing individual components of an agent
Cards to recall, then questions on this topic. About 2 minutes. Nothing is saved without an account.
Think first How do you decide between a managed, an external and a custom MCP server for an agent?
Why it matters: Questions describe an application's tools and access needs and ask which MCP server type or setup fits.
Managed MCP servers expose Databricks resources at workspace endpoints. External servers reach third-party services through Unity Catalog connections. Custom servers run your own tools on Databricks Apps.
Reported, thanks
Step 2 of 9
Term
Meaning
Workspace MCP endpoint
A managed MCP path in the workspace, such as one for a Genie space or for Unity Catalog functions.
Managed OAuth
Databricks manages the OAuth credentials for a supported provider's published MCP server.
Unity Catalog HTTP connection
The Unity Catalog object that holds an external server's connection and its auth type.
Databricks Apps
The service that hosts a custom MCP server, giving it compute and an HTTPS URL.
Reported, thanks
Step 3 of 9
Managed MCP Servers must be switched on by a workspace admin first. The switch is on the workspace Previews page. A Genie space and Unity Catalog functions each have their own workspace endpoint path.
Exam trap The Beta MCPs system.ai.web_search, system.ai.dbsql and system.ai.sandbox use a different switch. An account admin enables the Enhanced Unity Gateway preview from the account console Previews page.
Reported, thanks
Step 4 of 9
Call list_tools() to learn tool names and input schemas. Do this before calling any MCP tool. Databricks-provided and registered MCPs sit under the workspace's ai-gateway/mcp-services path, named by catalog, schema and service.
Reported, thanks
Step 5 of 9
Databricks can manage OAuth for Glean, GitHub, Atlassian and Slack servers. Register the provider's published MCP server as an MCP Service. Managed OAuth is the recommended choice for development and testing. It needs a Unity Catalog HTTP connection whose auth type is OAuth User to Machine Per User.
Reported, thanks
Step 6 of 9
Databricks Apps hosts your own MCP server with compute and an HTTPS URL. Start the app name with mcp- so AI Playground recognizes it. For the Starter and OpenAPI templates, connect at the app URL plus /mcp. The OpenAPI template needs an OpenAPI 3.x spec saved as spec.json in a volume.
Reported, thanks
Step 7 of 9
An existing MCP server on Databricks Apps must use Streamable HTTP. It listens on 0.0.0.0 at the port in DATABRICKS_APP_PORT, which defaults to 8000.
Reported, thanks
Step 8 of 9
A caller needs the CAN USE permission on the app plus an OAuth token. Personal access tokens are not supported for MCP servers hosted on Databricks Apps.
Exam trap A personal access token will not authenticate to an app-hosted MCP server. The caller needs an OAuth token plus CAN USE on the app.
Reported, thanks
Step 9 of 9
A workspace admin enables Managed MCP Servers on the Previews page before workspace endpoints work.
Run list_tools() before calling an MCP tool.
Custom MCP servers run on Databricks Apps; start the name with mcp- and use /mcp for template apps.
App-hosted servers need CAN USE plus an OAuth token; personal access tokens fail.
Think first How would you version, test and roll out a prompt change while keeping a full history?
Why it matters: Questions describe a prompt change and ask which registry action, function or practice handles it.
The Prompt Registry versions prompts much as Git versions code. Versions never change once created, and aliases point at the version an app should use. Moving an alias releases a new version, and history makes rollback possible.
Reported, thanks
Step 2 of 9
Term
Meaning
Prompt
A named entity in Unity Catalog, managed in the Prompt Registry.
Version
An immutable snapshot of a prompt, with an auto-incrementing number.
Alias
A mutable pointer to one specific prompt version.
Prompt URI
The prompts:/ address an app uses to load a prompt by alias.
Reported, thanks
Step 3 of 9
Prompt versions are immutable once created. To edit a prompt, you create a new version. This Git-like model keeps complete history, with commit messages and rollbacks.
Exam trap You cannot edit a saved version in place. Every change becomes a new version, and that history is what makes rollback possible.
Reported, thanks
Step 4 of 9
register_prompt() creates prompts or versions; load_prompt() retrieves them. Registering under an existing name adds a version rather than a new prompt. Removing an alias never deletes versions.
Prompt lifecycle tasks and their functions
Task
Function
What happens
Create a prompt or add a version
register_prompt()
An existing name gets a new version
Retrieve a prompt
load_prompt()
Returns a specific version or alias
Remove an alias
delete_prompt_alias()
The alias goes; the versions remain
Reported, thanks
Step 5 of 9
Deployed agents load prompts by alias rather than a hard-coded version. Use the URI prompts:/{catalog}.{schema}.{prompt_name}@{alias}. To update production, point the production alias at a newer version; application code stays as it is and is not redeployed. Cached templates mean no added latency.
Reported, thanks
Step 6 of 9
The Compare button shows only a text diff between templates. To learn which version produces better outputs, evaluate both with the same dataset and judges. Then compare the evaluation runs.
Exam trap A text diff does not tell you which prompt performs better. That takes evaluations of both versions with the same dataset and judges.
Reported, thanks
Step 7 of 9
Registry templates use double braces, such as {{name}}. That applies to simple prompts and to conversations. For LangChain or LlamaIndex, which expect single braces, convert with to_single_brace_format().
Reported, thanks
Step 8 of 9
Prompts need CREATE FUNCTION, EXECUTE and MANAGE on a schema. Those Unity Catalog schema permissions let you view or create prompts. With mlflow.set_active_model(), MLflow links prompt versions to application versions automatically.
Reported, thanks
Step 9 of 9
Versions are immutable; edit a prompt by registering a new version.
Aliases are mutable pointers; move one to release or update a prompt.
Deleting an alias leaves every prompt version in place.
Judge output quality with evaluations on the same dataset, not with the text diff.
Think first What would you build so users can chat with your agent safely, and where would you host it?
Why it matters: Questions describe who will use an agent and how, then ask which hosting, interface or authentication choice fits.
Databricks recommends building agents on Databricks Apps instead of Model Serving. An app runs the agent server, can include a ready chat UI, and keeps credentials on the server rather than in the browser.
Reported, thanks
Step 2 of 9
Term
Meaning
MLflow AgentServer
An async FastAPI server in the agent template that exposes /invocations for querying the agent.
ResponsesAgent
An MLflow interface that makes an agent work with AI Playground, Agent Evaluation and Apps deployment.
Agent runtime
The layer that hosts the agent server on managed compute and takes care of identity and scaling.
CAN_USE
The permission an orchestrator app needs on another app it calls, along with OAuth.
Reported, thanks
Step 3 of 9
Apps are the recommended place to author agents. On Apps you can use any framework or stack and add custom routes and middleware. You can also set up how users and the agent authenticate to tools and LLM endpoints.
Reported, thanks
Step 4 of 9
Conversational templates ship with a chat interface. The UI already supports streaming, authentication and persistent history. After creating the app from a template in the workspace UI, click the app URL to open the chat.
Reported, thanks
Step 5 of 9
Apps serve decorated functions, not a class. On Apps, the AgentServer serves module-level functions marked @invoke() and @stream(). Model Serving instead expects a ResponsesAgent class whose methods are predict() and predict_stream().
Agent code on Databricks Apps and Model Serving
Feature
Databricks Apps
Model Serving
Agent shape
Module-level functions
Class-based ResponsesAgent
Entry points
@invoke() and @stream()
predict() and predict_stream()
Exam trap The predict() method is the Model Serving pattern. On Databricks Apps, the AgentServer looks for functions decorated with @invoke() and @stream().
Reported, thanks
Step 6 of 9
Let the app backend call the agent endpoint. The backend keeps tokens server-side, signs users in with corporate identity and enforces per-user permissions. Putting PATs or API keys in browser code breaks those security requirements.
Exam trap A browser page calling the endpoint with an embedded API key is not acceptable. Tokens belong in the app backend, never in the browser.
Reported, thanks
Step 7 of 9
An orchestrator app needs OAuth and CAN_USE on its target. When one Databricks app calls another, grant the CAN_USE permission on the target app and authenticate with OAuth.
Reported, thanks
Step 8 of 9
start-app runs the server and chat UI locally. Locally, the UI opens on port 8000. When you deploy with bundles, bundle deploy only uploads files; run bundle run to start the app. For new agents, agentbricks deploy provides a stable, authenticated endpoint.
Exam trap A finished bundle deploy does not mean the app is live. It uploads files only, and bundle run starts the app.
Reported, thanks
Step 9 of 9
Databricks recommends authoring agents on Databricks Apps over Model Serving.
Conversational templates include a chat UI with streaming, authentication and history.
Keep tokens in the app backend; never embed PATs or API keys in the browser.
Wrapping an agent with ResponsesAgent makes it work with AI Playground and Apps deployment.
Each topic's Check tested it on its own; this mixes them.
Mixed quiz
Take the Domain 4 quiz
10 questions mixed from every topic in this domain, each answer explained. Mixing topics is harder than one at a time, and it is what the exam does. No account needed; with a free account your answers also build your estimated exam score.
Free to start: the study notes and plan, quizzes, flashcards and the first mock exam, no card needed. A free account keeps your place and saves your quiz scores.