Think first How do a document's layout and your model's limits shape the chunk size, overlap and tools you choose?
Why it matters: Questions describe documents and model constraints and ask which chunking, parsing or embedding choice fits.
Chunking is a trade-off. Chunk size and overlap set how many embeddings you create, while model context and service limits cap what each step can take. Parse complex documents first, then chunk to fit the model.
Reported, thanks
Step 2 of 9
Term
Meaning
Chunk overlap
Text shared between neighboring chunks; more overlap means more chunks.
ai_parse_document
The Document Parsing function that pulls structured data out of files like PDFs and slides.
ai_prep_search
A Beta step that prepares parsed output for retrieval.
Context length
How many tokens an embedding model accepts per input.
Reported, thanks
Step 3 of 9
Bigger chunks and less overlap mean fewer embeddings. Smaller chunks or more overlap raise the chunk count, and with it the number of embeddings. When you must stay under an embedding limit, grow the chunks or cut the overlap.
Exam trap Adding overlap does not reduce the number of chunks; it increases the embedding count.
Reported, thanks
Step 4 of 9
Fit the embedding model's context to your chunk cap. If chunks are capped at 512 tokens and cost and latency matter more than quality, a 512-token model is the efficient pick. A bigger context or dimension adds cost and latency with no gain.
Exam trap A larger-context embedding model is not better for chunks capped at 512 tokens; it only adds cost and latency.
Reported, thanks
Step 5 of 9
Document Parsing handles tables, charts and mixed content. It reads PDFs, images, Word and PowerPoint files. Then use ai_prep_search downstream to get the parsed output ready for RAG.
Default limits of the ai_parse_document REST API
Limit
Value
Scope
Request rate
250 requests per minute
Per workspace
Pages
100 pages
Per document
Reported, thanks
Step 6 of 9
Rate and payload limits also shape your plan. Foundation and external model endpoints accept at most 4 MB per request. GTE Large (En) defaults to 540,000 requests per hour, while BGE Large (En) and Qwen3-Embedding-0.6B allow 2,160,000.
Reported, thanks
Step 7 of 9
Query with the embedding model that built the index. With a Databricks embedding endpoint, use the same model that created the index vectors. With direct-access indexes, or Delta Sync with self-managed embeddings, set a custom embedding model and text column on VectorSearchRetrieverTool.
Reported, thanks
Step 8 of 9
Truncate big chunk columns in a retriever UDF. SQL clients may limit the rows or bytes they return. Trimming the column, for example with substring(chunked_text, 0, 8192), avoids row truncation.
Reported, thanks
Step 9 of 9
Larger chunks and less overlap produce fewer chunks and fewer embeddings.
Pick an embedding model whose context matches your chunk cap when cost matters most.
ai_parse_document allows 100 pages per document and 250 requests per minute per workspace.
With a Databricks embedding endpoint, query using the model that created the index vectors.
Think first Which content should you strip from source documents before it reaches your RAG index?
Why it matters: Questions describe a noisy document set and ask which cleaning, filtering or deduplication step fixes it.
Noise in source documents lowers retrieval and answer quality. Parse documents well, clean out noise, filter unwanted documents and remove duplicates before chunks reach the index.
Reported, thanks
Step 2 of 9
Term
Meaning
Boilerplate
Repeated noise such as headers, footers and page numbers that cleaning removes.
Filtering
The pipeline step that removes irrelevant or unwanted documents from the collection.
Near duplicate
A document whose content nearly matches another; left in, it creates redundant chunks.
MinHash
A locality-sensitive hashing technique for finding near duplicates, available in Spark ML.
Reported, thanks
Step 3 of 9
For PDFs and complex documents, use ai_parse_document. Poor parsing, such as missing tables or broken formatting, directly hurts retrieval quality. Review a sample of parsed output by hand on a regular basis. Store the raw source data in a target table for traceability and auditing.
Reported, thanks
Step 4 of 9
Remove boilerplate but keep the document's structure. Strip headers, footers, page numbers and special characters. Keep headings, lists and tables intact. Less malformed text means less noise for the chain to process.
Exam trap Cleaning does not mean removing all formatting. Headings, lists and tables are structure you should preserve.
Reported, thanks
Step 5 of 9
Filtering drops documents your agent should not use. Documents may be irrelevant, too old, unreliable, harmful or sensitive. Every document source is also a possible path for data poisoning.
Problem documents and how to filter them
Problem
Example
Filter by
Harmful language
Toxic text in a document
A toxicity classifier's prediction
Sensitive information
Personal details you must not expose
A PII detection algorithm
Data poisoning
Documents planted by bad actors
Detection and filtering mechanisms
Irrelevant or outdated content
Documents off the agent's purpose
Metadata about each document
Reported, thanks
Step 6 of 9
Duplicates create redundant chunks that hurt performance. Metadata alone catches some, such as the same title and creation date in different locations. For content-based near duplicates, use locality-sensitive hashing with MinHash in Spark ML.
Exam trap Keeping any one copy is not the best fix. Prefer the best version, such as the most recently updated or most authoritative one.
Reported, thanks
Step 7 of 9
Hash the vectors with MinHash, then run a similarity join. The MinHash hashes measure Jaccard distance. A similarity join on those hashes returns each duplicate or near duplicate document.
Reported, thanks
Step 8 of 9
Smaller, focused chunks limit irrelevant content. Split large documents into semantically concentrated chunks. Retrieved data then fits the LLM's context, with less distracting information mixed in.
Reported, thanks
Step 9 of 9
Use ai_parse_document for PDFs and complex documents; poor parsing hurts retrieval.
Remove headers, footers and page numbers, but keep headings, lists and tables.
Filter out irrelevant, outdated, harmful or sensitive documents before indexing.
Find near duplicates with MinHash in Spark ML, and keep the best version.
Think first How do you pick the right tool to turn a raw source file into text, fields or search chunks?
Why it matters: Questions describe source files and a goal, and ask which function or Python package extracts the content.
Parsing comes first: ai_parse_document turns raw files into a structured bronze layer. Other functions then work on that output, pulling fields, assigning labels or building search chunks. Scanned images need OCR, so pytesseract fits where HTML scrapers do not.
Reported, thanks
Step 2 of 9
Term
Meaning
Bronze layer
The standardized parsed output that captures text, tables or image descriptions, and document structure.
OCR
Needed to get text out of scanned images; pytesseract extracts image text with minimal code.
Semantic chunk
A piece of a parsed document enriched with titles, section headers and page references for AI Search.
ai_extract
Pulls structured fields from documents or plain text using a schema you define.
Reported, thanks
Step 3 of 9
ai_parse_document turns raw files into a bronze layer. The layer captures text, tables or image descriptions, and document structure. The function reads its input from a Unity Catalog volume. It handles PDFs, images, Word and PowerPoint files, including complex layouts such as tables and charts.
Exam trap Parsing is not limited to PDFs. Word documents, PowerPoint files and images are supported too.
Reported, thanks
Step 4 of 9
Each downstream function serves one goal.ai_extract and ai_classify work directly on parsed output, with no extra transformation step. Use ai_prep_search (Beta) downstream when the parsed output feeds RAG retrieval.
Three functions that work on parsed documents
Feature
ai_extract
ai_classify
ai_prep_search
What it does
Pulls structured fields using your schema
Assigns predefined categories
Builds semantic chunks for AI Search
Works on
Documents or plain text
Documents or text
Parsed documents
Detail to know
Runs directly on parsed output
Supports up to 500+ labels
Beta; adds titles, headers and page references
Exam trapai_classify does not pull field values; it assigns predefined labels. Use ai_extract for structured fields.
Reported, thanks
Step 5 of 9
For scanned .jpeg or .png files, use pytesseract. Text inside a scanned image needs OCR, and pytesseract extracts it with minimal code. HTML scraping tools such as beautifulsoup, scrapy and pyquery are not OCR tools.
Exam trapbeautifulsoup sounds like a document parser, but it scrapes HTML. It cannot read text from a scanned image.
Reported, thanks
Step 6 of 9
Missing or garbled text points to the parse or the source file. If the text parsed but a field is wrong, the problem is extraction instead.
Exam trap A wrong field value does not mean the parse failed. If the text is present in the parsed output, look at extraction.
Reported, thanks
Step 7 of 9
The functions run on serverless compute or a SQL warehouse. The region must be a supported one. Parsing is also available in the Agent Bricks UI, the REST API and the Asynchronous API (Beta). A job task (Beta) writes results to a Unity Catalog table and processes only new or changed documents.
Reported, thanks
Step 8 of 9
REST API requests take up to 100 pages per document. The default REST API rate limit is 250 requests per minute per workspace. Information Extraction agents have a 128k token maximum context length and do not support union schema types.
Reported, thanks
Step 9 of 9
Parse first: ai_parse_document builds the bronze layer that later steps use.
Think first Before your pipeline can write chunked text into a Delta table in Unity Catalog, what must be in place, and in what order?
Why it matters: Questions describe a chunk-writing step and ask which table type, namespace or privilege it needs.
Chunked text lands in a table addressed as catalog.schema.table. Writing it needs a chain of privileges, from the catalog down to the table.
Reported, thanks
Step 2 of 8
Term
Meaning
Metastore
The top-level container for Unity Catalog data, scoped to one cloud region.
Managed table
A table whose storage location Unity Catalog decides; the data still lives in your cloud account.
External table
A table stored at a path you specify; Unity Catalog manages only its metadata.
Usage privileges
USE CATALOG and USE SCHEMA, needed on the parents before any table privilege works.
Reported, thanks
Step 3 of 8
Address the target table as catalog.schema.table. A catalog holds schemas, and a schema holds tables, views, volumes and functions. One metastore covers a single cloud region and can serve several workspaces there. Volumes give file access and cannot be queried with SQL, so chunks you query belong in a table.
Exam trap A volume is not a place to query chunks with SQL; volumes give file-level access only.
Reported, thanks
Step 4 of 8
Prefer a managed table for new chunk tables. Databricks recommends managed tables so you get the latest table features.
Managed and external tables compared
Feature
Managed table
External table
Storage path
Decided by Unity Catalog
Specified by you
What Unity Catalog manages
Storage location; data stays in your cloud account
Metadata only, not lifecycle, optimization or layout
Reported, thanks
Step 5 of 8
Writes need a write privilege plus USE CATALOG and USE SCHEMA. Users start with no access to metastore data. Grant SELECT for reads and MODIFY for writes, or finer-grained INSERT, UPDATE and DELETE (Beta). Usage privileges on the parent catalog and schema are needed too. A grant on a schema applies to all its current and future tables.
Exam trap MODIFY on the table alone is not enough; without USE CATALOG and USE SCHEMA the write still fails.
Reported, thanks
Step 6 of 8
Grant CREATE TABLE on the schema plus both usage privileges. A team that creates the chunk table needs all three grants. The owner of an object holds every privilege on it and can grant them to others.
Example: Lets a group create tables in a schema and reach its parents.
GRANT CREATE TABLE ON SCHEMA main.default TO `finance-team`;
GRANT USE SCHEMA ON SCHEMA main.default TO `finance-team`;
GRANT USE CATALOG ON CATALOG main TO `finance-team`;
GRANT USE CATALOG ON CATALOG main: usage on the parent catalog
Reported, thanks
Step 7 of 8
New workspaces come with Unity Catalog turned on. Workspaces created after November 8, 2023 have Unity Catalog enabled automatically. There, all users get USE CATALOG on the workspace catalog and CREATE TABLE on its default schema. Separately, lineage records how data flows across tables, jobs and pipelines, down to columns.
Reported, thanks
Step 8 of 8
Writing needs a write privilege such as MODIFY on the table, plus USE CATALOG and USE SCHEMA on its parents.
Think first Given a RAG use case, how do you decide which documents belong in the corpus and which to leave out?
Why it matters: Questions describe a RAG application and its documents, and ask which ones to include, exclude or clean up.
The right corpus depends on what the application must answer. Include documents that cover those needs. Remove ones that are irrelevant, stale, duplicated or risky, and know the ingestion rules that skip files.
Reported, thanks
Step 2 of 8
Term
Meaning
Data corpus
The set of documents a RAG application can retrieve from to answer queries.
Near-duplicate
A document almost identical to another; it fills the index with redundant chunks.
MinHash
A locality-sensitive hashing technique in Spark ML that finds duplicate or near-duplicate documents.
Data poisoning
An attack that bad actors can launch through any document feed given to an agent.
Reported, thanks
Step 3 of 8
The right documents depend on the app's own requirements and goals. Without the right corpus, the app cannot retrieve what a query needs. For a customer support bot, consider knowledge base articles, FAQs, product manuals and specifications, and troubleshooting guides.
Reported, thanks
Step 4 of 8
Involve domain experts and stakeholders from the start. They help find and curate content that improves the corpus's quality and coverage. The corpus's composition is a key data pipeline consideration.
Reported, thanks
Step 5 of 8
Exclude documents that are irrelevant, outdated, unreliable or harmful. Also hold back documents with sensitive information you do not want the agent to expose. Every document feed is a possible path for data poisoning.
Exam trap More documents are not always better. Context that is missing key information, or full of superfluous information, both make high-quality RAG output hard.
Reported, thanks
Step 6 of 8
Near-duplicate documents create redundant chunks that hurt performance. MinHash, available in Spark ML, finds duplicates and near-duplicates by their content. Ingest the raw data into a target table first, for preservation, traceability and auditing.
Reported, thanks
Step 7 of 8
Knowledge Assistant takes up to 10 knowledge sources. This legacy offering reads pdf, doc/docx, ppt/pptx, txt and md files from a Unity Catalog volume. Some files are skipped automatically and never reach the knowledge base.
Files Knowledge Assistant skips during ingestion
Item
Rule
Effect
Any file
Larger than 100 MB
Skipped
PDF, DOC, DOCX, PPT, PPTX
More than 500 pages; each slide counts as a page
Skipped
TXT and MD
No page limit
Never skipped for length
Any file
Name starts with _ or .
Skipped
Exam trap A 600-slide PPTX is skipped even when the file is small, because each slide counts as a page.
Reported, thanks
Step 8 of 8
Pick documents from the app's requirements; without the right corpus, retrieval fails.
Leave out irrelevant, outdated, unreliable, harmful or sensitive documents.
Deduplicate with MinHash to avoid redundant chunks in the index.
Knowledge Assistant skips files over 100 MB and documents over 500 pages.
Think first Which metric and tool would you use to judge whether a retriever finds the right documents?
Why it matters: Questions describe a retrieval goal and ask which metric, tool or setup measures it.
Retrieval quality is measured apart from answer quality. AI Search can grade each retrieved document's relevance and compute ranking metrics from those grades. Each metric answers a different question about the results.
Reported, thanks
Step 2 of 9
Term
Meaning
Graded relevance
A score from 0 to 3 that an LLM judge gives each query and document pair.
DCG@10
A ranking metric that weighs both relevance and position, using the full 0 to 3 scale.
NDCG
DCG divided by the ideal DCG, giving a score from 0 to 1.
RETRIEVER span
A trace span type that turns on MLflow's retrieval-specific LLM judges.
Reported, thanks
Step 3 of 9
Collect retrieval metrics and response metrics together. A RAG app can answer badly even with the right context retrieved. It can also answer well on top of faulty retrieval.
Reported, thanks
Step 4 of 9
AI Search compares search strategies on your own data. This Beta feature needs a managed Delta Sync index. Every generated query runs with ANN, hybrid and full-text retrieval, and each strategy is tried with and without the reranker.
Exam trap You do not need to own the index. Anyone with query access can start a run, and that user, not the index owner, owns the job.
Reported, thanks
Step 5 of 9
An LLM judge scores each query and document pair on a 4-point scale. Scores run from 0 to 3, and a score of 2 or higher counts as relevant. Every metric carries 95% confidence intervals, so you can tell whether strategy differences are meaningful.
Reported, thanks
Step 6 of 9
Use DCG@10 as the primary metric of overall retrieval quality. The other metrics answer narrower questions, so choose the one that matches your goal.
Retrieval metrics and what each tells you
Metric
What it tells you
Detail
DCG@10
Relevance and ranking position together
The recommended primary metric
NDCG
DCG divided by the ideal DCG
Ranges from 0 to 1; 1.0 is perfect order
MRR
Average of 1/rank of the first relevant result
First relevant means a score of 2 or more
Precision@k
Share of the top-k results that are relevant
Relevant means a score of 2 or more
Recall@k
Completeness, for RAG where a missed document means an incomplete answer
Needs ground truth listing every relevant item
Exam trap Recall cannot be computed from a partial answer key. The ground truth has to contain every relevant item.
Reported, thanks
Step 7 of 9
Each result adds a gain of 2^relevance - 1. That gain is discounted logarithmically by position, so the same relevant result is worth less when it ranks lower.
Reported, thanks
Step 8 of 9
Mark the retrieval function with span_type="RETRIEVER". This turns on MLflow's retrieval-specific LLM judges for that part of your RAG app.
Reported, thanks
Step 9 of 9
DCG@10 is the recommended primary metric for overall retrieval quality.
Use Recall@k when completeness matters; it needs ground truth with every relevant item.
A score of 2 or more counts as relevant for Precision@k and MRR.
Think first How do you choose a chunking strategy that keeps answers precise without losing the context around them?
Why it matters: Questions describe documents and a retrieval goal, and ask which chunk size, strategy or enrichment fits.
Chunk size trades precision for context. Advanced approaches such as semantic chunking take more effort but can have a bigger impact. Rich metadata and high-quality parsing matter more than over-optimizing chunk size.
Reported, thanks
Step 2 of 9
Term
Meaning
Semantic chunking
Grouping sentences by similarity, with embeddings finding natural boundaries, instead of by fixed size.
Parent-child chunking
Searching small child chunks for precision, then returning their larger parent chunks for context.
Semantic metadata
Context added to chunks, such as document summaries and section headers.
Boilerplate
Repeated page clutter such as headers, footers and page numbers, removed before chunking.
Reported, thanks
Step 3 of 9
Small chunks pinpoint facts; large chunks keep context. A 512-token chunk is the balanced starting point. Whatever the size, the retrieved chunks together must fit the LLM's context window.
Smaller and larger chunks compared
Feature
Smaller chunks
Larger chunks
Strength
Better localization of specific facts
More context preserved
Weakness
May lose context
Harder to pinpoint relevant information
Starting point
256 tokens, for precise fact retrieval
1024 tokens, for more context per chunk
Exam trap There is no proven best chunk size. It is still an active research area, and embeddings can miss basic information in long contexts.
Reported, thanks
Step 4 of 9
Semantic chunking groups sentences by meaning, not fixed size. Embeddings find natural boundaries, so related ideas stay together. Like the other advanced approaches, it costs more work, yet its payoff can be larger.
Reported, thanks
Step 5 of 9
Search small chunks, then return their large parents. Each child chunk, about 512 tokens, is stored with its parent of about 2048 tokens. The child gives a precise match, and the parent gives the LLM context.
Example: Splits each document into large parent chunks, then small child chunks stored with their parent's text.
for parent_chunk in create_chunks(doc, size=2048):
for child_chunk in create_chunks(parent_chunk, size=512):
source_table.append({
"text": child_chunk,
"parent_text": parent_chunk,
})
size=2048: a large parent chunk, kept for context
size=512: a small child chunk, used for precise search
Reported, thanks
Step 6 of 9
Use ai_parse_document for PDFs and complex documents. Poor parsing, such as missing tables or broken formatting, directly hurts retrieval. Strip boilerplate such as headers, footers and page numbers. Keep headings, lists and tables intact.
Reported, thanks
Step 7 of 9
Metadata often beats over-tuning chunk size. Extract entities, topics and categories for precise filtering. Prepend the document title, summary and section name to each chunk. Semantic metadata in separate columns needs columns_to_rerank, while keyword-only metadata needs hybrid search in full-text mode.
Exam trap Metadata in its own column is not used automatically. Semantic fields need columns_to_rerank, and keyword fields need hybrid search.
Reported, thanks
Step 8 of 9
Test retrieval on its own, not only the whole app. Formatting changes can shift which chunks come back. Each retriever result carries doc_uri as its primary document identifier.
Reported, thanks
Step 9 of 9
Start chunk-size tests at 256, 512 and 1024 tokens.
Parent-child chunking searches small chunks and returns their parents.
Clean parsing and rich metadata matter more than over-tuning chunk size.
The retrieved chunks together must fit the LLM context window.
Think first Where does re-ranking fit between retrieval and generation, and when is its extra latency worth paying?
Why it matters: Questions describe a retrieval setup with its latency or traffic needs, and ask whether and how to rerank.
Retrieval queries a knowledge base for supporting data for the LLM. Adding the reranker to that search boosts precision, but it adds time. So the choice depends on traffic and the latency budget.
Reported, thanks
Step 2 of 9
Term
Meaning
Reranker
An option on an AI Search similarity search that reranks the results to boost precision.
Cross-encoder
A reranking model type that can give a meaningful quality lift; a lightweight example is a TinyBERT model.
DCG@10
A retrieval metric that reflects how relevant the top results are and where they rank.
NDCG
DCG divided by the ideal DCG: how close the order is to the best possible order.
QPS
Queries per second. The built-in reranker handles about 5 out of the box.
Reported, thanks
Step 3 of 9
Reranking is switched on inside the retrieval search call. In a RAG agent, retrieval uses the request to fetch supporting data from a vector store, a keyword search or a SQL database. Reranking then raises precision, reaching high recall with fewer candidates. Pair it with hybrid search and filtering for the best results.
Exam trap Reranking alone is not the whole recipe. It works best when combined with hybrid search and filtering.
Reported, thanks
Step 4 of 9
Databricks offers a built-in reranker as a one-line change. It gives roughly 15% better quality. In typical workloads it reranks 50 results in under 1 second, and in about 250 msec for shorter chunks.
Example: Turns on the built-in reranker in a similarity search and names the columns it scores.
"databricks_reranker": the built-in reranking model
columns_to_rerank: the columns the reranker reads when it scores results
Reported, thanks
Step 5 of 9
It suits RAG agents and quality-first apps at modest traffic. In a RAG agent, LLM generation dominates the latency, which is why RAG agents are listed as a good fit.
Good and poor fits for the built-in reranker
Feature
Good fit
Poor fit
Application type
RAG agents and quality-first applications
Real-time search bars needing under 100 msec
Traffic
Low to moderate, about 5 QPS out of the box
Above 5 QPS without additional scaling
Exam trap The built-in reranker is the wrong choice for a search bar that needs under 100 msec, or for traffic above 5 QPS without extra scaling.
Reported, thanks
Step 6 of 9
Serve a lightweight reranker on Model Serving for sub-100 msec speed. Search bars and high-QPS apps can still gain quality from reranking. Deploy a small cross-encoder such as ms-marco-TinyBERT-L-2-v2, served as a custom model.
Reported, thanks
Step 7 of 9
Semantic metadata, such as document summaries, helps the reranker score. It also adds semantic signal for embedding models. When that metadata sits in separate columns, list them in columns_to_rerank so reranking takes them into account.
Exam trap Adding a summary column is not enough by itself. Reranking uses it only when the column is listed in columns_to_rerank.
Reported, thanks
Step 8 of 9
Evaluation tests each query with and without the reranker. Each generated query runs with ANN, hybrid and full-text retrieval. DCG@10 is the recommended primary metric, since it reflects both relevance and rank position. If the reranker lifts metrics significantly, turn it on when the latency budget allows.
Reported, thanks
Step 9 of 9
Reranking boosts precision by reaching high recall with fewer candidates.
The built-in reranker gives about 15% better quality for a one-line change.
Use it for RAG agents near 5 QPS; use a lightweight custom reranker for sub-100 msec needs.
List metadata columns in columns_to_rerank so the reranker reads them.
Each topic's Check tested it on its own; this mixes them.
Mixed quiz
Take the Domain 2 quiz
6 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.