diff --git a/docker/mem0/main.py b/docker/mem0/main.py index 56e3ec1..acc71d8 100644 --- a/docker/mem0/main.py +++ b/docker/mem0/main.py @@ -230,7 +230,11 @@ def add_memories(req: AddRequest): def search_memories(req: SearchRequest): """Search memories by semantic similarity + BM25 + entity boost.""" mem = _get_memory() - params: dict[str, Any] = {"limit": req.limit} + # mem0 SDK renamed Memory.search()'s 'limit' param to 'top_k' in e6d6276b + # (2026-04-15, #4843). Passing 'limit=' here falls into **kwargs and is + # silently ignored, so top_k always defaults to 20 — making the benchmark's + # top_50/top_200 cutoffs ineffective. Pass 'top_k=' instead. + params: dict[str, Any] = {"top_k": req.limit} if req.user_id: params["user_id"] = req.user_id if req.agent_id: