GraphBridge.GraphRag
0.2.0-preview.1
Prefix Reserved
dotnet add package GraphBridge.GraphRag --version 0.2.0-preview.1
NuGet\Install-Package GraphBridge.GraphRag -Version 0.2.0-preview.1
<PackageReference Include="GraphBridge.GraphRag" Version="0.2.0-preview.1" />
<PackageVersion Include="GraphBridge.GraphRag" Version="0.2.0-preview.1" />
<PackageReference Include="GraphBridge.GraphRag" />
paket add GraphBridge.GraphRag --version 0.2.0-preview.1
#r "nuget: GraphBridge.GraphRag, 0.2.0-preview.1"
#:package GraphBridge.GraphRag@0.2.0-preview.1
#addin nuget:?package=GraphBridge.GraphRag&version=0.2.0-preview.1&prerelease
#tool nuget:?package=GraphBridge.GraphRag&version=0.2.0-preview.1&prerelease
GraphBridge.GraphRag
Experimental. GraphRAG building blocks for GraphBridge, the EF Core provider for Neo4j. The API may change in any preview; using it reports GBRAG001, which you acknowledge once with <NoWarn>$(NoWarn);GBRAG001</NoWarn>.
Everything is stored through EF Core as typed entities, and every quote keeps the exact bytes it came from.
- Documents, sections and chunks:
- EF entities linked child to parent (
IN_DOCUMENT,SECTION_OF,IN_SECTION,NEXT_CHUNK,SUBSECTION_OF); - each chunk's text is exactly its document's UTF-8 bytes
[StartByte, EndByte).
- EF entities linked child to parent (
- Embeddings: a mapped
float[]property, written by anyMicrosoft.Extensions.AIIEmbeddingGenerator. - Resumable ingestion:
- one transaction per document, and a lease per document;
- unchanged documents are skipped;
- transient model failures are retried, 4 times by default;
- files named by a URI keep their documents' IDs wherever they are.
- Retrieval and answers:
- vector and full-text search fused by rank;
- an evidence budget and a trace of where each item came from;
- answers whose every citation is located in the stored text, or a refusal with a reason;
- search scoped to documents, sections, metadata or a Cypher query;
- streamed answers, whose text is provisional until its citations are checked;
- follow-up questions, rewritten with the conversation so far before they are retrieved;
- answer export: one answer as one JSON document, whose citations
Checkconfirms without the database; - derived text, such as OCR or a converted Office file: every citation names where the text came from;
- experimental Text2Cypher, off by default: rows of a read-only query a model writes, behind a checked query and the server's plan.
- Ontologies and extraction: the standard generic document, novel and article ontologies, or your own classes.
- Extraction prunes what the ontology doesn't allow and records why.
- Every mention and quote is located in its chunk.
- Things resolve by exact name; placeholders such as "the man" never merge.
- Facts list every document that states them.
WithNeo4jGraphRagEntities()stores things in neo4j-graphrag's entity shape (__Entity__,FROM_CHUNK,name), so its retrievers read them.
- Maintenance: remove sources, in batches, reset what the toolkit wrote, clean up orphans, merge duplicate things with undo, and a health report.
- Agent tools:
GraphRagToolsgives any chat client or agentanswer_from_documents,search_documentsand, with an ontology,find_thingsandrelated_facts. Every result carries IDs and byte spans, and an optional trail records each call. - Re-embedding:
GraphRagReembedding.Plan(...)moves to a new embedding set through a staging property, with preview, backfill, cut-over and clean-up, never replacing vectors in place. - Adopt mode:
GraphRagAdoption.Plan(...)takes over a lexical graph Neo4j's Pythonneo4j-graphragbuilt, with a dry run, apply and undo; citations say whether they point into the source file or only into the stored chunk. - Adapters:
GraphBridge.GraphRag.DataIngestionfor DataIngestion pipelines,GraphBridge.GraphRag.AgentFrameworkfor Agent Framework agents,GraphBridge.GraphRag.AspNetCorefor streaming endpoints, andGraphBridge.GraphRag.Pdffor PDF files with page-aware citations. - Layouts:
GraphRagLayout.Default, orGraphRagLayout.Neo4jGraphRagfor the names Neo4j's Pythonneo4j-graphraglibrary reads.
// The model: dimensions must equal the embedding set's; the ontology is optional.
protected override void OnModelCreating(ModelBuilder modelBuilder)
=> modelBuilder.AddGraphRag(1536, o => o.Ontology = GraphRagOntologies.Article);
// The services: an IEmbeddingGenerator<string, Embedding<float>>, and an IChatClient for answers and extraction.
var set = new GraphRagEmbeddingSet("text-embedding-3-small", 1536);
services.AddGraphRag<AppDbContext>(set);
// The schema: constraints and indexes as typed migration steps, in your own reviewed plan.
var plan = new GraphMigrationPlan("app-002-graphrag", "app-001", GraphRagSchema.CreateSteps(GraphRagLayout.Default, set, GraphRagOntologies.Article),
GraphMigrationRollbackPolicy.NoRollback("Dropping the indexes is a separate migration."));
await db.Database.ApplyGraphMigrationAsync(plan);
// Ingest the folder's Markdown, then ask, or query the graph with LINQ.
// .Folder reads *.md by default; pass "*.txt" for plain text.
var receipt = await ingestion.IngestAsync(GraphRagSources.Folder("articles"));
var answer = await answers.AnswerAsync("Who works for the library?");
var quotes = await db.Set<Quoted>().ToListAsync();
Samples 07 to 09 in the repository run offline. Requires Neo4j 2026.09 or later. Design: ADR 0052 in the repository's docs/architecture/adr.
| 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
- GraphBridge.EntityFrameworkCore (>= 0.2.0-preview.1)
- Microsoft.Extensions.AI.Abstractions (>= 10.11.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on GraphBridge.GraphRag:
| Package | Downloads |
|---|---|
|
GraphBridge.GraphRag.DataIngestion
Experimental adapter between Microsoft.Extensions.DataIngestion and the GraphBridge GraphRAG toolkit: a chunk writer that stores pipeline chunks with exact positions in Neo4j through EF Core, and a span-aware chunker. Depends on a preview of DataIngestion. The API may change in any preview. |
|
|
GraphBridge.GraphRag.AspNetCore
Experimental ASP.NET Core endpoints for the GraphBridge GraphRAG toolkit: ask with a streamed answer whose citations are checked against the stored text, search passages with exact spans, and read a document's metadata. The API may change in any preview. |
|
|
GraphBridge.GraphRag.AgentFramework
Experimental Microsoft Agent Framework adapter for the GraphBridge GraphRAG toolkit: a context provider that gives an agent document tools whose answers carry citations checked against the stored text. The API may change in any preview. |
|
|
GraphBridge.GraphRag.Pdf
Experimental PDF loader for the GraphBridge GraphRAG toolkit: ingests a PDF's text layer page by page with PdfPig, and stores a page map so citations name their pages. The API may change in any preview. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.2.0-preview.1 | 87 | 10/30/2026 |
Developer preview. Release notes and the breaking-change policy: https://github.com/joslat/GraphBridge.EFCore/blob/main/CHANGELOG.md