What's changed: Added per-section figures (cert-figure-retrofit). New AI-103 Chapter 2 (generative AI app = Foundry SDK chat completion/system message/parameters/streaming/structured output & function calling/safety filters; RAG = embeddings/vector search/Azure AI Search index/chunking/hybrid search/retrieve→augment→generate→cite/evaluation = groundedness, relevance)
2.2Implementing Retrieval-Augmented Generation (RAG)
Understand implementing RAG for answers grounded in your data—semantic search via embeddings (vectors), Azure AI Search indexes, the retrieve → augment → generate flow, citing sources, and evaluating quality—from a developer’s view.
AI-103 takes the RAG (retrieval-augmented generation) from AI-901 to the implementation level. The key is "how to find internal documents semantically close to the user’s question." That uses embeddings—a technique converting text into meaning-capturing vectors (arrays of numbers). Placing the question and documents in the same vector space lets you search by closeness = semantic similarity (vector / semantic search).
2.2.1Indexing with Azure AI Search
In implementation, chunk documents (split into right-sized pieces), embed each chunk into a vector, and store them in an Azure AI Search index. At query time, embed the question the same way and retrieve the nearest chunks from the index. Accuracy improves with hybrid search (combining keyword and vector search) and a semantic ranker that reorders top results. The typical setup connects Azure AI Search to a Foundry project and specifies it as the data source.
2.2.2Retrieve → augment → generate → cite
The runtime flow: (1) retrieve chunks relevant to the question, (2) augment the prompt context with the excerpts, (3) the model generates based on that context, and (4) the answer cites sources (which document/where it relied on). Citations improve transparency so users can verify the basis and spot errors. Since the model is not retrained, updating documents refreshes answers (RAG ≠ fine-tuning).
2.2.3Evaluating RAG
Measure RAG quality via evaluation. Key facets: is the answer faithful to the provided context (groundedness), does it answer the question well (relevance), and does retrieval fetch the right documents (search recall/precision). Foundry’s evaluation tooling automatically measures these against a dataset so you can iterate on prompts and search settings. In production, monitor continuously to catch regressions.
Common: (1) "find semantically close docs" = embeddings (vectors) + vector/semantic search. (2) "RAG retrieval store" = an Azure AI Search index (documents chunked and stored). (3) accuracy boost = hybrid search + semantic ranker. (4) RAG flow = retrieve → augment → generate → cite. (5) RAG quality metrics = groundedness/relevance. (6) RAG ≠ fine-tuning (no retraining).
Watch out: (1) embedding (vectorizing meaning) and generation (writing text) are different roles. (2) RAG (add context via search) vs fine-tuning (update the model by extra training) differ—use RAG for current docs. (3) Poor retrieval degrades answers—chunking, hybrid search, and a ranker help. (4) groundedness (faithful to context) and relevance (answers the question) are different metrics.
2.2.4Section summary
- Embeddings (vectors) for semantic search: place question and docs in one space; closeness = similarity
- Store chunked docs in an Azure AI Search index; boost accuracy with hybrid search + semantic ranker
- Runtime: retrieve → augment → generate → cite; RAG ≠ fine-tuning (update docs to refresh)
- Measure quality via evaluation (groundedness/relevance) and monitor continuously
Sign in to track progress — Log in.
Quick check
(just a quick review)Q1. Which technique converts text into meaning-capturing vectors to find documents semantically close to a question?
Q2. Which Azure service commonly stores chunked documents and vectors as the RAG retrieval store?
Q3. Which combination raises RAG retrieval accuracy by mixing keyword and vector search and reordering top results?
Q4. Which evaluation metric measures whether a RAG answer is "faithful to the provided context"?
Q5. Which correctly contrasts RAG and fine-tuning?
Q6. What is a main benefit of citing sources in a RAG app’s answers?

