LangChain.Databases.Abstractions 0.17.1-dev.37

This is a prerelease version of LangChain.Databases.Abstractions.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package LangChain.Databases.Abstractions --version 0.17.1-dev.37
                    
NuGet\Install-Package LangChain.Databases.Abstractions -Version 0.17.1-dev.37
                    
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="LangChain.Databases.Abstractions" Version="0.17.1-dev.37" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LangChain.Databases.Abstractions" Version="0.17.1-dev.37" />
                    
Directory.Packages.props
<PackageReference Include="LangChain.Databases.Abstractions" />
                    
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 LangChain.Databases.Abstractions --version 0.17.1-dev.37
                    
#r "nuget: LangChain.Databases.Abstractions, 0.17.1-dev.37"
                    
#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 LangChain.Databases.Abstractions@0.17.1-dev.37
                    
#: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=LangChain.Databases.Abstractions&version=0.17.1-dev.37&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=LangChain.Databases.Abstractions&version=0.17.1-dev.37&prerelease
                    
Install as a Cake Tool

LangChain.Databases

Database abstractions and vector store backends for the LangChain.NET ecosystem.

Philosophy

This project aligns with the Microsoft.Extensions ecosystem. For vector search, we use Microsoft.Extensions.VectorData.Abstractions (MEVA) — the industry-standard .NET vector data abstraction. For backends that have official Semantic Kernel connectors, consumers should reference those packages directly rather than using wrappers.

Packages

Vector stores (MEVA implementations)

These packages implement VectorStore / VectorStoreCollection<TKey, TRecord> from Microsoft.Extensions.VectorData:

Package Backend NuGet
LangChain.Databases.Postgres PostgreSQL + pgvector NuGet
LangChain.Databases.OpenSearch OpenSearch k-NN NuGet

Chat message history

Package Backend NuGet
LangChain.Databases.Abstractions In-memory, file-based NuGet
LangChain.Databases.Redis Redis NuGet
LangChain.Databases.Mongo MongoDB NuGet

Use SK connectors for other backends

For backends with official Semantic Kernel connectors, use those packages directly:

Backend SK Connector Package
In-Memory Microsoft.SemanticKernel.Connectors.InMemory
SQLite Microsoft.SemanticKernel.Connectors.Sqlite
Chroma Microsoft.SemanticKernel.Connectors.Chroma
Qdrant Microsoft.SemanticKernel.Connectors.Qdrant
Pinecone Microsoft.SemanticKernel.Connectors.Pinecone
Weaviate Microsoft.SemanticKernel.Connectors.Weaviate
Milvus Microsoft.SemanticKernel.Connectors.Milvus
DuckDB Microsoft.SemanticKernel.Connectors.DuckDB
Azure AI Search Microsoft.SemanticKernel.Connectors.AzureAISearch
Redis (vector) Microsoft.SemanticKernel.Connectors.Redis
MongoDB (vector) Microsoft.SemanticKernel.Connectors.MongoDB

Quick start

1. Define a record type

using Microsoft.Extensions.VectorData;

public class DocumentRecord
{
    [VectorStoreKey]
    public string Id { get; set; } = Guid.NewGuid().ToString();

    [VectorStoreData]
    public string Text { get; set; } = string.Empty;

    [VectorStoreVector(1536)]
    public ReadOnlyMemory<float> Embedding { get; set; }
}

2. Create a store and collection

// PostgreSQL + pgvector
var store = new PostgresVectorStore(connectionString);

// Or OpenSearch
var store = new OpenSearchVectorStore(new OpenSearchVectorDatabaseOptions
{
    ConnectionUri = new Uri("http://localhost:9200"),
});

// Or SK InMemory
var store = new InMemoryVectorStore();

var collection = store.GetCollection<string, DocumentRecord>("my_collection");
await collection.EnsureCollectionExistsAsync();
await collection.UpsertAsync(new DocumentRecord
{
    Text = "hello world",
    Embedding = embedding,
});

await foreach (var result in collection.SearchAsync(
    new ReadOnlyMemory<float>(queryEmbedding), top: 5))
{
    Console.WriteLine($"{result.Record.Text} (score: {result.Score})");
}

Migration from IVectorDatabase

The legacy IVectorDatabase / IVectorCollection interfaces have been removed in favor of MEVA. See the migration guide for detailed before/after examples.

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on LangChain.Databases.Abstractions:

Package Downloads
LangChain.Core

LangChain core classes.

LangChain.Databases.InMemory

InMemory db for LangChain.

LangChain.Databases.Sqlite

SQLite for LangChain.

LangChain.Databases.Chroma

Chroma for LangChain.

LangChain.Databases.Redis

Redis chat message history for LangChain.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on LangChain.Databases.Abstractions:

Repository Stars
tryAGI/LangChain
C# implementation of LangChain. We try to be as close to the original as possible in terms of abstractions, but are open to new entities.
Version Downloads Last Updated
0.17.1-dev.42 45 3/21/2026
0.17.1-dev.41 34 3/21/2026
0.17.1-dev.40 30 3/21/2026
0.17.1-dev.39 31 3/21/2026
0.17.1-dev.37 36 3/20/2026
0.17.1-dev.36 44 3/20/2026
0.17.1-dev.35 32 3/20/2026
0.17.1-dev.32 38 3/20/2026
0.17.1-dev.31 37 3/20/2026
0.17.1-dev.30 36 3/20/2026
0.17.1-dev.28 36 3/20/2026
0.17.1-dev.27 45 3/20/2026
0.17.1-dev.11 19,717 4/21/2025
0.17.1-dev.10 1,340 4/9/2025
0.17.1-dev.9 1,157 3/31/2025
0.17.1-dev.8 178 3/28/2025
0.17.1-dev.5 319 2/20/2025
0.17.1-dev.2 259 2/11/2025
0.17.0 113,240 1/31/2025
0.16.1-dev.15 144 1/29/2025
Loading failed