Knowledge Retrieval and Genie Configuration · Topic 4 of 4
Retrieval Failure Modes and Authoritative Source Governance
Databricks Context Engineer: read MLflow eval logs and UC metadata to name a retrieval failure, then limit agent retrieval to authoritative sources.
- 5 min
- MLflow 3 traces show what each step retrieved; scorers measure retrieval relevance and groundedness.
- Relevant and grounded but wrong means the source itself is bad: stale, derived or unofficial.
- UC lineage, owners, comments and governed tags identify authoritative versus derived assets.
What it is
A retrieval failure is a wrong answer caused by what reached the context, not by the model's reasoning. MLflow 3 traces record which documents and tables each step retrieved, and evaluation scorers say whether that context was relevant and whether the answer was grounded in it.
Unity Catalog metadata then tells you where the retrieved data came from: its owner, comments, tags and lineage. Governance actions in Unity Catalog, such as grants, index scope and tags, fix the failure at its source rather than in the prompt.
How it works
Reading the evaluation logs
Run mlflow.genai.evaluate() over an evaluation set with retrieval scorers, then open the traces of the failing rows. The pattern of scores separates the failure modes.
import mlflow
from mlflow.genai.scorers import (
Correctness, RetrievalRelevance, RetrievalGroundedness)
results = mlflow.genai.evaluate(
data=eval_df, predict_fn=agent_answer,
scorers=[RetrievalRelevance(), RetrievalGroundedness(), Correctness()])
| Pattern in the logs | Failure mode | Where to look next |
|---|---|---|
| Low retrieval relevance | Retrieval returns off topic chunks | Chunking, query settings, index scope |
| High relevance, low correctness, grounded answer | Retrieved source is wrong, stale or derived | Source table in the trace and its UC metadata |
| Expected fact exists in the source but is never retrieved | Access controls hide it from the agent's identity | Grants, row filters on the identity used |
| Relevant context, low groundedness | The model ignores or goes beyond the context | Prompt and model, not retrieval |
The second row is the one this objective targets. The answer faithfully repeats the context, and the context itself is the problem.
Using UC metadata to name the cause
Once a trace names the table or index that supplied a bad fact, Unity Catalog shows why it was wrong.
| Metadata finding | Meaning |
|---|---|
| Lineage shows the table is built from a gold table | A derived copy, possibly a stale snapshot |
| Table comment says "sandbox" or "experimental" | Not an authoritative source |
| Owner is a personal user, not a data team | Unreviewed, possibly abandoned |
| No governed tag marking it authoritative | Outside the approved set |
Governance actions that fix it
| Failure cause | Most direct governance action |
|---|---|
| Agent can read a derived or sandbox table | Revoke SELECT on it from the agent's service principal |
| Index built over a mix of approved and draft documents | Rebuild the index from an authoritative only source table |
| Authoritative and derived assets look alike | Apply a governed tag and document each in comments |
| Agent sees rows or columns it should not | Row filters and column masks on the source for that identity |
| Genie space includes copies of gold tables | Remove the copies from the space |
The fix should act where the agent's access is defined. Telling the model "prefer official tables" in a prompt is weaker, because the derived table is still reachable and will still be retrieved.
Designing the retrieval space before deployment
- Identify authoritative assets. Use lineage, owners and comments to find the governed gold tables and approved document volumes, and the derived copies built from them.
- Mark them. Apply a governed tag to authoritative assets and describe each in its comment.
- Grant by least privilege. The agent runs as an identity, often a service principal. Grant it USE CATALOG, USE SCHEMA and SELECT only on the authoritative schema, tables and indexes.
- Scope every retrieval channel. Build AI Search indexes only from authoritative source tables, and add only authoritative tables and views to Genie spaces.
- Verify. Run an MLflow evaluation and inspect traces to confirm no derived source appears in retrieved context.
GRANT USE CATALOG ON CATALOG finance TO `<agent-sp-application-id>`;
GRANT USE SCHEMA ON SCHEMA finance.gold TO `<agent-sp-application-id>`;
GRANT SELECT ON SCHEMA finance.gold TO `<agent-sp-application-id>`;
A service principal is named by its application ID in GRANT statements. Putting authoritative assets in their own schema makes the grant simple and keeps new derived tables out by default.
How the exam asks about this
- "Retrieval relevance is high but answers quote last quarter's prices; the trace shows a table whose lineage points to the gold price table." The source is a derived copy; revoke the agent's access to it and keep the gold table.
- "Before launch, the catalog holds gold tables, analyst extracts and sandbox copies." Put authoritative assets in a dedicated schema, grant the agent identity only that, and index only from it.
- "Answers are relevant and grounded in the context but still wrong." The context source is the problem, not the model; check the source's UC metadata.
What to remember for the exam
- MLflow 3 traces show what each step retrieved; scorers measure retrieval relevance and groundedness.
- Relevant and grounded but wrong means the source itself is bad: stale, derived or unofficial.
- UC lineage, owners, comments and governed tags identify authoritative versus derived assets.
- Fix access where it is defined: grants to the agent's identity, index source tables and Genie space contents.
- Row filters and column masks apply to the identity the agent runs as.
- Constrain the retrieval space before deployment, then confirm it with an evaluation run.
A prompt instruction is not a governance control. If the agent's identity can still read a derived table, retrieval can still return it; remove the access.
Common mistakes
Blaming the model for a source problem. When the answer matches the retrieved context exactly, a better model or prompt will repeat the same wrong fact. Trace the source.
Granting the whole catalog. A catalog wide SELECT grant pulls in every future sandbox and extract table. Grant the authoritative schema only.
Scoping only one channel. Restricting table grants but leaving a mixed AI Search index or a Genie space with copies still lets derived data in. Scope every retrieval path.
Check yourself
What does high retrieval relevance with wrong but grounded answers suggest?
The retrieved source is wrong, stale or derived, so the agent faithfully repeats bad data and the fix is at the source.
Which UC feature shows that a table was built from a gold table?
Lineage, which records the upstream tables a table was derived from.
What is the most direct way to keep an agent away from derived tables?
Grant the agent's identity SELECT only on the authoritative schema and indexes, so derived assets are not reachable.
Topic 4 of 4 in Knowledge Retrieval and Genie Configuration
Test yourself on Knowledge Retrieval and Genie Configuration
The full Databricks Context Engineer Associate question bank has 600 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Databricks. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.