{"record":{"id":"0a7321958af2e198","repo":"langchain-ai/langgraph","slug":"embedding-configuration-is-required-for-vector-ope","errorCode":null,"errorMessage":"Embedding configuration is required for vector operations (for semantic search). Please provide an Embeddings when initializing the {store.__class__.__name__}.","messagePattern":"Embedding configuration is required for vector operations \\(for semantic search\\)\\. Please provide an Embeddings when initializing the (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/checkpoint-postgres/langgraph/store/postgres/base.py","lineNumber":1426,"sourceCode":"        return tuple(namespace)\n    if isinstance(namespace, bytes):\n        namespace = namespace.decode()[1:]\n    return tuple(namespace.split(\".\"))\n\n\ndef get_distance_operator(store: Any) -> tuple[str, str]:\n    \"\"\"Get the distance operator and score expression based on config.\"\"\"\n    # Note: Today, we are not using ANN indices due to restrictions\n    # on PGVector's support for mixing vector and non-vector filters\n    # To use the index, PGVector expects:\n    #  - ORDER BY the operator NOT an expression (even negation blocks it)\n    #  - ASCENDING order\n    #  - Any WHERE clause should be over a partial index.\n    # If we violate any of these, it will use a sequential scan\n    # See https://github.com/pgvector/pgvector/issues/216 and the\n    # pgvector documentation for more details.\n    if not store.index_config:\n        raise ValueError(\n            \"Embedding configuration is required for vector operations \"\n            f\"(for semantic search). \"\n            f\"Please provide an Embeddings when initializing the {store.__class__.__name__}.\"\n        )\n\n    config = cast(PostgresIndexConfig, store.index_config)\n    distance_type = config.get(\"distance_type\", \"cosine\")\n\n    # Return the operator and the score expression\n    # The operator is used in the CTE and will be compatible with an ASCENDING ORDER\n    # sort clause.\n    # The score expression is used in the final query and will be compatible with\n    # a DESCENDING ORDER sort clause and the user's expectations of what the similarity score\n    # should be.\n    if distance_type == \"l2\":\n        # Final: \"-(sv.embedding <-> %s::%s)\"\n        # We return the \"l2 similarity\" so that the sorting order is the same\n        return \"sv.embedding <-> %s::%s\", \"-scored.neg_score\"","sourceCodeStart":1408,"sourceCodeEnd":1444,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/checkpoint-postgres/langgraph/store/postgres/base.py#L1408-L1444","documentation":"Error \"Embedding configuration is required for vector operations (for semantic search). Please provide an Embeddings when initializing the {store.__class__.__name__}.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/checkpoint-postgres/langgraph/store/postgres/base.py:1426 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}