diff --git a/libs/checkpoint/langgraph/store/memory/__init__.py b/libs/checkpoint/langgraph/store/memory/__init__.py index 40011a7ba..eec511ac8 100644 --- a/libs/checkpoint/langgraph/store/memory/__init__.py +++ b/libs/checkpoint/langgraph/store/memory/__init__.py @@ -413,6 +413,8 @@ def _cosine_similarity(X: list[float], Y: list[list[float]]) -> list[float]: Compute cosine similarity between a vector X and a matrix Y. Lazy import numpy for efficiency. """ + if not Y: + return [] if _check_numpy(): import numpy as np # type: ignore diff --git a/libs/checkpoint/pyproject.toml b/libs/checkpoint/pyproject.toml index ef12f2052..f48f46a1f 100644 --- a/libs/checkpoint/pyproject.toml +++ b/libs/checkpoint/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langgraph-checkpoint" -version = "2.0.7" +version = "2.0.8" description = "Library with base interfaces for LangGraph checkpoint savers." authors = [] license = "MIT"