SimpleRag 1.0.1

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

GitHub Actions Workflow Status GitHub Issues or Pull Requests by label Libraries.io dependency status for GitHub repo

SimpleRag

A Simple and Opinionated AI RAG Solutions for SourceCode, where you just need to setup and point to your source and we take care of the rest.

NuGet

Getting Started

Step 1: Install SimpleRag Nuget + your Embedding Generator (in this sample Azure OpenAI via Semantic Kernel and SQL Server 2025 as VectorStore)

dotnet add package SimpleRag
dotnet add package Microsoft.SemanticKernel
dotnet add package Microsoft.SemanticKernel.Connectors.SqlServer

Step 2: Setup Dependency Injection of Embedding Generator and SimpleRag

string endpoint = builder.Configuration["AiEndpoint"]!;
string key = builder.Configuration["AiKey"]!;
string embeddingDeploymentName = builder.Configuration["AiEmbeddingDeploymentName"]!;
string sqlServerConnectionString = builder.Configuration["SqlServerConnectionString"]!;
string githubToken = builder.Configuration["GitHubToken"]!;

//Setup Github Credentials (optional, but needed if you wish to RAG data directly from GitHub)
builder.Services.AddSingleton(new GitHubCredentials(githubToken));

//Setup Embedding Generator
builder.Services.AddAzureOpenAIEmbeddingGenerator(embeddingDeploymentName, endpoint, key);

//Setup SimpleRag
builder.Services.AddSimpleRag(vectorStoreConfiguration, options => new SqlServerVectorStore(sqlServerConnectionString, new SqlServerVectorStoreOptions
{
    EmbeddingGenerator = options.GetRequiredService<IEmbeddingGenerator<string, Embedding<float>>>()
}));

Step 3: Ingest Data into your VectorStore (in this sample the TrelloDotNet open-source repo)

public class IngestionExample(Ingestion ingestion, IServiceProvider serviceProvider)
{
    public async Task Sync()
    {
        CollectionId collectionId = new("TrelloDotNet");
        DataSourceProviderGitHub filesProvider = new(serviceProvider)
        {
            GitHubRepository = new()
            {
                Owner = "rwjdk",
                Name = "TrelloDotNet"
            }
        };

        await ingestion.IngestAsync(
        [
            new CSharpDataSource(serviceProvider)
            {
                CollectionId = collectionId,
                Id = new SourceId("Code"),
                Recursive = true,
                Path = "src",
                FileIgnorePatterns = "TrelloDotNet.Tests",
                FilesProvider = filesProvider
            },
            new MarkdownDataSource(serviceProvider)
            {
                CollectionId = collectionId,
                Id = new SourceId("Markdown"),
                Recursive = true,
                Path = "/",
                FilesProvider = filesProvider
                LevelsToChunk = 3,
            }
        ], new IngestionOptions
        {
            OnProgressNotification = notification => Console.WriteLine(notification.GetFormattedMessageWithDetails()),
        }, cancellationToken);
    }
}

Step 4: Search your VectorStore

public class SearchExample(Search search)
{
    public async Task<string> SearchAsync(string question)
    {
        SearchResult searchResult = await search.SearchAsync(new SearchOptions
        {
            CollectionId = new CollectionId("TrelloDotNet"),
            SearchQuery = searchQuery,
            NumberOfRecordsBack = 10
        });
        
        return searchResult.GetAsStringResult();
    }
}
  • PDF Extraction is done with Nuget Package PDFPig (Apache 2.0 License)
  • Retry Logic is provided by Nuget Package Polly (BSD-3)
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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

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.1 375 11/13/2025
1.0.0 472 9/17/2025
0.0.2-preview6 261 7/31/2025
0.0.2-preview5 445 7/25/2025
0.0.2-preview4 459 7/25/2025
0.0.2-preview3 604 7/23/2025
0.0.2-preview2 605 7/22/2025
0.0.2-preview1 567 7/21/2025
0.0.1-preview9 439 7/12/2025
0.0.1-preview8 154 7/12/2025
0.0.1-preview7 171 7/11/2025
0.0.1-preview6 212 7/10/2025
0.0.1-preview5 210 7/3/2025
0.0.1-preview4 208 7/2/2025
0.0.1-preview3 183 6/29/2025
0.0.1-preview2 176 6/28/2025
0.0.1-preview12 131 7/19/2025
0.0.1-preview11 206 7/15/2025
0.0.1-preview10 219 7/15/2025
0.0.1-preview1 163 6/28/2025