From 88ad3a3ac4caab882ec68a4097d079e564fe01ff Mon Sep 17 00:00:00 2001 From: Joao Moura Date: Wed, 4 Mar 2026 09:06:54 -0800 Subject: [PATCH] refactor: simplify category handling in RecallFlow - Updated the _merged_categories method to return only caller-supplied categories, removing the previous merging logic for inferred categories. This change enhances clarity and maintains consistency in category management. --- lib/crewai/src/crewai/memory/recall_flow.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/crewai/src/crewai/memory/recall_flow.py b/lib/crewai/src/crewai/memory/recall_flow.py index 5e93a2703..e0f238861 100644 --- a/lib/crewai/src/crewai/memory/recall_flow.py +++ b/lib/crewai/src/crewai/memory/recall_flow.py @@ -2,7 +2,6 @@ Implements adaptive-depth retrieval with: - LLM query distillation into targeted sub-queries -- Keyword-driven category filtering - Time-based filtering from temporal hints - Parallel multi-query, multi-scope search - Confidence-based routing with iterative deepening (budget loop) @@ -81,11 +80,8 @@ class RecallFlow(Flow[RecallState]): # ------------------------------------------------------------------ def _merged_categories(self) -> list[str] | None: - """Merge caller-supplied and LLM-inferred categories.""" - merged = list( - set((self.state.categories or [])) - ) - return merged or None + """Return caller-supplied categories, or None if empty.""" + return self.state.categories or None def _do_search(self) -> list[dict[str, Any]]: """Run parallel search across (embeddings x scopes) with filters.