PinkRooster.Extensions.DataIngestion.CodeAnalysis
1.0.0-preview.4
This is a prerelease version of PinkRooster.Extensions.DataIngestion.CodeAnalysis.
dotnet add package PinkRooster.Extensions.DataIngestion.CodeAnalysis --version 1.0.0-preview.4
NuGet\Install-Package PinkRooster.Extensions.DataIngestion.CodeAnalysis -Version 1.0.0-preview.4
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="PinkRooster.Extensions.DataIngestion.CodeAnalysis" Version="1.0.0-preview.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PinkRooster.Extensions.DataIngestion.CodeAnalysis" Version="1.0.0-preview.4" />
<PackageReference Include="PinkRooster.Extensions.DataIngestion.CodeAnalysis" />
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 PinkRooster.Extensions.DataIngestion.CodeAnalysis --version 1.0.0-preview.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PinkRooster.Extensions.DataIngestion.CodeAnalysis, 1.0.0-preview.4"
#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 PinkRooster.Extensions.DataIngestion.CodeAnalysis@1.0.0-preview.4
#: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=PinkRooster.Extensions.DataIngestion.CodeAnalysis&version=1.0.0-preview.4&prerelease
#tool nuget:?package=PinkRooster.Extensions.DataIngestion.CodeAnalysis&version=1.0.0-preview.4&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

PinkRooster.Extensions.DataIngestion.CodeAnalysis
Roslyn-based C# source code document reader and syntax-aware AST chunker for Microsoft.Extensions.DataIngestion.
Status: release, developed against the .NET 10 SDK and Roslyn Microsoft.CodeAnalysis.CSharp.
dotnet add package PinkRooster.Extensions.DataIngestion.CodeAnalysis --prerelease
Overview
PinkRooster.Extensions.DataIngestion.CodeAnalysis brings syntax-aware source code intelligence to Microsoft RAG ingestion pipelines:
SourceCodeDocumentReader: Ingestion document reader for C# files (.cs), extracting root type hierarchies, documentation comments, and code structures into anIngestionDocument.RoslynCodeChunker: Syntax-aware code chunker leveraging the Roslyn Abstract Syntax Tree (AST). It splits methods, properties, records, and types on natural grammatical boundaries rather than arbitrary line counts, while embedding symbol breadcrumbs (Namespace.Class.Method) intochunk.Contextfor accurate retrieval matching.
Quickstart
using System.Text;
using Microsoft.Extensions.DataIngestion;
using Microsoft.ML.Tokenizers;
using PinkRooster.Extensions.DataIngestion.CodeAnalysis;
var tokenizer = TiktokenTokenizer.CreateForModel("gpt-4o");
var reader = new SourceCodeDocumentReader();
const string sourceCode = """
namespace MyApp.Services;
public sealed class OrderProcessor
{
public bool ProcessOrder(int orderId) => orderId > 0;
}
""";
using var stream = new MemoryStream(Encoding.UTF8.GetBytes(sourceCode));
IngestionDocument doc = await reader.ReadAsync(stream, "OrderProcessor.cs", "text/x-csharp");
var chunkerOptions = new RoslynChunkerOptions(tokenizer)
{
MaxTokensPerChunk = 128,
IncludeEnclosingTypeSignature = true,
};
var chunker = new RoslynCodeChunker(chunkerOptions);
await foreach (IngestionChunk<string> chunk in chunker.ProcessAsync(doc))
{
Console.WriteLine($"Symbol: {chunk.Context}");
Console.WriteLine($"Content:\n{chunk.Content}");
}
Features
- Grammar-Aware Splitting: Preserves syntax node integrity (method signatures, type declarations, attributes, and doc comments).
- Symbol Breadcrumbs: Automatically annotates each chunk with its fully-qualified member context (
chunk.Context). - Conditional Compilation Metadata: Chunks inside
#ifblocks carry their active preprocessor symbols underChunkMetadataKeys.ConditionalSymbols(conditional_symbols), a constant from the Chunkers package. - Enclosing Type Context: Optionally retains enclosing type declaration signatures when sub-chunking oversized method bodies.
Compatibility
- Target Framework: .NET 10 (
net10.0) - Dependencies:
Microsoft.CodeAnalysis.CSharp,Microsoft.ML.Tokenizers,Microsoft.Extensions.DependencyInjection.Abstractions,PinkRooster.Extensions.DataIngestion.Chunkers - Repository: https://github.com/pinkroosterai/PinkRooster.Extensions.DataIngestion
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.CodeAnalysis.CSharp (>= 5.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.ML.Tokenizers (>= 3.0.0)
- PinkRooster.Extensions.DataIngestion.Chunkers (= 1.0.0-preview.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-preview.4 | 57 | 11/21/2026 |
| 1.0.0-preview.3 | 50 | 11/20/2026 |
| 1.0.0-preview.2 | 55 | 11/20/2026 |
| 1.0.0-preview.1 | 58 | 11/20/2026 |