Rag.NET.GraphRag
0.1.0
See the version list below for details.
dotnet add package Rag.NET.GraphRag --version 0.1.0
NuGet\Install-Package Rag.NET.GraphRag -Version 0.1.0
<PackageReference Include="Rag.NET.GraphRag" Version="0.1.0" />
<PackageVersion Include="Rag.NET.GraphRag" Version="0.1.0" />
<PackageReference Include="Rag.NET.GraphRag" />
paket add Rag.NET.GraphRag --version 0.1.0
#r "nuget: Rag.NET.GraphRag, 0.1.0"
#:package Rag.NET.GraphRag@0.1.0
#addin nuget:?package=Rag.NET.GraphRag&version=0.1.0
#tool nuget:?package=Rag.NET.GraphRag&version=0.1.0
Rag.NET.GraphRag
GraphRAG for Rag.NET: an LLM extracts entities and relationships during ingestion, Leiden
community detection organises them (via Rag.NET.Graph), and retrieval answers entity
questions with local graph search or corpus-wide questions with community-report
map-reduce.
Install
dotnet add package Rag.NET.GraphRag
Setup
GraphRAG adds behaviors to both pipelines:
using Rag.NET.DependencyInjection;
using Rag.NET.GraphRag;
using Rag.NET.Ingestion.Behaviors;
using Rag.NET.Retrieval.Behaviors;
services.AddRagNet(
configure: rag => rag.UseGraphRag(
options => options.GleaningPasses = 1,
retrieval: options => options.PageRankWeight = 0.3,
graph: store => store.UseSqlite("graphrag.db")),
ingestion: p => p
.Add<GraphEntityExtractionBehavior>(after: typeof(EmbeddingBehavior))
.Add<CommunityDetectionBehavior>(after: typeof(GraphEntityExtractionBehavior)),
retrieval: p => p
.Add<GraphLocalSearchBehavior>(before: typeof(RerankingBehavior)));
Example
Constrain extraction and route cheap models to the high-volume LLM work:
rag.UseGraphRag(options =>
{
options.GleaningPasses = 1; // follow-up extraction passes
options.EntityTypes = ["Person", "Organization"]; // null = open set
options.MaxEntityDescriptionLength = 500; // summarisation threshold
});
Which search runs is decided by the behaviors you add to the retrieval pipeline:
GraphLocalSearchBehavior for entity questions, GraphGlobalSearchBehavior for
"what are the main themes?" questions over community reports. UseMindMapExtraction
adds hierarchical mind-map nodes instead of flat entities.
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 (>= 0.1.0)
- Rag.NET.Graph (>= 0.1.0)
- ZeroAlloc.Validation (>= 1.5.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.