Registry / azure / agent-framework-azure-cosmos

agent-framework-azure-cosmos

JSON →
library1.0.0b260507pypypiunverified

Azure Cosmos DB history provider integration for Microsoft Agent Framework. This package stores and retrieves agent conversation history using Azure Cosmos DB. Current version is 1.0.0b260507, a beta release. Release cadence is irregular, tied to the Agent Framework development cycle.

pip install agent-framework-azure-cosmos
INSTALL
IMPORT
SIG · AGENT-FRAMEWORK-AZ
A
agent-framework-azure-cosmos
azurepythonv1.0.0b260507
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AzureCosmosDBHistoryAdapter
from agent_framework_azure_cosmos import AzureCosmosDBHistoryAdapter
from agent_framework.azure_cosmos import AzureCosmosDBHistoryAdapter
Legacy structure: this package is a separate distribution, not part of agent_framework namespace.

Initialize the Azure Cosmos DB history adapter using DefaultAzureCredential for authentication.

import os from azure.identity import DefaultAzureCredential from agent_framework_azure_cosmos import AzureCosmosDBHistoryAdapter # Use environment variables for credentials (better to use managed identity in production) credential = DefaultAzureCredential() account_url = os.environ.get("COSMOS_ACCOUNT_URL", "https://your-account.documents.azure.com:443/") database_name = os.environ.get("COSMOS_DATABASE", "agent_history") container_name = os.environ.get("COSMOS_CONTAINER", "conversations") adapter = AzureCosmosDBHistoryAdapter( account_url=account_url, credential=credential, database_name=database_name, container_name=container_name ) print("Adapter created successfully.") # Use adapter with Agent Framework's Agent class
Debug
Known issues
breakingMust use async context to call adapter methods (e.g., store / retrieve). Synchronous calls will raise RuntimeError.
fix
Wrap all adapter operations in `async def` and `await` calls. Use `asyncio.run()` or an event loop.
affects: >=1.0.0b1
deprecatedDefault Azure credential fallback to managed identity; previously users relied on connection strings. Connection string support is deprecated and may be removed.
fix
Switch to `DefaultAzureCredential()` with appropriate RBAC roles on Cosmos DB.
affects: >=1.0.0b260507
gotchaThe package name uses hyphens, but the Python module name uses underscores. Pip install with hyphens, import with underscores.
fix
`pip install agent-framework-azure-cosmos` -> `import agent_framework_azure_cosmos`
affects: all
gotchaCosmos DB account must have a container with id field partition key set to '/id' for the adapter to work correctly.
fix
Create container with partition key '/id' and ensure the container exists before running the adapter.
affects: all
Upgrade
Version history
1.0.0b260507latest on PyPI · released May 8, 2026
Audit
Dependencies
azure-cosmosrequiredCore SDK for Azure Cosmos DB operations
azure-identityrequiredRequired for authentication using DefaultAzureCredential
agent-frameworkrequiredPeer dependency: the base Agent Framework package
Agent activity
49 hits · last 30 days
node
38
Perplexity
1
OpenAI (training)
1
Resources
agent-framework-azure-cosmos — pip install agent-framework-azure-cosmos · libregistry