Registry / llm-agents / agent-framework-mem0

agent-framework-mem0

JSON →
library1.0.0b260409pypiunverified

The `agent-framework-mem0` library provides a robust integration for Mem0, a memory framework for AI agents, with the Microsoft Agent Framework. It enables agents built on Microsoft's framework to leverage Mem0's stateful, long-term, and short-term memory capabilities, enhancing agent context and decision-making. As of the current version `1.0.0b260409`, the library is in beta, indicating active development and potential for rapid evolution. Its release cadence involves frequent beta updates.

llm-agentsai-ml
pip install agent-framework-mem0
Install & Compatibility
Where this runs
tested against v1.0.0b260609 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 14.15s
py 3.11
✓ —
✓ 12.1s
py 3.12
✓ —
✓ 10.95s
py 3.13
✓ —
✓ 11.1s
py 3.9
✕ build_error
✕ build_error
189MB installed
● package 189MB
Code
Verified usage

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

Mem0Memory
from agent_framework_mem0.memories import Mem0Memory

This quickstart demonstrates how to initialize `Mem0Memory` and interact with it using asynchronous calls. It requires the `MEM0_API_KEY` environment variable for authentication with the Mem0 service. The example shows adding memories and then retrieving them based on a query for a specific user ID.

import asyncio import os from agent_framework_mem0.memories import Mem0Memory async def main(): mem0_api_key = os.environ.get("MEM0_API_KEY", "") if not mem0_api_key: print("Please set the MEM0_API_KEY environment variable. You can get one from mem0.ai") return memory = Mem0Memory(mem0_api_key=mem0_api_key) # Example usage: Add and retrieve memory await memory.add(user_id="test_user", text="I like pizza.") print("Added memory: 'I like pizza.'") retrieved_memory = await memory.get(user_id="test_user", query="What do I like?") print(f"Retrieved memory for 'What do I like?': {retrieved_memory}") await memory.add(user_id="test_user", text="My favorite color is blue.") print("Added memory: 'My favorite color is blue.'") retrieved_memory_2 = await memory.get(user_id="test_user", query="What is my favorite color?") print(f"Retrieved memory for 'What is my favorite color?': {retrieved_memory_2}") if __name__ == "__main__": asyncio.run(main())
Debug
Known issues
breakingAs a beta library, API interfaces, configuration options, and internal implementations are subject to frequent breaking changes without prior notice. Always check the latest GitHub README and changelog.
fix
Pin your dependency to specific patch versions during development and review breaking changes before updating. Consult the official GitHub repository for the latest documentation.
affects: All 1.x.x beta versions
gotchaAuthentication requires a `MEM0_API_KEY` which must be provided either directly during initialization or via the `MEM0_API_KEY` environment variable. Forgetting this will lead to authentication errors.
fix
Ensure `os.environ['MEM0_API_KEY']` is set before running your application, or pass `mem0_api_key='YOUR_KEY'` to the `Mem0Memory` constructor.
affects: All versions
gotchaThe library primarily exposes an asynchronous API. All interactions with `Mem0Memory` methods (e.g., `add`, `get`) must be `await`-ed within an `async` function and run using `asyncio.run()` or similar asynchronous event loop management.
fix
Always use `await` when calling `Mem0Memory` methods and ensure your application's entry point correctly uses `asyncio.run()` or integrates into an existing asynchronous framework.
affects: All versions
gotchaThe library typically pins specific versions of its core dependencies (`mem0` and `microsoft-agent-framework`). This can lead to dependency conflicts if other libraries in your project require different versions of these same packages.
fix
Use a dedicated virtual environment. If conflicts arise, consider using tools like `pipdeptree` or `poetry` to inspect and resolve dependency conflicts. Refer to the `pyproject.toml` or `setup.py` on GitHub for exact dependency requirements.
affects: All versions
Upgrade
Version history
1.0.0b260609latest on PyPI
Audit
Dependencies
mem0requiredCore memory functionality provided by Mem0.
microsoft-agent-frameworkrequiredUnderlying agent framework for integration.
Agent activity
109 hits · last 30 days
node
14
claudebot
4
ahrefsbot
3
Amazon
2
petalbot
1
amazonbot
1
Google (AI)
1
Resources