VectorRAG.Net 0.1.17

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

VectorRAG.Net

VectorRAG.Net is a high-performance,.NET-native vector database library for semantic search and RAG (Retrieval-Augmented Generation):

Fast ANN search (LSH candidates β†’ exact rerank by dot/cosine) Low-latency hot path with careful allocations Document chunking for RAG Metadata + filtering Optional hybrid search (vector + BM25 full-text) Persistence:save/load database snapshots Runtime metrics

This is a library-first product:you embed it into your application and expose REST/gRPC/etc. yourself.


πŸš€ Performance Benchmarks

The goal of VectorRAG.Net is low-latency embedded vector search for .NET applications (in-process,without network/RPC overhead).

Environment OS:Windows 11 CPU:Intel Core i5-11400F (6C/12T) .NET:8.0.23 BenchmarkDotNet:0.15.8

Workload Documents:10,000 Embedding dimension:64 (deterministic synthetic embeddings for reproducibility) TopK:5 Vector search:Random Hyperplane LSH candidates β†’ exact rerank by dot Hybrid search:Vector + BM25 (hashed term IDs,DF cutoff enabled) Grouping:GroupByParentDocument = true

Results

Operation Docs Mean Allocated
Vector-only search (TopK=5) 10,000 15.15 ΞΌs 5.69 KB
Hybrid search (TopK=5) 10,000 116.73 ΞΌs 14.85 KB

Throughput note: based on the benchmark mean,vector-only search corresponds to ~66,000 queries/second per thread in this synthetic setup. Real-world throughput depends on embedding dimension (e.g. 768/1536),candidate limits,text distributions,metadata filtering,and CPU scaling.

Important:These benchmarks measure in-process compute only. If you host the library behind HTTP/gRPC,transport and serialization overhead will increase end-to-end latency.


Project structure

SlidingRank.FastOps (Core Engine) EmbeddingMatrix β€” dense float[] storage for NΓ—Dim RandomHyperplaneLshIndex β€” Random Hyperplane LSH (Signed Random Projections) SimdFloatMath β€” SIMD dot/L2 helpers EmbeddingAnnSearch β€” optimized ANN search (LSH + rerank),including low-allocation paths

VectorRAG.Net (RAG Layer) VectorRAGDatabase β€” indexing,search,chunking-based RAG storage,updates,persistence,metrics ChunkingOptions β€” chunking configuration IEmbeddingModel + adapters (e.g. OpenAIEmbeddingModel) RAGPipeline helper for context building Internal BM25 index for hybrid search


Quick start

Create database

using SlidingRank.FastOps;
using VectorRAG.Net;

var lsh = new EmbeddingLshConfig(
 Bands:24,
 BitsPerBand:12,
 MaxCandidates:2048,
 Seed:1337);

var options = new VectorRagDatabaseOptions
{
 InitialCapacity = 8192,
 QueryCacheCapacity = 1000,
 NormalizeVectorsOnAdd = false,
 NormalizeQueryOnSearch = false,
 DefaultChunking = new ChunkingOptions
 {
 Strategy = ChunkingStrategy.FixedChars,
 ChunkSize = 1000,
 ChunkOverlap = 200
 }
};

var db = new VectorRAGDatabase(dimension:1536,lshConfig:lsh,options:options);

Embedding model (example:OpenAI)

IEmbeddingModel model = new OpenAIEmbeddingModel(
 apiKey:"sk-...",
 model:"text-embedding-3-small",
 dimension:1536);

Upsert a document (RAG-friendly chunking)

await db.UpsertTextDocumentAsync(
 externalId:"faq_000123",
 text:File.ReadAllText("faq_000123.txt"),
 metadata:new DocumentMetadata { Department = "Support",IsActive = true },
 embeddingModel:model);

Search (vector only)

var qVec = await model.GenerateEmbeddingAsync("how do I reset my password?");
var results = db.Search(qVec,new SearchOptions { TopK = 5,UseHybrid = false });

Hybrid search (vector + BM25)

var q = "reset password";
var qVec = await model.GenerateEmbeddingAsync(q);

