Skip to content

Generative AI Engineer Associate · Domain 2: Data Preparation · 14% of the exam

Task 2.2: Filter extraneous content in source documents that degrades quality of a RAG application; Identify needed source documents that provide necessary knowledge and quality for a given RAG application

Removing boilerplate, headers and footers, choosing the documents and structured sources that actually hold the answers, and when a table lookup beats retrieval.

Study it

  • Cleaning source documents and choosing the sources that hold the answers

    Partly covered by: Data Readiness for AI

Sample questions

Try each one before opening the answer. Every option is explained, with the Databricks documentation page that proves it.

Question 1 · choose 1

Contracts are parsed into a Delta table with ai_parse_document. Retrieval keeps returning chunks made of repeated letterheads, confidentiality footers and page numbers. What should the pipeline do before chunking?

  1. ARaise the chunk overlap so that body text outweighs the boilerplate in every chunk
  2. BSwitch the index to hybrid search for exact matches
  3. CTell the model in the system prompt to ignore letterheads, footers and page numbers
  4. DDrop elements whose type is page_header, page_footer or page_number
Show the answer and why
  • ARaise the chunk overlap so that body text outweighs the boilerplate in every chunk

    Incorrect

    Overlap duplicates neighboring text; the repeated headers and footers stay in every chunk.

  • BSwitch the index to hybrid search for exact matches

    Incorrect

    Keyword search matches repeated letterhead terms even more readily, so the noise does not go away.

  • CTell the model in the system prompt to ignore letterheads, footers and page numbers

    Incorrect

    The instruction acts after retrieval; the boilerplate chunks still fill the retrieved context and push out the useful ones.

  • DDrop elements whose type is page_header, page_footer or page_number

    Correct

    ai_parse_document labels each element by type, including page headers, footers and page numbers, so the boilerplate can be removed before chunking.

Removing headers, footers and other noise during parsing reduces irrelevant content in chunks. ai_parse_document returns structured elements with types such as section_header, page_header, page_footer and page_number.

Question 2 · choose 1

An HR assistant was loaded from three shared drives. Each holds copies of the leave policy from 2023, 2024 and 2025, some with small edits and renamed files, and answers mix rules from different years. Ingestion ran on the same day for all copies. Which source-preparation step fixes this?

  1. ARemove exact duplicates by hashing each file and keep one copy per hash
  2. BFilter retrieval at query time to the most recent ingestion date recorded for each document
  3. CAdd an instruction to the prompt to prefer the newest policy it sees
  4. DFind near-duplicates with MinHash in Spark ML and keep the newest effective version
Show the answer and why
  • ARemove exact duplicates by hashing each file and keep one copy per hash

    Incorrect

    Small edits change the hash, so edited copies of older policies survive and keep mixing rules.

  • BFilter retrieval at query time to the most recent ingestion date recorded for each document

    Incorrect

    All copies were ingested on the same day, so ingestion date cannot tell old policy versions from the current one.

  • CAdd an instruction to the prompt to prefer the newest policy it sees

    Incorrect

    Chunks rarely state their policy year, so the model cannot tell versions apart, and old text still crowds the context.

  • DFind near-duplicates with MinHash in Spark ML and keep the newest effective version

    Correct

    MinHash locality-sensitive hashing finds near-duplicate documents even with small edits, and the keeper can be chosen by authority or recency.

Duplicate and near-duplicate documents create redundant chunks that lower quality. Metadata can remove some duplicates; content-based near-duplicates need locality-sensitive hashing such as MinHash, with a rule for which version to keep.

Question 3 · choose 1

A team starting a RAG assistant for field technicians is unsure which manuals and guides to include. What does Databricks recommend first?

  1. AIndex every shared drive and filter later
  2. BPick documents by file size
  3. CUse only public web pages
  4. DInvolve domain experts from the start
Show the answer and why
  • AIndex every shared drive and filter later

    Incorrect

    Indexing everything adds noise and duplicates before anyone knows what is needed.

  • BPick documents by file size

    Incorrect

    File size says nothing about relevance or quality.

  • CUse only public web pages

    Incorrect

    The needed knowledge is usually in internal manuals and guides.

  • DInvolve domain experts from the start

    Correct

    Domain experts and stakeholders help identify relevant content and the questions users will ask.

Corpus composition depends on the application's goals. Engage domain experts early to curate content that improves quality and coverage.

Question 4 · choose 1

Before parsing and cleaning, where should a RAG pipeline store the raw source data it ingests?

  1. ANowhere; parse it in memory and keep only the chunks
  2. BIn a target table, kept as ingested
  3. CInside the AI Search index
  4. DIn the agent's prompt cache
Show the answer and why
  • ANowhere; parse it in memory and keep only the chunks

    Incorrect

    Without a raw copy, problems cannot be traced or reprocessed.

  • BIn a target table, kept as ingested

    Correct

    Storing raw source data in a target table preserves it and supports traceability and auditing.

  • CInside the AI Search index

    Incorrect

    The index serves embeddings and metadata, not raw source records.

  • DIn the agent's prompt cache

    Incorrect

    A prompt cache is not durable, governed storage.

Databricks recommends scalable, incremental ingestion and keeping raw source data in a target table as a best practice.

Question 5 · choose 1

How does Databricks suggest checking whether parsing is introducing noise or losing content?

  1. AReview a sample of parsed output by hand
  2. BCount the parsed characters per file and compare with file size
  3. CCheck index sync status only
  4. DRely on end-user complaints
Show the answer and why
  • AReview a sample of parsed output by hand

    Correct

    Regularly reviewing a sample of the parsed output reveals issues and areas to improve.

  • BCount the parsed characters per file and compare with file size

    Incorrect

    A character count cannot show whether the right content was kept.

  • CCheck index sync status only

    Incorrect

    A successful sync says nothing about parse quality.

  • DRely on end-user complaints

    Incorrect

    Waiting for complaints finds problems late and incompletely.

Parsing best practices include cleaning noise, handling errors, customizing logic and evaluating parsing quality by manual review of samples.

Question 6 · choose 1

For a customer-support RAG bot, which set of sources does Databricks list as typical candidates for the corpus?

  1. APayroll exports and HR personnel files
  2. BRaw web server logs from the support website
  3. CKnowledge base articles, FAQs and manuals
  4. DMarketing slogans and brand guidelines
Show the answer and why
  • APayroll exports and HR personnel files

    Incorrect

    These are unrelated to support questions and add sensitive data.

  • BRaw web server logs from the support website

    Incorrect

    Logs rarely answer customer questions on their own.

  • CKnowledge base articles, FAQs and manuals

    Correct

    Databricks lists knowledge base documents, FAQs, product manuals and troubleshooting guides for a customer support bot corpus.

  • DMarketing slogans and brand guidelines

    Incorrect

    Slogans hold little factual support knowledge.

The right corpus depends on the application's requirements; for support bots this usually means knowledge base documents, FAQs, product manuals and troubleshooting guides.

Practice domain 2 →Practice all domains →