Rag.NET
0.1.0
dotnet add package Rag.NET --version 0.1.0
NuGet\Install-Package Rag.NET -Version 0.1.0
<PackageReference Include="Rag.NET" Version="0.1.0" />
<PackageVersion Include="Rag.NET" Version="0.1.0" />
<PackageReference Include="Rag.NET" />
paket add Rag.NET --version 0.1.0
#r "nuget: Rag.NET, 0.1.0"
#:package Rag.NET@0.1.0
#addin nuget:?package=Rag.NET&version=0.1.0
#tool nuget:?package=Rag.NET&version=0.1.0
Rag.NET
The core Retrieval-Augmented Generation pipeline for .NET: AddRagNet() wires ingestion
(parse → chunk → embed → store) and retrieval (query → search → rerank → answer) into any
IServiceCollection, exposed to your code as one IRagPipeline.
Install
dotnet add package Rag.NET
Setup
Rag.NET builds on Microsoft.Extensions.AI: register any IChatClient and
IEmbeddingGenerator<string, Embedding<float>> (OpenAI, Azure OpenAI, Ollama, …) before
calling AddRagNet(). Out of the box this package parses text and Markdown, chunks
recursively, and can run entirely in memory — perfect for a first spike before you attach a
real vector store package such as Rag.NET.VectorStores.PgVector.
using Microsoft.Extensions.DependencyInjection;
using Rag.NET.Abstractions;
using Rag.NET.DependencyInjection;
using Rag.NET.Storage;
// chatClient / embeddingGenerator: your Microsoft.Extensions.AI implementations.
services.AddSingleton(chatClient);
services.AddSingleton(embeddingGenerator);
services.AddSingleton<IVectorStore>(new InMemoryVectorStore()); // nothing persisted
services.AddRagNet();
Example
using Microsoft.Extensions.DependencyInjection;
using Rag.NET.Abstractions;
using Rag.NET.Models;
var pipeline = provider.GetRequiredService<IRagPipeline>();
using var stream = File.OpenRead("notes.md");
var ingested = await pipeline.IngestAsync(stream, new DocumentMetadata
{
DocumentId = new DocumentId("notes"),
FileName = "notes.md",
ContentType = "text/markdown",
});
var response = await pipeline.AskAsync("What do the notes say about pricing?");
Console.WriteLine(response.Answer);
foreach (var source in response.Sources)
Console.WriteLine($"[{source.Score:F2}] {source.Chunk.Text}");
RetrieveAsync returns raw ranked chunks, AskStreamingAsync streams the answer
token-by-token, and the RagBuilder passed to AddRagNet(rag => …) activates self-query,
parent-document retrieval, MMR, corrective RAG, conversation memory and more.
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
- Microsoft.Extensions.AI.Abstractions (>= 10.8.3)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.10)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.ML.Tokenizers (>= 1.0.3)
- Microsoft.ML.Tokenizers.Data.Cl100kBase (>= 1.0.3)
- Rag.NET.Abstractions (>= 0.1.0)
- Rag.NET.QueryTechniques (>= 0.1.0)
- ZeroAlloc.Inject (>= 1.7.2)
- ZeroAlloc.Pipeline (>= 1.2.1)
- ZeroAlloc.Results (>= 1.2.0)
- ZeroAlloc.Specification (>= 1.1.0)
- ZeroAlloc.Validation (>= 1.5.5)
NuGet packages (18)
Showing the top 5 NuGet packages that depend on Rag.NET:
| Package | Downloads |
|---|---|
|
Rag.NET.DataProviders
Shared OAuth and base class infrastructure for Rag.NET data provider connectors |
|
|
Rag.NET.Mediator
ZeroAlloc.Mediator integration for Rag.NET |
|
|
Rag.NET.Api
ASP.NET Core REST API for Rag.NET pipelines |
|
|
Rag.NET.Diagnostics
Disposable in-memory pipeline traces for Rag.NET: the last N query executions, with chunk scores, stage latencies and guard actions |
|
|
Rag.NET.Api.Grpc
gRPC service for Rag.NET pipelines |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 246 | 8/11/2026 |