Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
fix: allow conversation_search time only queries [LET-7094] (#8939)
Ari Webb7a104a74fe59
diff --git a/letta/functions/function_sets/base.py b/letta/functions/function_sets/base.pyindex 02db2c208..8b907889f 100644--- a/letta/functions/function_sets/base.py+++ b/letta/functions/function_sets/base.py@@ -85,7 +85,7 @@ def send_message(self: "Agent", message: str) -> Optional[str]:def conversation_search(self: "Agent",- query: str,+ query: Optional[str] = None,roles: Optional[List[Literal["assistant", "user", "tool"]]] = None,limit: Optional[int] = None,start_date: Optional[str] = None,@@ -95,7 +95,7 @@ def conversation_search(Search prior conversation history using hybrid search (text + semantic similarity).Args:- query (str): String to search for using both text matching and semantic similarity.+ query (Optional[str]): String to search for using both text matching and semantic similarity. If not provided, returns messages based on other filters (time range, roles).roles (Optional[List[Literal["assistant", "user", "tool"]]]): Optional list of message roles to filter by.limit (Optional[int]): Maximum number of results to return. Uses system default if not specified.start_date (Optional[str]): Filter results to messages created on or after this date (INCLUSIVE). When using date-only format (e.g., "2024-01-15"), includes messages starting from 00:00:00 of that day. ISO 8601 format: "YYYY-MM-DD" or "YYYY-MM-DDTHH:MM". Examples: "2024-01-15" (from start of Jan 15), "2024-01-15T14:30" (from 2:30 PM on Jan 15).@@ -123,6 +123,10 @@ def conversation_search(# Search with limitconversation_search(query="debugging", limit=10)+ # Time-range only search (no query)+ conversation_search(start_date="2024-01-15", end_date="2024-01-20")+ # Returns all messages from Jan 15 through Jan 20+Returns:str: Query result string containing matching messages with timestamps and content."""diff --git a/letta/services/tool_executor/core_tool_executor.py b/letta/services/tool_executor/core_tool_executor.pyindex a8d0edfce..24fea8d12 100644--- a/letta/services/tool_executor/core_tool_executor.py+++ b/letta/services/tool_executor/core_tool_executor.py@@ -83,7 +83,7 @@ class LettaCoreToolExecutor(ToolExecutor):self,agent_state: AgentState,actor: User,- query: str,+ query: Optional[str] = None,roles: Optional[List[Literal["assistant", "user", "tool"]]] = None,limit: Optional[int] = None,start_date: Optional[str] = None,