Skip to content

Add retrieval-agent samples for .NET, JavaScript, and Python - #708

Open
Joel Mut (sw-joelmut) wants to merge 5 commits into
mainfrom
southworks/add/retrieval-agent
Open

Add retrieval-agent samples for .NET, JavaScript, and Python#708
Joel Mut (sw-joelmut) wants to merge 5 commits into
mainfrom
southworks/add/retrieval-agent

Conversation

@sw-joelmut

Copy link
Copy Markdown
Collaborator

Addresses #682

Description

Adds aligned retrieval-agent samples for .NET, JavaScript, and Python.

Each sample uses the signed-in user’s delegated Microsoft Graph token to retrieve Build session content from a configured SharePoint site. The response includes grounded text and a source card.

Note

The samples use sharePoint by default. The READMEs document oneDriveBusiness as a fallback when an indexed SharePoint document returns no results.

Changes

Retrieval flow

  • Simplified the .NET retrieval sample.
  • Added JavaScript and Python retrieval-agent samples.
  • Added one retrieval boundary per sample.
  • Added delegated OAuth handling.
  • Added SharePoint site URL validation.
  • Added safe sign-in, no-result, and service-failure responses.
  • Added deterministic source cards.

Documentation

  • Added aligned customer-facing READMEs.
  • Added Azure Bot OAuth setup steps.
  • Added SharePoint document upload, access, indexing, and reindex steps.
  • Added current SharePoint library settings navigation.
  • Added oneDriveBusiness fallback guidance.

Tests

  • Added retrieval request, response mapping, safe-failure, and message-route tests.
  • Fixed Python message route registration to use an all-message selector.

Testing

  • .NET: dotnet test samples/dotnet/retrieval-agent/tests/RetrievalAgent.Tests/RetrievalAgent.Tests.csproj --no-restore
    • Passed: 10/10
  • JavaScript: npm test
    • Passed: 7/7
  • Python: python -m unittest discover -s tests
    • Passed: 5/5
  • Verified Python agent import succeeds.
  • Verified live retrieval with the uploaded ContosoBuildSessions2025.docx after SharePoint indexing completed.

The following image shows the samples working.
image

@github-actions github-actions Bot added the Samples Changes to Samples label Aug 31, 2026
Comment thread samples/nodejs/retrieval-agent/src/tests/retrieval.test.ts Fixed
Comment thread samples/nodejs/retrieval-agent/src/tests/retrieval.test.ts Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Samples Changes to Samples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants