-
Notifications
You must be signed in to change notification settings - Fork 0
ExtensionsVectorData Lodestar.Extensions.VectorData
Development build. This page describes
main, not a released package. The latest published Lodestar.Extensions.VectorData is 0.1.0 — read its documentation.
An in-process Microsoft.Extensions.VectorData store: collections of records with
vector search over Lodestar's EmbeddingIndex, keyword search over Bm25Index, and hybrid search
fusing the two by reciprocal rank. Nothing to deploy: the store lives in the process that uses
it.
Note is any record class carrying a key, a text and a vector property.
dotnet add package Lodestar.Extensions.VectorDatausing Lodestar.Extensions.VectorData;
using Microsoft.Extensions.VectorData;
static async Task<string> FuseAsync()
{
using var notes = new LodestarVectorStoreCollection<string, Note>("notes");
await notes.UpsertAsync([
new Note { Id = "a", Text = "the cat sat on the mat", Embedding = new float[] { 1f, 0f, 0f } },
new Note { Id = "b", Text = "the dog ran in the park", Embedding = new float[] { 0f, 1f, 0f } },
new Note { Id = "c", Text = "an elephant crossed the river", Embedding = new float[] { 0f, 0f, 1f } },
]);
List<VectorSearchResult<Note>> hits = await notes
.HybridSearchAsync(new float[] { 1f, 0f, 0f }, ["elephant", "zebra"], 2)
.ToListAsync();
return string.Join(",", hits.Select(hit => hit.Record.Id)); // c,a
}Its search sits on Lodestar.Embeddings and Lodestar.Text, which carry the parity;
the store follows the Microsoft.Extensions.VectorData contracts.
docs/equivalence.md maps each Python call to its C#
counterpart, with every deliberate divergence.
A interop package (decision 0003),
built for net10.0 and netstandard2.0:
-
Lodestar.Embeddings0.8.0 or later -
Lodestar.Text0.7.0 or later -
Microsoft.Extensions.VectorData.Abstractions10.10.0 or later