Generative AI Engineer Associate · Domain 1: Design Applications · 14% of the exam
Task 1.2: Select chain components for a desired model input and output; Translate business use case goals into a description of the desired inputs and outputs for the AI pipeline
Retriever, prompt template, model and output parser, and turning a business goal into the request fields, context and response shape an AI pipeline must accept and return.
Study it
Chain components: retriever, prompt template, model and output parser
From a business goal to the pipeline's inputs and outputs
Lesson coming
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
A help assistant lists numbered citations under each answer. When a user clicks a citation, the chain must show the full text of that exact chunk, which it knows by chunk_id, the primary key of the AI Search index. The assistant's service principal has SELECT on the index but no access to the index's source table. Which retrieval call should the chain make?
AA filter-only query on chunk_id, with no query text, that returns the chunk's text column
BA similarity search that sends the chunk_id value as query_text and keeps the top result
CA SQL query on the index's source Delta table, filtered on the chunk_id value
DThe original question searched again, with num_results raised until that same chunk comes back
Show the answer and why
AA filter-only query on chunk_id, with no query text, that returns the chunk's text column
Correct
A filter-only query omits query_text, query_vector and query_type and returns the rows that match the filter; filtering on the primary key is a point lookup.
BA similarity search that sends the chunk_id value as query_text and keeps the top result
Incorrect
Similarity search ranks chunks by meaning, and an ID string carries no meaning to match, so the top result need not be that chunk.
CA SQL query on the index's source Delta table, filtered on the chunk_id value
Incorrect
The service principal has no access to the source table, so this path is closed; it can only query the index.
DThe original question searched again, with num_results raised until that same chunk comes back
Incorrect
A repeated search may not return the same chunk at all and wastes calls, although the chain already knows which row it needs.
For a known primary key, AI Search supports filter-only queries: omit query_text, query_vector and query_type and pass only filters, for example {"chunk_id": "c-1042"} on a standard endpoint. The caller needs SELECT on the index, and the num_results and pagination limits still apply.
Compliance requires every answer from a policy assistant to link to the source PDF and page number. The chunk table holds only chunk_id and chunk_text, and the model sometimes invents file names. Which change to the pipeline's inputs and outputs meets the requirement?
AStore doc_uri and page as chunk columns, return them from the retriever and cite them in post-processing
BInstruct the model to cite the file name and page that each passage most likely came from
CList every policy URL with its title in the system prompt and ask the model to pick the one that matches each passage
DReturn the chunk_id values to the user so they can look up the source themselves
Show the answer and why
AStore doc_uri and page as chunk columns, return them from the retriever and cite them in post-processing
Correct
Document-level and structural metadata such as URLs and page numbers belong next to the chunks, and post-processing can add citations from what was retrieved.
BInstruct the model to cite the file name and page that each passage most likely came from
Incorrect
The retrieved text carries no source fields, so the model can only guess, which is how invented file names appear.
CList every policy URL with its title in the system prompt and ask the model to pick the one that matches each passage
Incorrect
A list in the prompt does not tie a chunk to its source or page, and the list grows with the corpus.
DReturn the chunk_id values to the user so they can look up the source themselves
Incorrect
A chunk_id is not a link to a PDF page, so the compliance requirement is not met.
Metadata such as file names, URLs and page numbers should be stored alongside chunks. The retriever returns it with each document (for example as doc_uri in the MLflow retriever schema), and a post-processing step adds citations.
A nightly SQL job scores five million customers with a churn model on a custom Model Serving endpoint. The model was logged with a signature whose inputs are tenure_months, plan and region and whose output is a churn probability. The job runs on Databricks Runtime 16.4 LTS, and each score must land in a DOUBLE column. How should the ai_query call be written?
Arequest => a CONCAT of the three values into one prompt string, with returnType => 'DOUBLE'
Brequest => a named_struct of the three columns, plus a returnType that is required because ai_query cannot read the model schema
Crequest => named_struct('tenure_months', tenure_months, 'plan', plan, 'region', region), with returnType left out
Drequest => a messages array that holds the row as one user message, with returnType => 'STRING'
Show the answer and why
Arequest => a CONCAT of the three values into one prompt string, with returnType => 'DOUBLE'
Incorrect
The endpoint expects the named input features of its signature, not a text prompt that the model would have to parse.
Brequest => a named_struct of the three columns, plus a returnType that is required because ai_query cannot read the model schema
Incorrect
On Databricks Runtime 15.2 and above, returnType is optional for this endpoint: ai_query infers the return type from its model schema.
Crequest => named_struct('tenure_months', tenure_months, 'plan', plan, 'region', region), with returnType left out
Correct
For a custom endpoint the request can be a STRUCT whose field names match the model's input features, and the return type is inferred from the model schema on Databricks Runtime 15.2 and above.
Drequest => a messages array that holds the row as one user message, with returnType => 'STRING'
Incorrect
A messages array suits a chat model; this endpoint expects the three features of its signature and returns a number.
ai_query sends a custom model endpoint a single column or a STRUCT whose field names match the input features the endpoint expects. When the endpoint has a model schema, Databricks Runtime 15.2 and above infer the return type, so returnType can be omitted.
A team adds a query-understanding step that pulls a product name out of each question and passes it to retrieval as a filter. According to Databricks guidance on RAG chain quality, which other components must change for the filter to work?
AOnly the prompt template, so that the generation model sees the product name
BThe generation model, which must be fine-tuned on every product name
CThe post-processing step, which must drop answers that mention other products
DMetadata extraction in the pipeline, and a retriever that applies the filter
Show the answer and why
AOnly the prompt template, so that the generation model sees the product name
Incorrect
The prompt template shapes generation; it does not narrow what retrieval returns.
BThe generation model, which must be fine-tuned on every product name
Incorrect
Filtering happens in the retrieval step, so the generation model is not involved.
CThe post-processing step, which must drop answers that mention other products
Incorrect
Post-processing acts after generation and does not change which chunks are retrieved.
DMetadata extraction in the pipeline, and a retriever that applies the filter
Correct
Each chunk needs the product field from the data pipeline, and the retrieval step must accept and apply the extracted filter.
Filter extraction must be done together with changes to two other components: the metadata extraction step of the data pipeline, so that each chunk carries the field, and the retriever, so that it accepts and applies the extracted filters.
A support bot's chain will make several LLM calls to understand each query before retrieval: classify the intent, pull out entities such as product names and error codes, and rewrite the query. In what order should these steps run?
AIntent, then entities, then rewrite
BRewrite, then intent, then entities
CEntities, then rewrite, then intent
DAll three in one parallel call
Show the answer and why
AIntent, then entities, then rewrite
Correct
Entity extraction can depend on the intent, and the rewrite uses both, which is the order Databricks describes for a support bot.
BRewrite, then intent, then entities
Incorrect
Rewriting first means the rewrite cannot use the intent and entities it needs.
CEntities, then rewrite, then intent
Incorrect
Classifying intent last leaves the entity step without its guidance and the rewrite without the intent.
DAll three in one parallel call
Incorrect
Parallel calls cannot feed one step's output into the next.
In the support-bot example, the chain classifies the intent, extracts entities based on that intent, then rewrites the query with both before retrieval.
A shopping assistant answers "which promotions run this week?" from retrieved promotion pages, but it often presents expired promotions as current, because the model does not know today's date. Which chain change does Databricks describe for this kind of input?
AFine-tune the generation model each week on the promotions that are current
BParameterize the prompt template and pass in the current date at inference time
CRaise the temperature so that the model reasons more freely about the dates it sees
DAdd few-shot examples of last month's promotions to the prompt template
Show the answer and why
AFine-tune the generation model each week on the promotions that are current
Incorrect
Weekly fine-tuning is costly and still leaves the model without the date at answer time.
BParameterize the prompt template and pass in the current date at inference time
Correct
A prompt template can take variables beyond the query and the retrieved data, such as the current date or user context, filled in at inference time.
CRaise the temperature so that the model reasons more freely about the dates it sees
Incorrect
Temperature controls randomness; it gives the model no knowledge of the date.
DAdd few-shot examples of last month's promotions to the prompt template
Incorrect
Examples show format and style, but they do not tell the model which day it is.
Prompt augmentation combines the query, the retrieved information and instructions in a template. Parameterizing that template with values such as the current date or user context makes responses context-aware.