{"record":{"id":"6fa9edf8965c7b45","repo":"OpenBMB/ChatDev","slug":"mem0ai-is-required-for-mem0memory-install-it-with","errorCode":null,"errorMessage":"mem0ai is required for Mem0Memory. Install it with: pip install mem0ai","messagePattern":"mem0ai is required for Mem0Memory\\. Install it with: pip install mem0ai","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"runtime/node/agent/memory/mem0_memory.py","lineNumber":26,"sourceCode":"\nfrom entity.configs import MemoryStoreConfig\nfrom entity.configs.node.memory import Mem0MemoryConfig\nfrom runtime.node.agent.memory.memory_base import (\n    MemoryBase,\n    MemoryContentSnapshot,\n    MemoryItem,\n    MemoryWritePayload,\n)\n\nlogger = logging.getLogger(__name__)\n\n\ndef _get_mem0_client(config: Mem0MemoryConfig):\n    \"\"\"Lazy-import mem0ai and create a MemoryClient.\"\"\"\n    try:\n        from mem0 import MemoryClient\n    except ImportError:\n        raise ImportError(\n            \"mem0ai is required for Mem0Memory. Install it with: pip install mem0ai\"\n        )\n\n    client_kwargs: Dict[str, Any] = {}\n    if config.api_key:\n        client_kwargs[\"api_key\"] = config.api_key\n    if config.org_id:\n        client_kwargs[\"org_id\"] = config.org_id\n    if config.project_id:\n        client_kwargs[\"project_id\"] = config.project_id\n\n    return MemoryClient(**client_kwargs)\n\n\nclass Mem0Memory(MemoryBase):\n    \"\"\"Memory store backed by Mem0's managed cloud service.\n\n    Mem0 handles embeddings, storage, and semantic search server-side.","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/runtime/node/agent/memory/mem0_memory.py#L8-L44","documentation":"Mem0Memory needs the third-party mem0ai package. _get_mem0_client lazily imports mem0.MemoryClient; if mem0ai is not installed the ImportError is re-raised with install instructions.","triggerScenarios":"Using the Mem0 memory backend (store type 'mem0') in an environment where `pip install mem0ai` was never run; Mem0Memory.__init__ calls _get_mem0_client immediately, so the error surfaces at agent construction.","commonSituations":"Missing extras (e.g. pip install 'package[mem0]'); deploying to a slim container without optional deps; wrong venv activated.","solutions":["pip install mem0ai","Install the package's mem0 extras if provided","Verify the deployment image includes optional memory dependencies"],"exampleFix":"# shell\npip install mem0ai","handlingStrategy":"validation","validationCode":"import importlib.util\nif importlib.util.find_spec('mem0') is None:\n    raise ConfigError('mem0ai not installed; run pip install mem0ai')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Include optional memory extras in deployment images","Check optional deps at startup"],"tags":["memory","mem0","dependency","import-error"],"backgroundTag":"missing-python-dependency","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}