Rag.NET.Mediator
1.1.0
dotnet add package Rag.NET.Mediator --version 1.1.0
NuGet\Install-Package Rag.NET.Mediator -Version 1.1.0
<PackageReference Include="Rag.NET.Mediator" Version="1.1.0" />
<PackageVersion Include="Rag.NET.Mediator" Version="1.1.0" />
<PackageReference Include="Rag.NET.Mediator" />
paket add Rag.NET.Mediator --version 1.1.0
#r "nuget: Rag.NET.Mediator, 1.1.0"
#:package Rag.NET.Mediator@1.1.0
#addin nuget:?package=Rag.NET.Mediator&version=1.1.0
#tool nuget:?package=Rag.NET.Mediator&version=1.1.0
Rag.NET.Mediator
Part of Rag.NET — a modular RAG pipeline for .NET built on Microsoft.Extensions.AI. Ships as 73 packages; install only what you call. Documentation · Choosing packages
ZeroAlloc.Mediator integration for Rag.NET: exposes the pipeline as IngestCommand,
RetrieveQuery and DeleteCommand requests so applications built on the mediator pattern
can drive RAG without holding an IRagPipeline reference.
Install
dotnet add package Rag.NET.Mediator
Setup
using Rag.NET.DependencyInjection;
using Rag.NET.Mediator.DependencyInjection;
services.AddRagNet(rag => rag.UseMediator());
UseMediator() registers the three request handlers; the requests resolve the same
pipeline your other registrations configured.
Example
using Rag.NET.Mediator.Requests;
using Rag.NET.Models;
using var stream = File.OpenRead("report.pdf");
var metadata = new DocumentMetadata
{
DocumentId = new DocumentId("report-2024-q4"),
FileName = "report.pdf",
ContentType = "application/pdf",
};
var result = await mediator.Send(new IngestCommand(stream, metadata));
if (result.IsSuccess)
Console.WriteLine($"Stored {result.Value.ChunksStored} chunks");
var retrieved = await mediator.Send(new RetrieveQuery("key findings", new RetrievalOptions { TopK = 5 }));
if (retrieved.IsSuccess)
foreach (var r in retrieved.Value)
Console.WriteLine($"[{r.Score:F2}] {r.Chunk.Text}");
await mediator.Send(new DeleteCommand(new DocumentId("report-2024-q4")));
Full guide
| Product | Versions 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. |
-
net10.0
- Rag.NET (>= 1.1.0)
- ZeroAlloc.Mediator (>= 5.1.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rag.NET.Mediator:
| Package | Downloads |
|---|---|
|
Rag.NET.Api
ASP.NET Core REST API for Rag.NET pipelines |
GitHub repositories
This package is not used by any popular GitHub repositories.