VOOZH about

URL: https://www.nuget.org/packages/LangChain.Databases.Mongo

⇱ NuGet Gallery | LangChain.Databases.Mongo 0.17.1




👁 Image
LangChain.Databases.Mongo 0.17.1

dotnet add package LangChain.Databases.Mongo --version 0.17.1
 
 
NuGet\Install-Package LangChain.Databases.Mongo -Version 0.17.1
 
 
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.Mongo" Version="0.17.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LangChain.Databases.Mongo" Version="0.17.1" />
 
Directory.Packages.props
<PackageReference Include="LangChain.Databases.Mongo" />
 
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.Mongo --version 0.17.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LangChain.Databases.Mongo, 0.17.1"
 
 
#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.Mongo@0.17.1
 
 
#: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.Mongo&version=0.17.1
 
Install as a Cake Addin
#tool nuget:?package=LangChain.Databases.Mongo&version=0.17.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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();

3. Upsert and search

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 for detailed before/after examples.

License

This project is licensed under the .

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 netstandard2.1 is compatible. 
.NET Framework net472 net472 is compatible.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos 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.17.1 106 4/30/2026
0.17.1-dev.46 65 4/1/2026
0.17.1-dev.44 70 3/29/2026
0.17.1-dev.42 55 3/21/2026
0.17.1-dev.41 57 3/21/2026
0.17.1-dev.40 58 3/21/2026
0.17.1-dev.39 59 3/21/2026
0.17.1-dev.37 55 3/20/2026
0.17.1-dev.36 53 3/20/2026
0.17.1-dev.35 62 3/20/2026
0.17.1-dev.32 57 3/20/2026
0.17.1-dev.31 54 3/20/2026
0.17.1-dev.30 61 3/20/2026
0.17.1-dev.28 65 3/20/2026
0.17.1-dev.27 60 3/20/2026
0.17.1-dev.11 201 4/21/2025
0.17.1-dev.10 195 4/9/2025
0.17.1-dev.9 177 3/31/2025
0.17.1-dev.8 165 3/28/2025
0.17.1-dev.5 131 2/20/2025
Loading failed