mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
26cd5cc1bf
* Bump Python version to 1.0.0rc5 and 1.0.0b260319 for a release. * update missed pkg versions * Update changelog
26cd5cc1bf
ยท
2026-03-20 10:35:47 +09:00
History
Get Started with Microsoft Agent Framework Azure Cosmos DB
Please install this package via pip:
pip install agent-framework-azure-cosmos --pre
Azure Cosmos DB History Provider
The Azure Cosmos DB integration provides CosmosHistoryProvider for persistent conversation history storage.
Basic Usage Example
from azure.identity.aio import DefaultAzureCredential
from agent_framework_azure_cosmos import CosmosHistoryProvider
provider = CosmosHistoryProvider(
endpoint="https://<account>.documents.azure.com:443/",
credential=DefaultAzureCredential(),
database_name="agent-framework",
container_name="chat-history",
)
Credentials follow the same pattern used by other Azure connectors in the repository:
- Pass a credential object (for example
DefaultAzureCredential) - Or pass a key string directly
- Or set
AZURE_COSMOS_KEYin the environment
Container naming behavior:
- Container name is configured on the provider (
container_nameorAZURE_COSMOS_CONTAINER_NAME) session_idis used as the Cosmos partition key for reads/writes
See samples/cosmos_history_provider.py for a runnable package-local example.