GovUK.Dfe.AI.Agents.AISearch 0.0.1-prerelease.405

Prefix Reserved
This is a prerelease version of GovUK.Dfe.AI.Agents.AISearch.
dotnet add package GovUK.Dfe.AI.Agents.AISearch --version 0.0.1-prerelease.405
                    
NuGet\Install-Package GovUK.Dfe.AI.Agents.AISearch -Version 0.0.1-prerelease.405
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GovUK.Dfe.AI.Agents.AISearch" Version="0.0.1-prerelease.405" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GovUK.Dfe.AI.Agents.AISearch" Version="0.0.1-prerelease.405" />
                    
Directory.Packages.props
<PackageReference Include="GovUK.Dfe.AI.Agents.AISearch" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GovUK.Dfe.AI.Agents.AISearch --version 0.0.1-prerelease.405
                    
#r "nuget: GovUK.Dfe.AI.Agents.AISearch, 0.0.1-prerelease.405"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GovUK.Dfe.AI.Agents.AISearch@0.0.1-prerelease.405
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GovUK.Dfe.AI.Agents.AISearch&version=0.0.1-prerelease.405&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=GovUK.Dfe.AI.Agents.AISearch&version=0.0.1-prerelease.405&prerelease
                    
Install as a Cake Tool

GovUK.Dfe.AI.Agents.AISearch

Gives your GovUK.Dfe.AI.Agents agents evidence from Azure AI Search. Results are numbered, and each citation in an answer becomes a link to its result, or the result's text.

Set up

dotnet add package GovUK.Dfe.AI.Agents.AISearch
"AiAgents": {
  "AISearch": {
    "Endpoint": "https://<search>.search.windows.net",
    "Indexes": [ { "Name": "ofsted_index", "ContentFields": [ "title", "content", "url" ] } ]
  }
}
builder.Services.AddAgents(builder.Configuration, agents => agents
    .AddAgents(BriefingAgents.All)
    .AddAISearch());

Give the app's identity the Search Index Data Reader role. For a separate identity, add AISearch:Authentication or call agents.UseAISearchCredential(credential).

Search without agents

An app that only needs search results, e.g. a search page, needs no Foundry settings and no agents:

builder.Services.AddAISearch(builder.Configuration, new ManagedIdentityCredential());

It reads the same section. Pass a credential, or set a complete AISearch:Authentication block. Adding agents later with agents.AddAISearch() still registers search once.

Use

Inject IContextRetriever, search, and pass the result as evidence:

var evidence = await search.GetContextAsync("ofsted_index", $"Ofsted inspection {urn}", size: 10,
    filter: $"urn eq {urn}", cancellationToken: ct);

var result = await agents.RunAsync(BriefingAgents.Ofsted, "Summarise the latest inspection.", evidence, ct);

Pass the result itself, not evidence.Text, so its citation sources come with it.

  • Filter every search to the record you mean, e.g. one school; relevance alone also returns similar names.
  • Filters are escaped for you: in $"urn eq {urn}", every {value} is escaped, so it can't change what the filter matches. A plain string won't compile; pass an already-escaped filter with ODataFilter.Raw(filter).
  • Set ContentFields on each index, so only those fields reach the model, whatever their type (text, numbers, dates, true/false). Each value is labelled with its field, one per line, e.g. number_on_roll: 398, so the model can tell similar numbers apart.
  • Weak matches are dropped: results below half the top score (MinimumRelevanceFilter).
  • Large results: whole results are kept, most relevant first, up to MaxEvidenceCharacters; the rest are left out with a note, so citations still match. To fetch less, lower size.

Citations

Agents cite results as [Evidence n]. Each one reaches your app as something a reader can use, with no settings:

The result has Rated Good [Evidence 1]. becomes
A field holding a full web address Rated Good [<a href="https://reports.ofsted.gov.uk/...">Copthorne School – Key Stage 2…</a>].
No web address Rated Good [Copthorne School – Key Stage 2…].
  • Text: the start of the result, on one line, cut at about 80 characters, in square brackets.
  • Link: the first field whose whole value is a full https or http address. It isn't sent to the model, so the model can't write links itself. With ContentFields set, include the address field (e.g. url).
  • Render answers as HTML (or Markdown that allows HTML). It's safe: citation links are the only real HTML.
  • No citations for an agent with RequiredCitations = false: they aren't asked for, and any written are removed.
  • Citations change only after the answer is checked. Works for RunAsync, RunStreamingAsync and RunParallelAsync (return the search result from resolveEvidence). Evidence joined from several searches keeps [Evidence n].

Keyword search misses documents that use different words, e.g. "safeguarding concerns" and "child protection issues". Set either or both of these on an index:

"Indexes": [ {
  "Name": "ofsted_index",
  "ContentFields": [ "title", "content" ],
  "SemanticConfiguration": "default",
  "VectorFields": [ "contentVector" ]
} ]
Setting Search type The index needs
Neither Keyword Nothing extra
SemanticConfiguration Keyword, re-ranked by meaning A semantic configuration, and the semantic ranker enabled (Basic tier or higher)
VectorFields Hybrid: keyword plus vector A vectorizer, so the service embeds the query (your app needs no embedding model)
Both Hybrid, re-ranked by meaning (best results) Both of the above

Your filter is applied before the vector search, so hybrid results still match only the record you asked about.

Settings

All under AiAgents:AISearch.

Setting Default Purpose
Endpoint Required The search service, e.g. https://<search>.search.windows.net
Indexes Required Each index's Name (the scope you search), plus the settings below
Indexes:n:ContentFields Every string field The fields sent to the model, in order
Indexes:n:SemanticConfiguration None Re-rank by meaning (Basic tier or higher)
Indexes:n:VectorFields None Hybrid keyword and vector search
Indexes:n:LabelFields true Labels each value with its field, one per line; false sends the values alone
MinimumRelevanceFilter 0.5 Drops results below this share of the top score
MaxEvidenceCharacters 190,000 Evidence per search, whole results only; just under core's 200,000
MaxRetryAttempts 3 Retries of a failed search
Authentication The default identity A separate identity for search
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1-prerelease.405 0 10/14/2026
0.0.1-prerelease.374 0 10/14/2026
0.0.1-prerelease.344 30 10/13/2026
0.0.1-prerelease.316 45 10/9/2026
0.0.1-prerelease.289 49 10/9/2026
0.0.1-prerelease.263 44 10/9/2026
0.0.1-prerelease.238 43 10/9/2026
0.0.1-prerelease.214 43 10/9/2026
0.0.1-prerelease.191 37 10/9/2026
0.0.1-prerelease.169 42 10/9/2026
0.0.1-prerelease.148 45 10/9/2026
0.0.1-prerelease.128 51 10/9/2026
0.0.1-prerelease.109 51 10/7/2026
0.0.1-prerelease.91 51 10/7/2026
0.0.1-prerelease.74 55 10/6/2026
0.0.1-prerelease.58 54 10/5/2026
0.0.1-prerelease.44 51 10/5/2026
0.0.1-prerelease.31 50 10/5/2026
0.0.1-prerelease.20 61 10/2/2026
0.0.1-prerelease.10 54 10/2/2026