Retrievo is an innovative in-memory search library for .NET that seamlessly integrates BM25 lexical matching with vector similarity search. With no external servers or databases required, it's perfect for small-scale applications, offline scenarios, and lightweight developer tools, delivering efficient search capabilities up to 10,000 documents.
Retrievo is an innovative open-source search library designed specifically for .NET, offering a powerful combination of BM25 lexical matching and vector similarity search. With the ability to merge results through Reciprocal Rank Fusion (RRF), Retrievo provides a comprehensive search experience without the need for external servers or databases. It is ideal for managing corpora of up to approximately 10,000 documents, making it perfect for applications involving local agent memory, small retrieval-augmented generation (RAG) pipelines, developer tools, and offline or edge scenarios.
Retrievo boasts an intuitive and efficient index management system:
Retrievo enables rapid setup and execution of search operations:
using Retrievo;
using Retrievo.Models;
var index = new HybridSearchIndexBuilder()
.AddDocument(new Document { Id = "1", Body = "Neural networks learn complex patterns." })
.AddDocument(new Document { Id = "2", Body = "Kubernetes orchestrates container deployments." })
.Build();
using var _ = index;
var response = index.Search(new HybridQuery { Text = "neural network training", TopK = 5 });
foreach (var r in response.Results)
Console.WriteLine($" {r.Id}: {r.Score:F4}");
Retrievo supports integration with Azure OpenAI for enhanced capabilities. This allows documents to be embedded at build time and queries to be processed using advanced embeddings:
using Retrievo.AzureOpenAI;
var provider = new AzureOpenAIEmbeddingProvider(
new Uri("https://your-resource.openai.azure.com/"),
"your-api-key",
"text-embedding-3-small");
using var index = await new HybridSearchIndexBuilder()
.AddFolder("./docs") // loads *.md and *.txt recursively
.WithEmbeddingProvider(provider)
.BuildAsync();
var response = await index.SearchAsync(new HybridQuery { Text = "how to deploy", TopK = 5 });
Retrievo has been validated against the BEIR benchmark with impressive retrieval quality and quick query latency:
| Dataset | Hybrid (default) |
|---|---|
| NFCorpus | 0.392 |
| SciFact | 0.756 |
Query latency, even with hybrid configurations, remains below 10 ms for hybrid queries. Retrievo is optimized for effective interactions with document collections of moderate size, ensuring a smooth user experience.
Future developments include:
Retrievo represents a significant advancement in the field of search technologies for .NET, offering powerful features and capabilities suitable for both developers and end-users alike.
No comments yet.
Sign in to be the first to comment.