Implement generative AI and agentic solutions Study Guide — AI-103

33% of the exam · domain 2 of 5 · Microsoft Azure AI Apps and Agents Developer Associate · Free Implement generative AI and agentic solutions practice questions

0 of 58 topics covered
What the exam asks here — tap to tick off0 / 14 covered
Domain 2 of 5

Implement Generative AI and Agentic Solutions

This domain covers building production-grade generative AI applications and agents using Azure AI Foundry (formerly Azure AI Studio) and Azure OpenAI Service. It accounts for 33% of the AI-103 exam, making it the single heaviest-weighted domain. Questions test your ability to select the right architecture, configure the right parameters, and reason about tradeoffs between approaches such as RAG vs. fine-tuning, vector vs. hybrid search, and streaming vs. synchronous calls — plus, from the merged agent-building content below, designing and operating Foundry Agent Service agents. Expect scenario-based questions requiring you to justify a design choice, not just recall a definition.


Chat Completions, System Prompts, and Prompt Engineering Patterns

Core Concepts

Chat completions is the primary API pattern for conversational AI on Azure OpenAI. The request body contains a messages array with roles: system, user, and assistant. The system message is the first message in the array and sets the model's persona, boundaries, and behavior for the entire conversation.

RolePurposePosition in messages array
systemPersona, rules, context, safety guardrailsFirst (index 0)
userHuman turn inputAlternating
assistantModel response; can be injected for few-shotAlternating

Key parameters:

ParameterDefaultRangeEffect
temperature1.00.0–2.0Randomness; 0 = deterministic
top_p1.00.0–1.0Nucleus sampling; alternative to temperature
max_tokensmodel-dependent1–context windowCaps output length
frequency_penalty0-2.0–2.0Reduces repetition of frequent tokens
presence_penalty0-2.0–2.0Encourages new topic introduction
stopnullUp to 4 stringsStops generation at specified sequences

Do not set both temperature and top_p to non-default values simultaneously — Microsoft documentation recommends altering only one.

Prompt Engineering Patterns

PatternDescriptionWhen to Use
Zero-shotInstruction only, no examplesGeneral tasks, capable models
Few-shot2–5 examples as assistant/user pairsFormat enforcement, specialized style
Chain-of-thought (CoT)"Think step by step" in promptReasoning, math, multi-step logic
ReActInterleave reasoning and tool callsAgent workflows
Meta-promptingPrompt instructs model to generate its own promptSelf-refinement pipelines

Common Traps

  • Exam may say "increase creativity" — answer is raise temperature, not top_p (both work but temperature is the primary knob).
  • System prompt is not a security boundary — it can be overridden by prompt injection. Guardrails require Azure AI Content Safety in addition.
  • Few-shot examples go in the messages array as user/assistant pairs, not in the system message text.
  • max_tokens limits output only; total token budget = input + output ≤ context window.

Scenario

Requirement: A legal firm wants consistent JSON-formatted responses. The model keeps varying structure.
Reasoning: Set temperature: 0 for determinism, use structured outputs (JSON mode or response_format), and add few-shot user/assistant examples showing the exact JSON schema. Do not rely solely on the system prompt because format drift still occurs at higher temperatures.


Retrieval-Augmented Generation (RAG) grounds model responses in enterprise data without retraining. The architecture combines Azure AI Search (retrieval) with Azure OpenAI (generation).

RAG Architecture Flow:

Data flow from query to grounded response in a RAG pipeline

Indexing

An Azure AI Search index stores documents as JSON. For RAG, each document chunk is stored with its embedding vector in a vector field (type Collection(Edm.Single)).

Indexers automate ingestion from Azure Blob Storage, Cosmos DB, SQL, and SharePoint. Skillsets apply AI enrichment (OCR, entity extraction, embedding generation) during indexing via the enrichment pipeline.

ComponentRole
Data sourceConnection to source (Blob, SQL, etc.)
IndexerOrchestrates pull from source into index
SkillsetChain of cognitive/custom skills applied to content
IndexTarget schema with searchable, filterable, vector fields

Search Modes

ModeAlgorithmBest ForRequires Embedding?
Full-text (keyword)BM25Exact terms, structured queriesNo
Vector searchHNSW (Hierarchical Navigable Small World)Semantic similarity, paraphrase matchingYes
Hybrid searchBM25 + HNSW fused via RRF (Reciprocal Rank Fusion)Best of both; production defaultYes
Semantic rankerCross-encoder ML re-rankingRe-ranks top-50 results for relevanceNo (adds to hybrid)
  • Semantic ranker is a paid add-on (requires Standard tier or above); it re-ranks the top 50 results using a Microsoft-hosted ML model and generates captions/answers.
  • Vector search is available on Basic tier and above (not Free tier).
  • HNSW is the index algorithm; exhaustive KNN is available for small indexes or exact recall at higher cost.

Common Traps

  • Semantic ranker ≠ vector search. Semantic ranker re-ranks text results using language understanding; vector search retrieves by embedding similarity. They are complementary, not substitutes.
  • Free tier of Azure AI Search does not support vector search.
  • RRF fusion score is not the same as cosine similarity — do not confuse them.
  • top parameter controls number of results returned; k (in vector queries) controls nearest neighbors explored.

Unlock with a paid plan

10 more sections (about 5,375 words) continue below. Every paid plan unlocks all AI-103 study guides, the full question bank and mock exams, from $4.97/month.