Problem: Copilot Studio can answer questions, but reliable citations are inconsistent - especially when you’re using MCP resources where native citations aren’t yet exposed.
Goal: Ship a lightweight pattern that produces grounded answers with clear, file‑level citations like:
Source: Annual_leave_and_public_holiday_policy.pdf
This post shows how to implement a retrieval‑only copilot backed by Azure AI Search with semantic ranking, chunk‑level enrichment, and a custom prompt pipeline in Copilot Studio.
What you’ll build
- Documents in Azure Blob (PDF policies)
- Indexer pipeline in Azure AI Search that chunks content and keeps source metadata
- Semantic ranker on the index for better relevance (captions/answers optional)
- Copilot Studio agent that calls Search via HTTP → injects top chunks into the LLM with a “cite the source” instruction
Why semantic ranking? It re‑scores the initial results (BM25/RRF) with deep language models and can return captions and answers; you configure it once on the index and call it at query time.
Step 1 — Put your PDFs in Azure Blob
Create a container (for example, policies) and upload your policy PDFs. Azure AI Search’s Blob indexer will crawl the container and extract text + metadata for you.
Step 2 — Chunk your documents (right‑sized for RAG)
Large PDFs should be chunked to fit embedding and LLM token limits and to improve retrieval quality. Azure AI Search supports chunking through Text Split or Document Layout skills (layout‑aware, paragraphs/sentences) and can vectorize chunks if you’re doing hybrid/vector search.
- Fixed‑size or layout‑aware chunking works.
- Add small overlap (e.g., 10–15%) to avoid cutting useful context.
- Store chunk text, file name, page, and chunk id in the index.
Step 3 — Create the Search index + skillset + indexerYou can use Import data in the portal or IaC/SDKs. At a minimum, design an index with:- id (key)
- content (searchable, retrievable)
- source_file (retrievable, filterable)
- page (int, retrievable)
- title (optional; good for semantic “titleField”)
Example: minimal index schema (portal/REST)Then wire up a Blob data source, a skillset (Text Split or Document Layout), and an indexer to push chunked content + metadata. Azure’s “Search over Blob Storage” guide walks through the workflow.- To split by pages or sections, use Text Split or Document Layout; both are documented with JSON examples.
- If you need custom metadata to flow alongside chunks, add it in the skillset or via a custom Web API skill.
Step 4 — Add Semantic Ranking (the secret sauce)Semantic ranker is query‑side re‑ranking that boosts the most meaningful results. You enable it on your service and configure a semantic configuration on the index:- Define titleField (optional), contentFields (e.g., content), and keywordFields (e.g., tags).
- You can have multiple semantic configurations and set a default.
- No index rebuild is required to add or update the configuration.
Example: semantic configuration JSON
Step 5 — Query pattern from Copilot Studio (HTTP action)In Copilot Studio, add a Send HTTP request node to call your Azure AI Search endpoint. Select GET (or POST for complex queries), include the api‑key header or use Entra ID where supported, and parse the JSON response into a variable for your prompt.POST https://<your-search>.search.windows.net/indexes/policy-index/docs/search?api-version=2024-07-01
api-key: <key>
Content-Type: application/json
Step 6 — Prompt the LLM to summarize + citeIn your Copilot flow, take the top N chunks from the HTTP response and pass them to the LLM with a strict instruction, for example:SYSTEM INSTRUCTIONS
You are a policy assistant. Use ONLY the supplied chunks to answer.
For each statement of fact, ensure it is supported by the chunks.
At the end, print:
"Source: <source_file>" (one line per unique file).
If page numbers are present, include them: "Source: <file>, p.<page>".
If you cannot find the answer in the chunks, say you don’t know.
Troubleshooting & tips
- No results / poor grounding? Inspect the index: are content fields searchable & retrievable? Did the skillset actually split the PDFs? Use Search Explorer to verify.
- Inconsistent page numbers? Use Text Split in pages mode or combine with Document Layout → add page to the projection.
- HTTP node mapping in Copilot Studio: define a sample JSON schema so the response is typed in Power Fx and easy to bind into your prompt.
- Security: Use role‑based access (Entra ID) instead of keys where possible, per the semantic quickstart guidance.
🔗 Want to explore or reuse the full implementation?
I’ve published the complete Azure AI Search + Copilot Studio project here:
https://github.com/RichaPandit/Azure-AI-Search-Copilot-Studio-citations-prototype.git
Conclusion
Until Copilot Studio exposes uniform, platform‑level citations across all resources and orchestrations, this pattern gives you reliable, auditable answers with human‑readable sources and it’s deployable in an afternoon.