Microsoft.Agents.Storage.CosmosDb
v1.2.3-betaPre-release
net8.0.NETStandard2.0
CosmosDb IStorage for the Microsoft Agents SDK
Published
Jul 15, 2025
1y ago
Total Downloads
88.3K
88,330
Install
dotnet add package Microsoft.Agents.Storage.CosmosDb --version 1.2.3-beta
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard |
README
Microsoft.Agents.Storage.CosmosDb
About
- An Agent is inherently stateless. Once your Agent is deployed, it may not run in the same process or on the same machine from one turn to the next. However, your Agent may need to track the context of a conversation so that it can manage its behavior and remember answers to previous questions. The state and storage features of the Agents SDK allow you to add state to your Agent.
- Microsoft.Agents.State use Storage to persist state to memory, Azure Blobs, or CosmosDb.
Main Types
- CosmosDbPartitionedStorage
- CosmosDbPartitionedStorageOptions
Registering CosmosDbPartitionedStorage
appsettings.json
{
"CosmosDbPartitionedStorageOptions": {
"CosmosDbEndpoint": "{db_endpoint}",
"DatabaseId": "{db_id}",
"ContainerId": "{container_id}"
}
}
Program.cs
builder.Services.AddSingleton<IStorage>((sp) => new CosmosDbPartitionedStorage(
builder.Configuration.GetSection(nameof(CosmosDbPartitionedStorageOptions))
.Get<CosmosDbPartitionedStorageOptions>()));
CosmosDbPartitionedStorageOptions.AuthKey or CosmosDbPartitionedStorageOptions.TokenCredential should be defined.
Changes from Previous Version
No structural changes between v1.2.1-beta and v1.2.3-beta.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.