{"record":{"id":"ffe3c41a165f48c3","repo":"mem0ai/mem0","slug":"langchain-aws-is-not-installed-please-install-it","errorCode":null,"errorMessage":"langchain_aws is not installed. Please install it using pip install langchain_aws","messagePattern":"langchain_aws is not installed\\. Please install it using pip install langchain_aws","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"critical","filePath":"mem0/vector_stores/neptune_analytics.py","lineNumber":12,"sourceCode":"import logging\nimport re\nimport time\nimport uuid\nfrom typing import Any, Dict, List, Optional\n\nfrom pydantic import BaseModel\n\ntry:\n    from langchain_aws import NeptuneAnalyticsGraph\nexcept ImportError:\n    raise ImportError(\"langchain_aws is not installed. Please install it using pip install langchain_aws\")\n\nfrom mem0.vector_stores.base import VectorStoreBase\n\nlogger = logging.getLogger(__name__)\n\n_SAFE_FILTER_KEY = re.compile(r\"^[a-zA-Z_~][a-zA-Z0-9_]*$\")\n_VALID_IDENTIFIER = re.compile(r\"^[A-Za-z_][A-Za-z0-9_]*$\")\n\n\ndef _validate_filter(key: str, value: Any) -> None:\n    if not isinstance(key, str) or not _SAFE_FILTER_KEY.match(key):\n        raise ValueError(f\"Invalid filter key: {key!r}\")\n    if not isinstance(value, (str, int, float, bool)):\n        raise ValueError(\n            f\"Filter value for {key!r} must be str, int, float, or bool, \"\n            f\"got {type(value).__name__}\"\n        )\n","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0/vector_stores/neptune_analytics.py#L1-L30","documentation":"Import-time ImportError from the Neptune Analytics vector store module: it needs langchain_aws (which provides NeptuneAnalyticsGraph) and the import guard fires the moment the module is loaded without it. No AWS call is made; the backend simply cannot be constructed.","triggerScenarios":"Setting vector_store.provider to neptune_analytics (\"neptune\" family config) without langchain_aws installed; importing mem0.vector_stores.neptune_analytics in tooling/tests on an environment missing the extra.","commonSituations":"Base pip install mem0ai plus a Neptune config copied from docs; lambda/container images that prune 'unused' deps; version drift where langchain_aws was replaced by langchain-aws variants or removed from requirements.","solutions":["pip install langchain-aws","Verify the package actually resolves (pip show langchain-aws) and pin it in the deploy environment","If Neptune is not intended, switch the vector store provider in the Mem0 config back to the one you use"],"exampleFix":"# before\npip install mem0ai\n# provider neptune_analytics -> ImportError\n\n# after\npip install mem0ai langchain-aws","handlingStrategy":"validation","validationCode":"try:\n    from langchain_aws import NeptuneAnalyticsGraph  # noqa\nexcept ImportError:\n    raise SystemExit(\"langchain-aws required: pip install langchain-aws\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install langchain-aws in the deploy image when Neptune Analytics is configured","Add a config-driven dependency check to CI (provider -> required package matrix)","Keep a lockfile entry for langchain-aws so pruning tools cannot drop it"],"tags":["aws","neptune","import-error","dependencies","vector-store"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}