| 2.1 Apply a chunking strategy for a given document structure and model constraints | A chunk is a piece of a document stored and searched as one unit. Chunk size and cut points should follow how the document is laid out and the limits of the embedding model that turns text into numbers. | Product manuals have clear headings, and answers keep missing the sentence that follows a heading because chunks cut in the middle of sections. | Use a format-aware strategy that cuts on headings, with a size under the embedding model's input limit and a small overlap. Smaller chunks are precise but lose surrounding context; larger ones carry more context but add noise and cost. Fixed-size cutting is fast but rarely production quality for structured documents. | Making every chunk much larger looks like a fix but dilutes the match and can exceed the embedding model's window. Runner-up wins when: Semantic chunking, which cuts where the topic shifts, wins when the text has no headings or structure to follow. |
| 2.2 Filter extraneous content in source documents that degrades quality of a RAG application | Source files carry text that is not content: page headers, footers, navigation, legal boilerplate. If it stays in the index, it ends up inside chunks and gets retrieved. | Every chunk from a set of PDFs ends with the same copyright footer, and unrelated questions retrieve unrelated chunks. | Strip headers, footers and special characters during preprocessing, before chunking. Repeated boilerplate makes different chunks look alike to the embedding model, which hurts ranking. Clean at ingestion because fixing it after retrieval costs money on every request. | Telling the model in the prompt to ignore the footer does not help, because the junk chunk has already taken a retrieval slot. |
| 2.3 Choose the appropriate Python package to extract document content from provided source data and format | Each file type needs a tool that can read it. You pick the Python package or Databricks function that matches the source format, such as PDF, Word, slides or scanned images. | A folder of mixed PDF and Word files in a Unity Catalog volume must be turned into text, with tables and layout kept. | Use ai_parse_document on the file bytes read with read_files(..., format => 'binaryFile'). It accepts PDF, JPG, PNG, TIFF, DOC/DOCX and PPT/PPTX and keeps structure. For purely local work, a format-specific Python package such as a PDF reader or a DOCX reader fits when the format is known. | Reading every file as plain text only works for text formats. A PDF opened that way gives garbled bytes. Runner-up wins when: A Python library wins when the job runs outside SQL, for example in a notebook step that handles one known format. |
| 2.4 Define operations and sequence to write given chunked text into Delta Lake tables in Unity Catalog | Chunked text must be written to a Delta table in Unity Catalog in a sensible order: read, parse, clean, chunk, assign ids, write. The table is what the search index later reads from. | A team has chunks in memory and wants a governed table that a search index can follow as the content changes. | Create the table in a Unity Catalog catalog and schema with a stable primary key per chunk, the chunk text, and source metadata, then write the chunks to it. Enable Change Data Feed on the table, because a Delta Sync index follows changes through it; row tracking turns it on automatically for the standard endpoint case. Order the steps so cleaning happens before chunking and ids are set before the write. | Writing chunks to files in cloud storage skips Unity Catalog governance and gives the index nothing to sync from. |
| 2.5 Identify needed source documents that provide necessary knowledge and quality for a given RAG application | A retrieval application can only answer from what it contains. You decide which documents must be in the index so the knowledge is present and trustworthy. | A parts-selling assistant answers billing questions well but fails on delivery dates. The customer already supplies account and order ids. | Find the missing knowledge: delivery data is per-order and changing, so it belongs in a lookup the app queries by order id, not in documents or the prompt. Static policy text goes in the vector index. Store source, version and date metadata with each chunk so stale and current versions can be told apart. | Adding more policy documents to the index looks like more knowledge but cannot supply a per-order date that exists in no document. Runner-up wins when: A document index wins when the missing knowledge is stable policy text and not a record tied to one order. |
| 2.6 Use tools and metrics to evaluate retrieval performance | Retrieval quality is measured separately from answer quality. Judges check whether the retrieved context was relevant and whether it held enough facts to answer. | Users report wrong answers, and the team wants to know whether the retriever or the model is at fault, without having reference answers yet. | Run RetrievalRelevance first, which checks if the retrieved chunks relate to the request and needs no ground truth. RetrievalSufficiency asks whether the chunks hold every fact needed and does need a reference answer. Traces in MLflow let you see what was retrieved for each request. | Scoring only the final answer cannot tell you which half failed. Runner-up wins when: RetrievalSufficiency wins once the team has expected answers and the question is about missing facts. |
| 2.7 Design retrieval systems using advanced chunking strategies | Advanced chunking keeps more context around each piece. For example, the text that is searched can differ from the text that is shown or embedded, so the match is precise but the answer has enough surrounding text. | Short chunks match questions well but the model then lacks the surrounding explanation to answer fully. | Embed a context-enriched version of the chunk while returning the fuller text for the prompt. The ai_prep_search function produces chunk_to_embed and chunk_to_retrieve for this purpose, with chunk_id, metadata and pages alongside. Hybrid search, which blends vector and keyword matching, helps with exact identifiers. | Simply increasing chunk size trades one problem for another by adding noise. |
| 2.8 Explain the role of re-ranking in the information retrieval process | Re-ranking takes the first batch of search results and reorders them with a stronger scoring step, so the best few reach the model. | The right passage is usually somewhere in the top twenty results but rarely in the top three the prompt can hold. | Add re-ranking: it rescores the candidates against the query and puts the best first. It adds latency, typically under a second per query, which is the cost you accept for better ordering. Hybrid search merges vector and keyword results with Reciprocal Rank Fusion, a separate step that widens the candidate set. | Raising the number of chunks sent to the model fills the prompt with weaker passages and raises cost. Runner-up wins when: Skipping re-ranking wins when the stem puts a strict latency limit that the extra step would break. |