Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VectorSharp

Tests License: MIT

A high-performance .NET library for in-process vector similarity search and text embedding. No external services required, no Docker, no infrastructure — just NuGet packages that work. Search, storage and chunking run entirely in your process; the embedding and reranking packages let you reach a hosted API when you want one, but never oblige you to.

Packages

Package Description
VectorSharp.Storage In-memory and disk-backed vector storage with SIMD-optimized cosine similarity
VectorSharp.Embedding Channel-based embedding service with configurable parallelism, request batching and token usage reporting
VectorSharp.Embedding.NomicEmbed Nomic Embed Text v1.5 model for local inference (768-dim, 8192 token context)
VectorSharp.Chunking Streaming text chunker with a hard token bound, position-carrying chunks and predefined formats for Markdown, C#, JavaScript/TypeScript, HTML, CSS, Python and plain text
VectorSharp.Reranking Reranking abstractions for the second stage after a vector or hybrid search

Quick Start

dotnet add package VectorSharp.Storage
dotnet add package VectorSharp.Embedding.NomicEmbed
using VectorSharp.Storage;
using VectorSharp.Embedding;
using VectorSharp.Embedding.NomicEmbed;

// Create an embedding service with local model inference
await using EmbeddingService embedder = new EmbeddingService(NomicEmbedProvider.Create);

// Create a vector store
CosineVectorStore<int> store = VectorStore.Create<int>("my-store", embedder.Dimension);

// Embed and store documents
float[] embedding = await embedder.EmbedAsync("some document text", EmbeddingPurpose.Document);
await store.AddAsync(1, embedding);

// Search with a query
float[] queryEmbedding = await embedder.EmbedAsync("find similar docs", EmbeddingPurpose.Query);
IReadOnlyList<SearchResult<int>> results = await store.FindMostSimilarAsync(queryEmbedding, count: 10);

License

MIT

About

A high-performance, zero-dependency .NET library for in-process vector similarity search with both in-memory and disk-backed storage.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages