Rag.NET 1.0.0

dotnet add package Rag.NET --version 1.0.0
                    
NuGet\Install-Package Rag.NET -Version 1.0.0
                    
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="Rag.NET" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rag.NET" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Rag.NET" />
                    
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 Rag.NET --version 1.0.0
                    
#r "nuget: Rag.NET, 1.0.0"
                    
#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 Rag.NET@1.0.0
                    
#: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=Rag.NET&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Rag.NET&version=1.0.0
                    
Install as a Cake Tool

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 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 (19)

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.Resilience

Resilience decorators for Rag.NET: the Polly retry pipeline over embedding generators and vector stores (ConfigureResilience), token-bucket rate limiting for chat and embedding calls (UseRateLimiting), and the multi-provider chat fallback chain (UseFallbackChain)

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

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 415 9/15/2026
0.1.0 611 8/11/2026