{"id":14412,"library":"agent-framework-mem0","title":"Mem0 Integration for Microsoft Agent Framework","description":"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.","status":"active","version":"1.0.0b260409","language":"en","source_language":"en","source_url":"https://github.com/microsoft/agent-framework-mem0","tags":["agent-framework","mem0","ai","memory","agents","microsoft"],"install":[{"cmd":"pip install agent-framework-mem0","lang":"bash","label":"Install latest beta"}],"dependencies":[{"reason":"Core memory functionality provided by Mem0.","package":"mem0","optional":false},{"reason":"Underlying agent framework for integration.","package":"microsoft-agent-framework","optional":false}],"imports":[{"symbol":"Mem0Memory","correct":"from agent_framework_mem0.memories import Mem0Memory"}],"quickstart":{"code":"import asyncio\nimport os\nfrom agent_framework_mem0.memories import Mem0Memory\n\nasync def main():\n    mem0_api_key = os.environ.get(\"MEM0_API_KEY\", \"\")\n    if not mem0_api_key:\n        print(\"Please set the MEM0_API_KEY environment variable. You can get one from mem0.ai\")\n        return\n\n    memory = Mem0Memory(mem0_api_key=mem0_api_key)\n\n    # Example usage: Add and retrieve memory\n    await memory.add(user_id=\"test_user\", text=\"I like pizza.\")\n    print(\"Added memory: 'I like pizza.'\")\n\n    retrieved_memory = await memory.get(user_id=\"test_user\", query=\"What do I like?\")\n    print(f\"Retrieved memory for 'What do I like?': {retrieved_memory}\")\n\n    await memory.add(user_id=\"test_user\", text=\"My favorite color is blue.\")\n    print(\"Added memory: 'My favorite color is blue.'\")\n\n    retrieved_memory_2 = await memory.get(user_id=\"test_user\", query=\"What is my favorite color?\")\n    print(f\"Retrieved memory for 'What is my favorite color?': {retrieved_memory_2}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n","lang":"python","description":"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."},"warnings":[{"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.","message":"As 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.","severity":"breaking","affected_versions":"All 1.x.x beta versions"},{"fix":"Ensure `os.environ['MEM0_API_KEY']` is set before running your application, or pass `mem0_api_key='YOUR_KEY'` to the `Mem0Memory` constructor.","message":"Authentication 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.0.0':64 'activ':72 'agent':5,9,24,28,32,53,87,92 'agent-framework':86 'agent-framework-mem0':8 'ai':23,90 'b260409':65 'beta':70,84 'built':33 'cadenc':81 'capabl':51 'context':54 'current':62 'decis':57 'decision-mak':56 'develop':73 'enabl':31 'enhanc':52 'evolut':78 'framework':6,10,21,29,37,88 'frequent':83 'indic':71 'integr':2,16 'involv':82 'leverag':39 'librari':12,67 'long':44 'long-term':43 'make':58 'mem0':1,11,18,40,89 'memori':20,50,91 'microsoft':4,27,35,93 'potenti':75 'provid':13 'rapid':77 'releas':80 'robust':15 'short':48 'short-term':47 'state':42 'term':45,49 'updat':85 'version':63","created_at":"2026-04-20T18:41:39.544731+00:00","updated_at":"2026-04-20T18:41:39.544731+00:00","problems":[],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.0.0b260609","cli_name":"","cli_version":null,"type":"library","homepage":"https://mem0.ai","github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["llm-agents","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-14","install_tag":null}}