var results = db.Search(qVec,new SearchOptions
{
 TopK = 5,
 UseHybrid = true,
 TextQuery = q,
 Alpha = 0.7f
});

Persistence

await db.SaveAsync("C:/rag/snap_2026_02_08");
await db.LoadAsync("C:/rag/snap_2026_02_08");

Metrics

var m = db.GetMetrics();
Console.WriteLine($"active={m.RecordsActive}/{m.RecordsTotal},avg={m.AvgQueryMs:0.00} ms");

🏒 Example Use Cases

  1. Banking / Compliance Knowledge Base
var q = "AML compliance requirements for cryptocurrency";
var qVec = await embeddingModel.GenerateEmbeddingAsync(q);

var results = db.Search(qVec,new SearchOptions
{
 TopK = 5,
 UseHybrid = true,
 TextQuery = q,
 Alpha = 0.7f,
 Filter = md => md.Department == "Compliance" && md.IsActive,
 GroupByParentDocument = true
});
  1. E-commerce Product Search (with metadata filtering)
var qVec = await embeddingModel.GenerateEmbeddingAsync("wireless noise cancelling headphones");

var results = db.Search(qVec,new SearchOptions
{
 TopK = 10,
 UseHybrid = false,
 Filter = md => md.Attributes != null
 && md.Attributes.TryGetValue("category",out var c) && c == "electronics"
 && md.Attributes.TryGetValue("price",out var p) && int.Parse(p) <= 1000
});
  1. Customer Support RAG Chatbot (retrieve + build context)
var q = "How do I reset my password?";
var qVec = await embeddingModel.GenerateEmbeddingAsync(q);

var results = db.Search(qVec,new SearchOptions
{
 TopK = 5,
 UseHybrid = true,
 TextQuery = q,
 Alpha = 0.7f,
 Filter = md => md.Department == "Support" && md.IsActive
});

var pipeline = new RAGPipeline(embeddingModel);
var context = pipeline.BuildPromptContext(results,maxTokens:3500);
// context -> prompt -> LLM

πŸ”§ Integration Notes

VectorRAG.Net is library-first. You can embed it into: Console applications Windows services / Linux daemons Background workers ASP.NET Core / gRPC (optional β€” you host it yourself)

Persistence is file-based and works well for: local deployments container volumes scheduled snapshotting (e.g. nightly)


πŸ“ˆ Scaling Guidance

Single process Use batching for ingestion (AddBatch / document upserts in batches). Tune LSH config (Bands,BitsPerBand,MaxCandidates) for your recall/latency target. Keep embeddings normalized if using dotβ‰ˆcosine.

Multi-process / sharding (application-level) For very large collections you can shard at the application layer: split documents by tenant/department/time range query multiple shards in parallel merge topK results


πŸ” Security & Compliance (Status)

The core library does not enforce authentication/authorization by itself (it is an embedded engine). Security is handled by the host application.

Roadmap / optional add-ons (not included in the core package): encryption-at-rest for persisted snapshots document-level permissions (RBAC hooks) audit logging hooks hosted REST/gRPC templates


πŸ†š Why VectorRAG.Net?

.NET-native embedded engine (no external DB required) Focus on low latency and controlled allocations RAG-friendly features:chunking,metadata filtering,hybrid retrieval,context assembly Suitable for enterprise workloads where predictable performance matters


πŸ“¦ Editions

Edition Price For Features
Community Free Developers / startups Core engine + basic RAG
Professional $499/mo Companies up to 100 people Persistence,metadata,convenience APIs,priority support
Enterprise $1999/mo Large organizations Hybrid search,rereanking (cross-encoder),SLA/support

Note:This table describes the intended product packaging. Actual availability depends on the packages and licensing you publish.

Commercial licensing & support

Community Edition:free to use for developers and startups. Professional / Enterprise:paid subscriptions with additional features and support.

Contact for pricing, invoices, and licensing: Email: vipvodu@yandex.ru Telegram: @vipvodu

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
0.1.17 104 2/14/2026