docs(step-05): clarify how retrieval works and correct inaccurate claims - #26
Merged
Pierre Malarme (pmalarme) merged 1 commit intoAug 13, 2026
Merged
Conversation
Step 5 leaned on "grounds every turn" without ever defining a turn, which left the most surprising part of semantic mode undocumented: the provider fires once per turn, but builds its query from every replayed user and assistant message. Because grounded answers quote the records they used, each reply feeds the previous destination back into the next query. Explain that with a captured trace and a Playground screenshot, and correct several claims that don't survive reading the provider source: - sourceName/sourceLink are never surfaced; _extract_document_text injects the content field prefixed with [Source: <id>], so the record id is the citation handle. Dropped the promises that answers "cite" records. - Disabling RAG by unsetting AZURE_AI_SEARCH_ENDPOINT cannot work: the process already read it, and a restart without it fails with KeyError. Comment out context_providers instead, and ask in a New Session so the earlier answer isn't replayed. - The canary token is a strong signal, not proof -- it lives in a public template repo. - Foundry IQ does not change which identity reaches Search when you call it from your own code; only Foundry Agent Service's managed integration uses the project MI. - retrieval_reasoning_effort="minimal" skips LLM query planning entirely, so the agentic snippets get a managed knowledge base but no sub-query decomposition. - top_k is read only by the semantic path; it was a no-op in both agentic snippets. Also add a three-way comparison of retrieval shapes (semantic provider, agentic + Foundry IQ, retrieval as an MCP tool), a troubleshooting entry for a city that is in destinations.json but not in the index, and split the manifest section into per-concern blocks with block-style tags. The agentic and MCP paths are marked experimental, following the convention in steps 08 and 09. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: b136e94d-58c9-4ee0-b9a6-d0e95c5df79e
Pierre Malarme (pmalarme)
deleted the
pmalarme-clarify-step5-rag-retrieval
branch
August 13, 2026 23:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Step 5 leaned on the phrase "grounds every turn" without ever defining a turn, which left the most surprising behaviour of semantic mode undocumented. The provider fires once per turn, but it builds its query by joining every replayed user and assistant message — and because a grounded answer quotes the record it used, each reply feeds the previous destination back into the next query.
Working through a real debugging session on this step also surfaced several claims in the doc that don't survive reading the provider source.
What changed
Explaining the mechanism
[RAG] query=... hits=...trace plus a Playground screenshot showing turn 2's query carrying the whole of turn 1's answer.Corrections (each verified against
agent_framework_azure_ai_searchor Azure docs)sourceName/sourceLinkare never surfaced —_extract_document_textinjectscontentprefixed with[Source: <id>], so the record id is the citation handle. Removed the promises that answers "cite" records.AZURE_AI_SEARCH_ENDPOINTcannot work: the running process already read it, and a restart without it fails fast withKeyError. Now says to comment outcontext_providersand ask in a New Session, so the earlier answer isn't replayed.retrieval_reasoning_effort="minimal"skips LLM query planning (Learn), so the agentic snippets get a managed knowledge base but no sub-query decomposition.top_kis read only by the semantic path — it was a no-op in both agentic snippets.context_providers.append(...)where it meant to swap, understated the role needed to create a knowledge base, and misdescribed how to get the preview SDK into the container.Other
destinations.jsonbut not in the index — the failure that looks identical to crowd-out.tags: [...]line.search_text, where-,|, and*are query operators.Scope
Documentation only —
.workshop/docs/steps/05-rag.mdplus one new asset. No change totravel_assistant/code,.workshop/solutions/, or.workshop/step_files/; the new variants are explicitly optional sketches, so the source-of-truth rule is satisfied.Validation
python .workshop/scripts/lint_steps.py→ 0 failures (2 pre-existing warnings)python -m pytest .workshop/scripts/tests→ 154 passedrender_readme.py --step 5inspected; all cross-reference anchors resolve against the rendered headings