Think first Faced with an agent design, how do you choose between LangChain, LangGraph, OpenAI SDKs, MCP servers and Databricks tools?
Why it matters: Questions describe an agent's task and stack, and ask which library, tool or tracing call fits it.
Pick a framework for the agent, a tool for each data need, and the tracing call that makes it visible. Databricks pairs LangChain and OpenAI libraries with AI Bridge tools, MCP servers and MLflow autologging.
Reported, thanks
Step 2 of 9
Term
Meaning
Autologging
Automatic MLflow tracing for libraries such as LangChain, LlamaIndex and OpenAI.
AI Bridge
The recommended way for new Python agents to query Databricks AI Search indexes.
MCP server
A tool server an agent calls. Databricks-provided and registered ones use Unity Catalog permissions.
Retriever schema
The standard shape for retriever output: a List[Document] with extra attributes in metadata.
Reported, thanks
Step 3 of 9
Build custom agents with the OpenAI client, the OpenAI Agents SDK or LangGraph. Any of these can call MCP tools. Databricks-provided and registered MCP servers are governed by Unity Catalog permissions.
Reported, thanks
Step 4 of 9
Match the MCP server to the kind of question. Plain-language business questions and hand-written SQL call for different servers.
Which Databricks MCP server to use
Need
Server
Detail
Business questions in natural language
Genie One MCP server
Grounds answers in Genie Ontology, the governed semantic layer
Specific SQL queries
Databricks SQL MCP server
Also suits development and data engineering
Exam trap For a business user's plain-English question, the Databricks SQL MCP server is not the recommended pick. Genie One is.
Reported, thanks
Step 5 of 9
New agents query AI Search indexes through AI Bridge.VectorSearchRetrieverTool, in databricks-langchain or databricks-openai, turns an index into an agent tool. Direct-access indexes, and Delta Sync indexes with self-managed embeddings, also need a custom embedding model and text column.
Exam trap With self-managed embeddings, VectorSearchRetrieverTool is not ready with defaults alone. You must set a custom embedding model and a text column.
Reported, thanks
Step 6 of 9
Return a List[Document], with extras in the metadata field. Attributes such as doc_uri and similarity_score go in metadata. For new retrievers, mlflow.models.set_retriever_schema is deprecated. Wrapping a Unity Catalog retriever function with UCFunctionToolkit creates RETRIEVER spans for tracing.
Reported, thanks
Step 7 of 9
mlflow.langchain.autolog() turns on LangChain tracing. On serverless compute you must call it yourself, because autologging is off there by default. Traced APIs include invoke, batch, stream, their async forms and get_relevant_documents.
Works: Turns on automatic LangChain tracing, which serverless compute needs you to call explicitly.
mlflow.langchain.autolog()
Fails: Passing disable=True switches LangChain auto tracing off globally instead of on.
mlflow.langchain.autolog(disable=True)
Reported, thanks
Step 8 of 9
For production, choose the mlflow-tracing package, which is optimized for it. To change what a LangChain trace holds, write a callback handler that inherits from MlflowLangchainTracer. Manual @mlflow.trace decorators work alongside autologging.
Reported, thanks
Step 9 of 9
New agents on AI Search use AI Bridge's VectorSearchRetrieverTool.
Use Genie One MCP for business questions and Databricks SQL MCP for SQL work.
On serverless compute, call mlflow.langchain.autolog() explicitly.
Retrievers return List[Document]; set_retriever_schema is deprecated.
Think first When a RAG answer looks wrong, how do you tell whether retrieval, generation or safety is the real problem?
Why it matters: Questions show a poor or unsafe response and ask which issue it reveals or which judge would catch it.
A response can fail on accuracy, grounding or safety, and the cause can sit in retrieval or in generation. Collect both retrieval and response metrics, then use traces to find the step that went wrong.
Reported, thanks
Step 2 of 9
Term
Meaning
Groundedness
Whether a response is supported by its retrieved context or is a hallucination.
Hallucination
Output not grounded in the retrieved context; one way generation quality fails.
Ground truth
Human-labeled correct answers that some judges, such as correctness, compare against.
Adversarial example
A test question that attempts prompt injection or tries to draw out an inappropriate response.
Evaluation set
The questions used to judge quality: at least 30, ideally 100 to 200.
Reported, thanks
Step 3 of 9
Judge responses on correctness, groundedness and safety. Response metrics cover accuracy against ground truth and grounding in the retrieved context. They also cover safety, meaning no toxicity.
Three response judges compared
Judge
What it asks
Needs ground truth
correctness
Did the agent give a correct response?
Yes
groundedness
Is the response grounded in context, or made up?
No
safety
Does the response contain harmful content?
No
Exam trap Groundedness and safety judges need no ground truth. Of these three, only correctness compares outputs with human labels.
Reported, thanks
Step 4 of 9
Generation issues show as hallucinations, inconsistency or off-target answers. Off-target means the reply does not directly address the user's query. The context matters too: missing or superfluous information makes good output hard to produce.
Reported, thanks
Step 5 of 9
Collect both retrieval and response metrics. A RAG app can answer poorly even when it retrieved the right context. It can also answer well from faulty retrieval. Retrieval quality depends on pipeline levers, such as chunking, metadata and the embedding model. It also depends on chain levers, such as query transformation, chunk count and re-ranking.
Exam trap A good final answer does not prove retrieval worked. Faulty retrieval can still yield good responses, so check retrieval metrics too.
Reported, thanks
Step 6 of 9
Traces show which intermediate step caused a failure. The input and final response alone cannot reveal that. With traces you inspect every step, then turn typical failures into evaluation datasets.
Reported, thanks
Step 7 of 9
Use at least 30 questions, ideally 100 to 200. Include adversarial examples, such as prompt injection attempts or requests for inappropriate responses. Stakeholders can give feedback in a web chat interface. Their feedback and the outputs are saved in Delta tables for curation.
Reported, thanks
Step 8 of 9
Agent Evaluation can score quality with no ground truth. When ground truth exists, it adds metrics such as answer correctness. Any LLM judge must be tuned to the use case: find where it fails, then improve it there.
Exam trap An LLM judge is not reliable out of the box for every use case. It must be tuned on the cases where it does not work well.
Reported, thanks
Step 9 of 9
Correctness needs ground truth; groundedness and safety do not.
Hallucinations, inconsistent output and off-target answers point to generation issues.
Measure retrieval and response separately: one can be good while the other fails.
Start with at least 30 evaluation questions, including adversarial ones.
Think first How would you decide whether smaller or larger chunks will serve your RAG application better?
Why it matters: Questions describe a retrieval problem and ask which chunking strategy or evaluation metric fits it.
Chunk size trades precision against context, and no size is right in advance. Build a reproducible evaluation first, then compare strategies by how retrieval metrics change.
Reported, thanks
Step 2 of 10
Term
Meaning
Semantic chunking
Splitting text into groups of similar sentences instead of fixed-size pieces.
Parent-child chunking
Small-to-big retrieval: small child chunks for precision inside large parent chunks for context.
Recall@k
Of all known relevant documents, the share retrieved within the top k, scored from 0 to 1.
DCG@10
A ranking metric that scores result relevance together with each result's rank position.
Reported, thanks
Step 3 of 10
Small chunks pinpoint facts; large chunks keep context. Neither wins everywhere, so test sizes against your own questions. Whatever size you pick, the retrieved chunks must still fit in the LLM context window together.
Chunk sizes commonly tested and what each favors
Feature
Small
Medium
Large
Typical size
256
512
1024
Strength
Precise fact retrieval
A balance of both
More context per chunk
Exam trap Bigger is not always better. Large chunks keep context but make the relevant passage harder to find, and many must fit the context window.
Reported, thanks
Step 4 of 10
Semantic and parent-child chunking avoid one fixed size. Semantic chunking groups sentences that are similar. Parent-child chunking stores small child chunks, for example 512, inside large parents, for example 2048, so a precise match returns its wider context.
Reported, thanks
Step 5 of 10
Good chunks start from clean, structured text. Remove boilerplate such as headers, footers and page numbers. Keep headings, lists and tables intact, and cut along semantic boundaries.
Reported, thanks
Step 6 of 10
Metadata and parsing often beat chunk-size tuning. Extract entities, topics and categories for precise filtering. Parse documents cleanly, for example with ai_parse_document, and add summaries and section headers to chunks.
Exam trap Endless chunk-size tweaking is rarely the best lever. Metadata extraction, quality parsing and semantic metadata usually help more.
Reported, thanks
Step 7 of 10
Set up a reproducible evaluation system first. The data need not be perfect. What matters is an automated way to measure change, and judging strategies by relative improvement rather than absolute scores.
Reported, thanks
Step 8 of 10
Track Recall@k when missing context is the risk. In a RAG agent, a missed document leads to wrong answers or hallucinations. For overall retrieval quality, DCG@10 is the recommended primary metric because it scores relevance and ranking position.
Two retrieval metrics compared
Feature
Recall@k
DCG@10
Measures
Share of relevant documents in the top k
Relevance and position in the ranking
Use it for
Completeness, as in RAG
Primary measure of overall retrieval quality
Reported, thanks
Step 9 of 10
Evaluate retrieval on its own, not only end to end. A formatting change can alter which chunks come back. AI Search retrieval quality evaluation (Beta) has an LLM judge rate each query and document pair on a 4-point relevance scale.
Reported, thanks
Step 10 of 10
Smaller chunks localize facts; larger chunks keep context but blur the target.
Common sizes to test are 256, 512 and 1024.
For RAG, track Recall@k; for overall retrieval quality, DCG@10 is the primary metric.
Have a reproducible evaluation in place before you tune retrieval.
Think first How does a user's question become a prompt that carries the right supporting facts for the LLM?
Why it matters: Questions describe a user request and ask how to retrieve context and insert it into a prompt template.
A RAG chain understands the question, retrieves supporting data, augments the prompt with it and then generates the answer. A prompt template with variables is where the user's input and the retrieved context meet.
Reported, thanks
Step 2 of 8
Term
Meaning
Augmentation
Combining retrieved data with the user's request, often in a template, to build the prompt.
Template variable
A placeholder in double braces, such as {{name}}, filled with values at run time.
Chat prompt
A list of role-based messages, such as system and user, for conversational models.
Knowledge base
The outside store queried during retrieval: a vector store, keyword search or SQL database.
Reported, thanks
Step 3 of 8
Retrieve, then augment, then generate. The chain first works out what the user's question means. It then retrieves supporting data, augments the prompt with that data and has an LLM generate a response from the augmented prompt.
What each step of the RAG chain does
Feature
Retrieval
Augmentation
Generation
Input
The user's request
Supporting data plus the request
The augmented prompt
Output
Supporting data from a knowledge base
A prompt, often built from a template
The LLM's response
Reported, thanks
Step 4 of 8
The user's request drives the query. Use the request to search a vector store, keyword search or SQL database. Retrieval can also filter personal or proprietary data by the user's credentials.
Reported, thanks
Step 5 of 8
RAG brings in knowledge the LLM never saw. Memos, emails and other documents outside the training data can answer domain-specific questions. The supporting data can be structured or unstructured, depending on the use case.
Reported, thanks
Step 6 of 8
Double braces mark each value filled in at run time. Both simple and conversation prompts use {{name}} style variables. A Chat prompt splits instructions and input into role-based messages, such as system and user.
Exam trap Single braces are not the registry's variable syntax. MLflow can convert prompts to single braces for LangChain and LlamaIndex, which use f-string style.
Reported, thanks
Step 7 of 8
Load the prompt, then call format() with the user's values.mlflow.genai.load_prompt() fetches a registered prompt by its URI. Passing allow_missing=True when loading lets optional parameters stay empty.
Example: Loads a registered prompt and fills its question variable with user input.
my_uri = "prompts:/docs.default.customer_support@production"
prompt = mlflow.genai.load_prompt(name_or_uri=my_uri)
formatted_prompt = prompt.format(
question="How do I reset my password?"
)
prompt.format(: fills each template variable by name
Exam trap Loading the prompt does not insert the user's input. You still call format() with a value for each variable.
Reported, thanks
Step 8 of 8
Augmentation joins retrieved data and the user's request into one prompt.
Registry templates mark variables with double braces, like {{name}}.
Fill a loaded prompt by calling format() with the variable values.
Retrieval can limit personal or proprietary data based on user credentials.
Think first How do you move an LLM's answers from a rough baseline to the output you need?
Why it matters: Questions show a baseline response and ask which prompt change, format setting or tool reaches the target.
Start with a simple prompt and improve it based on evaluation results. Version each change in the Prompt Registry, and use structured outputs when the answer must follow a fixed format.
Reported, thanks
Step 2 of 9
Term
Meaning
Prompt Registry
MLflow's store for prompt templates, with immutable versions that keep history and allow rollback.
Structured outputs
A way to make a chat model return text, unstructured JSON or JSON that follows a schema.
response_format
The request field that sets structured output the same way for any supported chat model.
Prompt optimization
Tuning a prompt with data that holds expected responses and facts, for example with GEPA.
Reported, thanks
Step 3 of 9
Begin with a basic prompt and improve it from evaluation results. Prompt optimization can help steer behavior toward your use case. It uses data with expected responses and facts. MLflow can optimize a simple prompt with the GEPA optimizer.
Reported, thanks
Step 4 of 9
Prompt versions are immutable; an edit creates a new version. This keeps full history and lets you roll back. Templates fill variables at runtime with {{variable_name}} syntax.
Text and Chat prompt types compared
Feature
Text
Chat
Template shape
A single text template
A list of role-based messages, such as system and user
Use it for
Completion-style prompts
Chat-style prompts for conversational models
Exam trap You cannot edit a saved prompt version in place. Any change becomes a new version.
Reported, thanks
Step 5 of 9
The Compare button shows only a text diff. To learn which version gives 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. To find out, run evaluations on both versions with the same dataset and judges, then compare the runs.
Reported, thanks
Step 6 of 9
Structured outputs use response_format on any supported chat model. Databricks handles the translation for each provider. They work on pay-per-token and provisioned throughput endpoints. The techniques behind them raise token use, which affects billing.
Reported, thanks
Step 7 of 9
A JSON schema can hold at most 64 keys. Flatten heavily nested schemas for better quality. The pattern keyword is not supported, and neither is composition with anyOf, oneOf, allOf, prefixItems or $ref.
Exam trap Deep nesting does not improve structured output. Heavily nested schemas lower generation quality, so flatten them when you can.
Reported, thanks
Step 8 of 9
Claude models accept json_schema, not json_object. Omit response_format for unconstrained output. Structured outputs do not work with streaming, so set stream to false.
Exam trap Streaming and structured outputs do not mix for Claude models. Set stream to false whenever you pass response_format.
Reported, thanks
Step 9 of 9
Start with a basic prompt and refine it based on evaluation results.
Prompt versions are immutable, so every edit creates a new version you can roll back from.
Compare prompt versions with evaluation runs on the same dataset and judges, not the text diff.
Think first How would you stop an LLM app from leaking secrets or following a jailbreak, both in evaluation and at the gateway?
Why it matters: Questions describe a risk such as PII, secrets or jailbreaks and ask which guardrail scorer or gateway policy blocks it.
Guardrails work at two points. Guardrails AI scorers in MLflow check outputs and inputs with rules, without LLM calls. Unity Gateway service policies sit in the request path and can block interactions as they happen.
Reported, thanks
Step 2 of 8
Term
Meaning
Guardrails AI scorer
A Guardrails validator used as an MLflow scorer for rule-based checks.
Service policy
A Unity Gateway policy, in Beta, that can inspect and block gateway traffic.
Fail closed
Deny the interaction whenever a check errors or returns something unexpected.
Rank
Sets policy order: the lowest rank runs first on requests and last on responses.
Reported, thanks
Step 3 of 8
Guardrails validators become MLflow scorers with no LLM calls. Install the guardrails-ai package first. Pass validator settings, such as a threshold, as keyword arguments to the constructor, or build a scorer by name with get_scorer.
Reported, thanks
Step 4 of 8
Pick the validator that matches the harm you fear. Note which side each one checks: the jailbreak check reads the input, while the others read the output.
Guardrails AI validators and what they detect
Validator
Checks
Detects
SecretsPresent
Output
API keys, tokens or other secrets
DetectPII
Output
Personally identifiable information
DetectJailbreak
Input
Jailbreak or prompt injection attempts
Exam trap DetectJailbreak does not scan the model's output; it looks for jailbreak or prompt injection attempts in the input.
Reported, thanks
Step 5 of 8
Workspace admins turn on service policies as a preview. Opt into the Unity Gateway Service Policies preview. While you review a policy, Log mode records its decisions but blocks nothing. With several policies, Rank sets the order.
Reported, thanks
Step 6 of 8
A Python policy calls Bedrock ApplyGuardrail on each message. It blocks the interaction when Bedrock intervenes, and it fails closed on errors. A function that declares a service credential must set environment_version = '6', or it fails with CREDENTIALS_UNSUPPORTED_ENVIRONMENT.
Exam trap A Python policy cannot redact; a Bedrock guardrail that would mask sensitive data denies the whole interaction instead.
Reported, thanks
Step 7 of 8
On MCP, the policy checks tool calls, not tool results. Before a tool runs, the policy passes its name and arguments to Bedrock as input. Anything the tool returns goes unchecked by this policy.
Exam trap The Bedrock policy does not inspect MCP tool results, only the tool name and arguments sent before the call.
Reported, thanks
Step 8 of 8
Guardrails AI scorers give rule-based checks in MLflow without LLM calls.
DetectJailbreak checks inputs; SecretsPresent and DetectPII check outputs.
Set a policy's Mode to Log to record decisions without blocking.
Python policies cannot redact, so masking guardrails deny the interaction.
Think first When should you serve your own LLM instead of using a model Databricks already hosts?
Why it matters: Questions describe an application's model needs and ask which serving option or GPU type fits.
Use Foundation Model APIs when they serve the model you need, unchanged. Serve a custom LLM only for models they do not support, such as your own fine-tuned LLM, and size the GPU to the model.
Reported, thanks
Step 2 of 9
Term
Meaning
Foundation Model APIs (FMAPI)
The option to use when it serves the model you need unchanged; it is simpler to use and highly optimized.
Custom LLM serving
Serving your own open model on a GPU endpoint, currently in Public Preview.
LoRA adapter
An adapter applied to a base model; one endpoint can serve several on the same base model.
Scale-to-zero
Stopping all replicas when an endpoint is idle, so the next request waits for startup.
Reported, thanks
Step 3 of 9
If FMAPI serves your model unchanged, use FMAPI. It is simpler to use and highly optimized. System-provided model services are open to all account users by default. You can also chat with them in AI Playground.
Exam trap Custom serving is not the default for a standard model. When FMAPI already serves that model unchanged, FMAPI is the advised path.
Reported, thanks
Step 4 of 9
Custom serving covers models FMAPI does not support. Examples are a new LLM, a speech-to-text model, an embedding model, or an LLM you fine-tuned on AI Runtime. This feature is in Public Preview.
Exam trap Custom serving does not fit every model. Skip it when the model does not fit on a single GPU with about 80 GB of memory.
Reported, thanks
Step 5 of 9
Pick the workload type by the model's size. GPU_XLARGE is recommended for large LLMs and has region limits. It also does not support scale-to-zero.
GPU workload types for custom LLM serving
Feature
GPU_MEDIUM
GPU_XLARGE
Hardware
1x A10G, 24 GB
1x H100, 80 GB
Best for
Models up to about 10B parameters
Large LLMs
Availability
Generally available
us-west-2 only, with enrollment
Reported, thanks
Step 6 of 9
Size workload_size for your peak traffic. Custom LLM endpoints currently do not autoscale dynamically. For production traffic, turn off scale-to-zero. An idle endpoint takes one to several minutes to start again.
Exam trap Scale-to-zero is a poor fit for production. The first request after an idle period waits while the model loads again.
Reported, thanks
Step 7 of 9
One endpoint can serve several LoRA adapters on one base model. vLLM loads the base model one time. It then applies whichever adapter each request names.
Reported, thanks
Step 8 of 9
The Custom LLM agent offering is legacy. For custom text tasks on your data, use AI Functions such as ai_query. Optimizing a Custom LLM agent needs at least 100 inputs. It weighs cost against quality with MLflow and Agent Evaluation.
Reported, thanks
Step 9 of 9
Use FMAPI when it serves your model unchanged; it is simpler and highly optimized.
Serve a custom LLM for unsupported open models or an LLM you fine-tuned yourself.
GPU_MEDIUM suits models up to about 10B parameters; GPU_XLARGE suits large LLMs.
Custom LLM endpoints do not autoscale, so size for peak and turn off scale-to-zero in production.
Think first How should chunk size, expected queries and cost goals steer your choice of an embedding model's context length?
Why it matters: Questions give a chunk size and a priority such as cost or quality, and ask which embedding model fits best.
An embedding model's context length should fit the chunks you feed it. A bigger window is not free, because larger context or dimension models add cost and latency. Chunk the documents to fit, then, when cost leads, pick the model that just covers the chunk size.
Reported, thanks
Step 2 of 9
Term
Meaning
Context length
The most tokens an embedding model accepts in one input. GTE accepts up to 8192.
Chunking
Splitting documents into smaller pieces so each one stays within the model's context limit.
Embedding dimension
A size property of an embedding model, such as 384 dimensions. Larger dimension models add cost and latency.
Cold start
The startup overhead of a Model Serving endpoint, felt most when it has scaled down to zero.
Reported, thanks
Step 3 of 9
Chunk documents so no piece goes past the model's context limit. The GTE model accepts up to 8192 tokens. Even so, smaller chunks are recommended. They let a RAG application pass a wider variety of examples to the reasoning model.
Exam trap A large window does not mean each chunk should fill it. Smaller chunks give the reasoning model more varied examples, even with GTE's 8192-token limit.
Reported, thanks
Step 4 of 9
Capped chunks call for a model whose window just covers them. Say chunks stop at 512 tokens, and cost and latency outweigh quality. Then a 512-context model is the efficient pick, for example one of 0.13GB with 384 dimensions. A larger context or dimension adds cost and latency with no benefit.
Exam trap Picking the largest window to be safe is the classic wrong answer. With 512-token chunks and cost first, a bigger model only adds expense and delay.
Reported, thanks
Step 5 of 9
Use a hosted model, serve an open one, or log your own. A served open model such as e5-small-v2 can be used with AI Search, and so can your own MLflow-logged model. Foundation Model APIs offer gte-large-en pay-per-token.
Three ways to get an embedding model
Option
What you do
Example
Foundation Model APIs
Call the pay-per-token endpoint
gte-large-en
Open source model
Serve it on a Model Serving endpoint
e5-small-v2
Your own model
Log it with MLflow as a custom Python model
Any model with the expected signature
Reported, thanks
Step 6 of 9
A custom embedding model takes one string and returns a tensor. Its input schema is a single ColSpec string. Its output schema is TensorSpec, and the embeddings come back in a NumPy array.
Reported, thanks
Step 7 of 9
A managed-embeddings index names a text column and an endpoint. In a Delta Sync index, set embedding_source_column to the text column. Set embedding_model_endpoint_name to the serving endpoint. In the GTE example, the chunked Delta table is written with delta.enableChangeDataFeed set to true.
Reported, thanks
Step 8 of 9
Frequent queries favor GPU endpoints that stay above zero. Each Model Serving endpoint pays a cold start overhead, so avoid scaling down to 0 when queries are frequent. In LangChain, import DatabricksEmbeddings and set its endpoint parameter. From outside the workspace, use the OpenAI client directly. The ai_query SQL function is in Public Preview.
Exam trap Letting an embedding endpoint scale to zero is a poor fit for frequent queries, because Model Serving endpoints carry cold start overhead.
Reported, thanks
Step 9 of 9
Chunk documents so each piece fits the embedding model's context limit.
With 512-token chunks and cost first, a small 512-context model beats larger ones.
Smaller chunks give the reasoning model a wider variety of examples, even when the window is larger.
Custom models are logged with MLflow: one ColSpec string in, TensorSpec out.
Think first Given a task, how would you narrow a model hub down to one model you can safely deploy and pay for?
Why it matters: Questions describe a task and its constraints, then ask which model origin, license or serving mode fits.
Where a model comes from shapes how you serve it. Hosted base models are ready per token, and outside models arrive through External models. Provisioned throughput supports fine-tuned and custom-weight models, and Hugging Face models can also be served as MLflow custom models.
Reported, thanks
Step 2 of 10
Term
Meaning
Pay-per-token
Pricing for Databricks-hosted base models that are ready to use right away.
Provisioned throughput
A serving mode for production work needing high throughput, guarantees, fine-tuned models or extra security.
External models
The way to reach foundation models hosted outside Databricks, governed centrally from Databricks.
AI Playground
A chat-like space in the workspace to test, prompt and compare LLMs.
Reported, thanks
Step 3 of 10
Find base models in Marketplace or bring them from Hugging Face. Base models are available through Databricks Marketplace. You can also pull one from Hugging Face or elsewhere and register it in Unity Catalog, which works for fine-tuned variants too.
Reported, thanks
Step 4 of 10
The e5-small-v2 embedding model is released under the MIT license. It is published on Hugging Face as intfloat/e5-small-v2.
Reported, thanks
Step 5 of 10
Hosted base models start immediately with pay-per-token pricing. Examples include Mistral-7B, GTE-Large and Meta-Llama-3.3-70B-Instruct. Find them under AI Gateway in the sidebar, on the Models tab. System-provided services in system.ai work for every account user by default.
Exam trap System-provided models in system.ai need no extra setup. All account users can query them by default.
Reported, thanks
Step 6 of 10
Use provisioned throughput for production guarantees. Provisioned throughput also serves fine-tuned variants and fully custom weights built on a supported architecture, such as CodeLlama. Models hosted elsewhere, such as GPT-4, come in through External models.
Which option fits which kind of model
Feature
Pay-per-token
Provisioned throughput
External models
Model
Databricks-hosted base models
Base, fine-tuned or custom-weight models
Models hosted outside Databricks
Fits
Immediate use
Production needing guarantees or security
Central governance of outside providers
Exam trap A model fine-tuned on proprietary data does not run as a pay-per-token base model. Serve it with provisioned throughput.
Reported, thanks
Step 7 of 10
Provisioned throughput comes on demand or reserved. On-demand capacity has no term commitment. Reserved capacity is held for a fixed 1- or 3-month term.
Reported, thanks
Step 8 of 10
Package a Hugging Face model as an MLflow custom model. Download it from the Hugging Face Hub, register it in the MLflow Model Registry and start a Model Serving endpoint. Custom models can live in Unity Catalog or the workspace model registry.
Reported, thanks
Step 9 of 10
Test candidates side by side, then swap freely. Use AI Playground to prompt and compare LLMs. Foundation Model APIs let you swap a production model for a better one. You can also replace a proprietary model with an open one for cost and performance.
Reported, thanks
Step 10 of 10
Hosted base models like Mistral-7B are ready now with pay-per-token pricing.
Provisioned throughput supports fine-tuned and custom-weight models.
Reach models hosted outside Databricks, such as GPT-4, through External models.
Check a hub model's license, such as MIT for e5-small-v2, before using it.
Think first When two LLMs score similarly in your experiments, which metrics and serving choices should decide between them?
Why it matters: Questions give experiment or serving metrics and ask which model or serving option best fits the task.
Separate what the model controls from what the serving system controls. Quality comes from the model, while latency and throughput come from serving. Compare models on quality, then size serving to meet latency and load goals.
Reported, thanks
Step 2 of 8
Term
Meaning
P90 latency
The time within which 90% of requests finish; a P90 of 30 ms means 90% took 30 ms or less.
Throughput
Requests or queries per second; it falls as latency rises and grows with concurrency.
Queue time
Time requests wait before running; high values mean the endpoint is under-provisioned.
Priority mode
Pay-per-token requests sent with service_tier set to priority, admitted ahead of standard traffic.
Reported, thanks
Step 3 of 8
Quality belongs to the model; latency and throughput to serving. Foundation Model APIs make it easy to compare LLMs for a use case or swap in a better one. You can also replace proprietary models with open ones to balance cost and performance.
Exam trap A slow response does not prove the model is worse; latency and throughput depend on the serving system.
Reported, thanks
Step 4 of 8
The Latency metric reports P50 and P99 round trips. It measures time inside Databricks and leaves out authentication and rate limiting. The error rate metric counts 4xx and 5xx responses per second, averaged over each minute.
Reported, thanks
Step 5 of 8
Find the concurrency ratio that maximizes RPS without queuing. Throughput rises with concurrency and falls as latency grows. Queuing is on by default, so extra requests wait and their latency grows. Rising queue time means you should widen the compute scale-out range.
Exam trap Elevated queue time is not a model quality problem; it signals an under-provisioned endpoint.
Reported, thanks
Step 6 of 8
Match the serving mode to the workload's stage and needs. Priority mode needs no commitment. Reserved provisioned throughput locks capacity for 1 or 3 months, while on-demand has no term.
Foundation Model APIs serving modes compared
Mode
Recommended for
Key detail
Pay-per-token
Getting started with Foundation Model APIs
The easiest way to begin
Priority pay-per-token
Latency-sensitive production under load
Opt-in per request, higher per-token rate
Provisioned throughput
High throughput, guarantees, fine-tuned models, security
On-demand has no term; reserved is 1 or 3 months
Reported, thanks
Step 7 of 8
A Small CPU endpoint creates four model instances. Endpoint size sets how many instances of your model run on the endpoint, so check it when you plan for load.
Reported, thanks
Step 8 of 8
Judge models on result quality; latency and throughput are serving traits.
A P90 of 30 ms means 90% of requests finished in 30 ms or less.
Provisioned throughput suits high-throughput or fine-tuned production workloads and offers HIPAA-certified endpoints.
Think first How do traces, scorers and judges fit together when you build, test and monitor an agent with MLflow?
Why it matters: Questions describe an agent development task and ask which MLflow object or call handles it.
A trace records one agent run as a tree of spans. Scorers read traces and return feedback, often by calling a judge. The same scorers power offline evaluation runs and live production monitoring.
Reported, thanks
Step 2 of 9
Term
Meaning
Span
One operation inside a trace. The root span is the whole request; child spans are its sub-steps.
Scorer
A function that reads a trace and returns a Feedback assessment.
Judge
An evaluator of text, such as is_correct, that cannot read a trace on its own.
Expectation
A domain expert's ground truth: the correct output for a given input.
Session
A tag, mlflow.trace.session, that groups the traces of one multi-turn conversation.
Reported, thanks
Step 3 of 9
A trace is one complete agent run, stored as a tree of spans. It keeps the top-level inputs and outputs and each LLM call, retriever lookup and tool call. It also records latency, token usage, cost and errors. Set mlflow.trace.session on each trace to group a multi-turn conversation.
Reported, thanks
Step 4 of 9
For LangGraph, mlflow.langchain.autolog() captures traces. LangGraph relies on LangChain's autolog. Mark the retrieval step with span_type="RETRIEVER" so retrieval-specific judges can run.
Example: Turns on automatic tracing for a LangGraph agent through LangChain autologging.
mlflow.langchain.autolog()
Reported, thanks
Step 5 of 9
Scorers pull fields from a trace and pass them to a judge. A judge such as mlflow.genai.judges.is_correct evaluates text but cannot read a trace. If you list a built-in judge directly in scorers, MLflow wraps it in a scorer for you.
Example: Passes the built-in Correctness judge straight to an evaluation, where MLflow wraps it as a scorer.
scorers=[Correctness()]
Exam trap A judge alone cannot evaluate a trace. A scorer must first extract fields such as the request, response or retrieved context.
Reported, thanks
Step 6 of 9
mlflow.genai.evaluate() takes a dataset and a list of scorers. It runs the agent on every input and applies each scorer to every trace. Aggregated pass rates and metrics are stored next to the traces. Expectations are optional, but they allow the most precise scoring, such as Correctness against a known-good answer.
Exam trap You do not need expectations to get value from MLflow. Feedback is the main signal, and expectations add precision when you have them.
Reported, thanks
Step 7 of 9
The same scorer works offline and on live traffic. Production monitoring runs attached scorers on incoming traces on a rolling basis. It writes the feedback back to the same trace.
Reported, thanks
Step 8 of 9
Databricks offers the same MLflow product, fully managed. You keep the standard MLflow SDK and OpenTelemetry, and you never run a tracking server or maintain versions. Traces are stored as Unity Catalog Delta tables, with governed access, SQL queries and no per-experiment storage cap.
Reported, thanks
Step 9 of 9
A trace is a tree of spans: the root is the request, and children are its sub-steps.
Scorers adapt traces for judges; judges alone cannot read a trace.
One scorer serves both mlflow.genai.evaluate() and production monitoring.
Group multi-turn traces with the mlflow.trace.session tag.
Think first How does checking a Gen AI app before release differ from watching its quality once real users arrive?
Why it matters: Questions describe a stage of the Gen AI life cycle and ask which evaluation or monitoring practice fits it.
Evaluation runs during development against a curated set of queries. Monitoring runs after deployment on real production traces. Both rest on the same parts, so the same scorers can serve both phases.
Reported, thanks
Step 2 of 8
Term
Meaning
Evaluation set
A curated set of queries, ideally with expected outputs, that reflects how the app is meant to be used.
Evaluation harness
A tool that runs the app on every evaluation record and scores each output.
Scorer
An MLflow 3 check that assesses the quality of an app's traces.
LLM judge
A different LLM that reviews outputs so evaluation can scale.
Reported, thanks
Step 3 of 8
Evaluation is in development; monitoring is in production. The phases run at different times and on different inputs, but their core components are similar. Using the same scorers in both keeps results consistent, and lessons from production feed back into evaluation.
Evaluation and monitoring compared
Feature
Evaluation
Monitoring
When
During development
After deployment to production
Inputs
A curated evaluation set
A sample of incoming production traces
How it runs
A harness runs every record through judges and metrics
Scheduled scorers run on traces automatically
Exam trap Evaluation and monitoring do not need different scorers; reusing the same ones keeps the two phases consistent.
Reported, thanks
Step 4 of 8
Gen AI answers can be right in many ways. Outputs are non-deterministic, and some right answers are better than others. Human feedback gives confidence, while LLM-judged metrics let evaluation scale. A separate LLM can assess groundedness over long context, which human raters cannot do at scale.
Reported, thanks
Step 5 of 8
Monitoring needs traces from MLflow Tracing. Log inputs, outputs and intermediate steps such as document retrieval. That record lets you spot and diagnose problems early once the app is live.
Reported, thanks
Step 6 of 8
Register a scorer, then start it with a sample rate. Monitoring begins when you start the scorer with .register() and .start(). Allow 15 to 20 minutes for the first processing. An experiment can have at most 20 monitoring scorers at once.
Exam trap Class-based Scorer subclasses cannot be registered for monitoring; only @scorer decorator scorers can be serialized.
Reported, thanks
Step 7 of 8
Sample critical scorers fully and costly ones lightly. Use sample_rate=1.0 for safety and security scorers. For expensive scorers such as complex LLM judges, a rate between 0.05 and 0.2 keeps costs down.
Exam trap Running every complex LLM judge at a sample rate of 1.0 is not the recommended default; save full sampling for critical checks.
Reported, thanks
Step 8 of 8
Evaluation happens in development and monitoring in production, with similar core parts.
Reuse the same scorers across both phases for consistent results.
Production monitoring needs MLflow Tracing and allows at most 20 scorers per experiment.
Only @scorer decorator scorers can be registered for monitoring.
Think first How would you let an agent in a multi-agent system pull data from Genie, and which Genie option fits?
Why it matters: Questions describe an agent's data needs and governance rules and ask which Genie MCP option or setting fits.
Agents reach Genie through MCP servers instead of writing SQL themselves. The Genie Agent MCP server queries one curated Genie Agent, while Genie One MCP runs through Unity Gateway. The choice changes governance and permissions, and Genie One answers asynchronously.
Reported, thanks
Step 2 of 9
Term
Meaning
Genie Agent
A curated set of Unity Catalog tables, views or metric views, 50 at most.
Genie Agent MCP server
A read-only server that lets an agent ask one Genie Agent plain-language questions.
Genie One MCP server
A Databricks-provided MCP, named system.ai.genie_one_mcp, that Unity Gateway governs.
Supervisor Agent
An agent that coordinates Genie Agents, agent endpoints, functions, MCP servers and custom agents.
Reported, thanks
Step 3 of 9
Genie Agent MCP targets one Genie Agent; Genie One MCP uses Unity Gateway. With the Genie Agent MCP server, the agent sends a plain-language question. Genie writes and runs the SQL, enforcing Unity Catalog permissions on every request.
Genie Agent MCP and Genie One MCP compared
Feature
Genie Agent MCP server
Genie One MCP server
Unity Gateway
Bypassed; gateway tracing, grants, policies and guardrails don't apply
Governed through Unity Gateway
Access needs
Permissions on the Genie Agent and its data
EXECUTE on system.ai.genie_one_mcp
Exam trap Unity Gateway guardrails do not protect Genie Agent MCP calls. Those calls never pass through the gateway.
Reported, thanks
Step 4 of 9
The Genie Agent MCP server is read-only and keeps no conversation history. It queries data but never writes to tables. Because it calls Genie as a tool, no history reaches the Genie API. Its scope is the Genie Agent's curated data, not the whole workspace.
Exam trap Follow-up questions do not carry earlier context. The server sends no conversation history to the Genie API.
Reported, thanks
Step 5 of 9
A workspace admin must turn on Managed MCP Servers first. That switch is on the workspace Previews page. Genie Agent MCP calls are billed at Databricks SQL pricing. The older Beta endpoint, /api/2.0/mcp/genie, is deprecated; its end of life is November 30, 2026.
Reported, thanks
Step 6 of 9
genie_ask starts an answer and returns in_progress right away. It also returns a conversation_id and response_id while Genie keeps working. genie_ask and genie_poll_response return truncated results to protect the context window; genie_get_query_result returns the full schema and rows.
Exam trap Truncated results are not the whole answer. When the agent needs every row, it calls genie_get_query_result.
Reported, thanks
Step 7 of 9
Calling Genie One MCP needs EXECUTE on system.ai.genie_one_mcp. Its securable type is mcp_service. On-behalf-of user OAuth is the recommended authentication; service principals also work for programmatic and automated workloads.
Reported, thanks
Step 8 of 9
A supervisor steers away from subagents a user cannot access. If the user can reach none of its subagents, the supervisor ends the conversation. A Supervisor Agent can coordinate Genie Agents alongside endpoints, functions and MCP servers.
Reported, thanks
Step 9 of 9
Genie Agent MCP calls skip Unity Gateway; access rests on Genie Agent and data permissions.
The Genie Agent MCP server is read-only and sends no conversation history.
Genie One MCP needs EXECUTE on system.ai.genie_one_mcp.
Call genie_get_query_result when an agent needs complete query results.
Each topic's Check tested it on its own; this mixes them.
Mixed quiz
Take the Domain 3 quiz
14 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.