Databricks Generative AI Engineer Associate · Section 3 · 30% of the exam
Augment a prompt with additional context from a user's input based on key fields, terms, and intents
One of the objectives of the Databricks Certified Generative AI Engineer Associate exam, in the section “Application Development”. Here is what it covers, the points to remember and a question to try.
What it covers
A prompt improves when it carries the right facts about the request: the user's intent, key fields such as product or error code, and definitions of domain terms. This lesson shows how to extract and inject that context, and how to change a prompt step by step until a baseline response becomes the output you want.
Points to remember
- Query understanding feeds prompt augmentation: classify the intent, extract key fields and entities, look up domain terms, rewrite the query.
- Use extracted fields twice: as retrieval metadata filters and as template choices or explicit facts in the prompt.
- Filters only work on metadata stored with the chunks (source, section, product), so plan them in the data pipeline.
- Use
response_formatwith ajson_schemaand enums to extract fields reliably on Foundation Model APIs. - Inject only relevant context; delimit user-provided text and never put it in the system message.
Try a question
A 1,500-word system prompt for a travel assistant mixes persona, policy text and formatting rules. Halfway down, one sentence says 'Always quote prices in EUR.' Answers often quote prices in USD, and the retrieved fare chunks contain both currencies. Which prompt change is most likely to fix this?
- AMove the currency rule into a short, delimited rules section of the system message and restate it next to the question
- BRaise
max_tokensso that the model has enough room to read the whole system prompt - CRepeat 'Always quote prices in EUR' twice more in the middle of the policy text
- DRaise the temperature so that the model is more likely to choose EUR some of the time
Show the answer
A. An instruction buried in the middle of a long prompt is easy for a model to miss. Placing key rules in their own short, delimited section of the system message and restating the constraint next to the question makes the rule prominent where the answer is generated. Then compare the old and new prompts on the same inputs to confirm that the change worked.
Written for practice in the style of the exam: never a question from the real exam.
In the course
The lesson Augmenting and refining prompts teaches this objective (about 45 minutes), and 13 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Select Langchain/similar tools for use in a Generative AI application
- Qualitatively assess responses to identify common issues such as quality and safety
- Select chunking strategy based on model & retrieval evaluation
- Create a prompt that adjusts an LLM's response from a baseline to a desired output
- Implement LLM guardrails to prevent negative outcomes
- Select the best LLM based on the attributes of the application to be developed
- Select an embedding model context length based on source documents, expected queries, and optimization strategy
- Select a model from a model hub or marketplace for a task based on model metadata/model cards
- Select the best model for a given task based on common metrics generated in experiments
- Utilize MLflow and Agent Framework for developing agentic systems
- Compare the evaluation and monitoring phases of the Gen AI application life cycle
- Enable multi-agent systems to leverage Genie Spaces or conversational API to retrieve data