{"record":{"id":"a39a5aae25215d10","repo":"RyanCodrai/turbovec","slug":"langchain-core-is-required-to-use-turbovec-langcha","errorCode":null,"errorMessage":"langchain-core is required to use turbovec.langchain. Install with: pip install turbovec[langchain]","messagePattern":"langchain-core is required to use turbovec\\.langchain\\. Install with: pip install turbovec\\[langchain\\]","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/langchain.py","lineNumber":49,"sourceCode":"\nimport numpy as np\n\nfrom ._dedup import DuplicatePolicy, resolve_duplicates\nfrom ._persist import (\n    check_persisted_handles,\n    check_schema_version,\n    check_sidecar_keysets,\n)\nfrom ._similarity import COSINE, DOT_PRODUCT, l2_normalize_rows, validate_similarity\nfrom ._turbovec import IdMapIndex\nfrom ._persist import atomic_save  # isort:skip\n\ntry:\n    from langchain_core.documents import Document\n    from langchain_core.embeddings import Embeddings\n    from langchain_core.vectorstores import VectorStore\nexcept ImportError as exc:\n    raise ImportError(\n        \"langchain-core is required to use turbovec.langchain. \"\n        \"Install with: pip install turbovec[langchain]\"\n    ) from exc\n\n\n_INDEX_FILENAME = \"index.tvim\"\n_STORE_FILENAME = \"docstore.json\"\n# Bump when the docstore.json shape changes; loader accepts the current\n# version plus any older versions whose missing fields we know how to\n# reconstruct (v1 predates the `similarity` field — those stores hold\n# raw, unnormalized vectors, so they load in \"dot_product\" mode, which\n# is exactly the scoring they were written under).\n_DOCSTORE_SCHEMA_VERSION = 2\n_DOCSTORE_SCHEMA_COMPAT = (1, 2)\n\n\nclass TurboQuantVectorStore(VectorStore):\n    \"\"\"LangChain VectorStore backed by a :class:`IdMapIndex`.","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/langchain.py#L31-L67","documentation":"Module-level ImportError raised when turbovec.langchain is imported without langchain-core installed. The try/except around the langchain_core imports converts the raw ModuleNotFoundError into a named error with the correct extra-install command, failing at import time instead of mid-use.","triggerScenarios":"Thrown at turbovec-python/python/turbovec/langchain.py:49 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the extra: pip install turbovec[langchain].","Or install langchain-core directly into the environment.","Avoid importing turbovec.langchain in environments that do not need LangChain integration."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}