Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions python/packages/azure-cosmos-memory/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Azure Cosmos DB Memory Package (agent-framework-azure-cosmos-memory)

Long-term semantic memory for agents, backed by Azure Cosmos DB via the
[Azure Cosmos DB Agent Memory Toolkit](https://github.com/AzureCosmosDB/AgentMemoryToolkit).

## Main Classes

- **`CosmosMemoryContextProvider`** - Context provider that integrates Cosmos DB-backed
semantic memory (facts, procedural/episodic memories, and user/thread summaries) into agents.

## Usage

```python
from azure.identity.aio import DefaultAzureCredential
from agent_framework_azure_cosmos_memory import CosmosMemoryContextProvider

provider = CosmosMemoryContextProvider(
cosmos_endpoint="https://<account>.documents.azure.com:443/",
cosmos_database="ai_memory",
ai_foundry_endpoint="https://<project>.services.ai.azure.com",
credential=DefaultAzureCredential(),
)
```

## Import Path

```python
from agent_framework_azure_cosmos_memory import CosmosMemoryContextProvider
```

## Notes

- Requires the `azure-cosmos-agent-memory` toolkit and an AI Foundry endpoint (used for both
embeddings and fact extraction).
- Set a stable `user_id` in `state["user_id"]` or `session.state["user_id"]` for long-term,
cross-session memory. Without it, memory scopes to the ephemeral session id and the provider
logs a one-time warning.
- Background fact extraction runs out-of-band after each turn. Call `provider.flush()` before
shutdown so in-flight extraction completes before the client closes.
- See `README.md` for full configuration, authentication, and processor-tuning options.
21 changes: 21 additions & 0 deletions python/packages/azure-cosmos-memory/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
Loading
Loading