Rag.NET.Graph 1.0.0

dotnet add package Rag.NET.Graph --version 1.0.0
                    
NuGet\Install-Package Rag.NET.Graph -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.Graph" 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.Graph" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Rag.NET.Graph" />
                    
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.Graph --version 1.0.0
                    
#r "nuget: Rag.NET.Graph, 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.Graph@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.Graph&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Rag.NET.Graph&version=1.0.0
                    
Install as a Cake Tool

Rag.NET.Graph

A standalone knowledge-graph library: Leiden community detection, PageRank, and an IGraphStore abstraction with a SQLite implementation. No pipeline dependency — this is the graph engine Rag.NET.GraphRag builds on, usable on its own.

Install

dotnet add package Rag.NET.Graph

Setup

There is nothing to register — construct the store you want and go:

using Rag.NET.Graph;

await using var store = new SqliteGraphStore("graph.db");

Example

using Rag.NET.Graph;
using Rag.NET.Graph.Algorithms;

var entities = new[]
{
    new GraphEntity("Ada Lovelace", "Person", "Wrote the first published algorithm"),
    new GraphEntity("Analytical Engine", "Machine", "Babbage's proposed mechanical computer"),
};
var relationships = new[]
{
    new GraphRelationship("Ada Lovelace", "Analytical Engine", "wrote programs for", Weight: 2.0),
};

await using var store = new SqliteGraphStore("graph.db");
await store.AddEntitiesAsync(entities);
await store.AddRelationshipsAsync(relationships);

var neighbors = await store.GetNeighborsAsync("Ada Lovelace", depth: 2);

// Community detection and PageRank operate on a snapshot of the whole graph.
var graph = await store.GetFullGraphAsync();
var communities = Leiden.Detect(graph, new LeidenOptions { Resolution = 1.0 });
// Every community in the result is connected in the subgraph its members induce.
var ranks = PageRank.Compute(graph);

Leiden is Traag/Waltman/van Eck's algorithm over modularity: Louvain's local moving and aggregation with the paper's refinement phase between them, so every returned community is connected in the subgraph it induces — the guarantee that paper exists to supply, measured at 0 disconnected communities in 3,359,331. The refinement is randomised (Randomness, θ, default 0.01) but every draw comes from RandomSeed, so a fixed seed gives a fixed partition. Two documented departures from the paper: local moving is a repeated sweep rather than its queue-driven MoveNodesFast, and a node is never offered an empty community to move into. The type's own XML remarks give where the guarantee comes from and what it does not promise.

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

Showing the top 1 NuGet packages that depend on Rag.NET.Graph:

Package Downloads
Rag.NET.GraphRag

GraphRAG — entity extraction, community detection, local + global search for Rag.NET

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 106 9/15/2026
0.1.0 114 8/11/2026