diff --git a/src/crewai/memory/contextual/contextual_memory.py b/src/crewai/memory/contextual/contextual_memory.py index cdb9cf836..1f86281fc 100644 --- a/src/crewai/memory/contextual/contextual_memory.py +++ b/src/crewai/memory/contextual/contextual_memory.py @@ -58,7 +58,7 @@ class ContextualMemory: Fetches historical data or insights from LTM that are relevant to the task's description and expected_output, formatted as bullet points. """ - ltm_results = self.ltm.search(task, latest_n=2) + ltm_results = self.ltm.search(query=task, limit=2) if not ltm_results: return None diff --git a/tests/memory/test_custom_storage.py b/tests/memory/test_custom_storage.py index dd632381d..2f80ecd4c 100644 --- a/tests/memory/test_custom_storage.py +++ b/tests/memory/test_custom_storage.py @@ -1,12 +1,13 @@ -import pytest from typing import Any, Dict, List -from crewai.crew import Crew +import pytest + from crewai.agent import Agent -from crewai.memory.storage.interface import Storage -from crewai.memory.short_term.short_term_memory import ShortTermMemory -from crewai.memory.long_term.long_term_memory import LongTermMemory +from crewai.crew import Crew from crewai.memory.entity.entity_memory import EntityMemory +from crewai.memory.long_term.long_term_memory import LongTermMemory +from crewai.memory.short_term.short_term_memory import ShortTermMemory +from crewai.memory.storage.interface import Storage from crewai.memory.user.user_memory import UserMemory