Skip to content

Add recipe: fix agent citations for custom Azure AI Search schemas#45

Open
farzad528 wants to merge 1 commit into
mainfrom
farzad528/azure-ai-search-citations-recipe
Open

Add recipe: fix agent citations for custom Azure AI Search schemas#45
farzad528 wants to merge 1 commit into
mainfrom
farzad528/azure-ai-search-citations-recipe

Conversation

@farzad528
Copy link
Copy Markdown
Contributor

New recipe: Fix agent citations for custom Azure AI Search schemas

Teaches one transferable Foundry pattern: when your Azure AI Search index fields are not named url/title/content, the Agent's Azure AI Search tool returns placeholder url_citation annotations (title='doc_0', url='https://<svc>.search.windows.net/'). The fix is to register the index as a project asset with a FieldMapping and reference it via index_asset_id — no re-indexing, no schema change.

Steps the reader walks

  1. Register the existing index as an asset with FieldMapping (project.indexes.create_or_update)
  2. Create an agent referencing the asset by index_asset_id
  3. Stream a response and read citations that now resolve to the real fields
  4. Gotchas table covering each failure mode (Invalid IndexId format, oneof conflict, dropped tool-level mapping)

Includes a verified real-output section.

Files

  • notebooks/azure-ai-search-custom-schema-citations.ipynb
  • registry.yaml entry (slug azure-ai-search-custom-schema-citations, author farzad528)

Validation

  • npx tsx validate-registry.ts → 13 notebooks validated
  • Diff is exactly 2 files / 371 insertions against main

New notebook teaching how to get grounded url_citation annotations from the Azure AI Search tool when the index uses non-standard field names. Registers the index as a project asset with a FieldMapping and references it via index_asset_id. Adds the registry.yaml entry (author farzad528).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@farzad528 farzad528 requested a review from a team as a code owner June 5, 2026 19:39
@farzad528 farzad528 enabled auto-merge (squash) June 5, 2026 19:40
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

🔍 Preview

A live preview of this PR is available at:
https://microsoft-foundry.github.io/forgebook/preview/pr-45/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant