Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

feat: Mark certain internal tools as safe to execute concurrently [LET-5614] (#5553)

Matthew Zhoude7011e4dee7
diff --git a/letta/constants.py b/letta/constants.py
index 8189ad649..60220d178 100644
--- a/letta/constants.py
+++ b/letta/constants.py
@@ -155,6 +155,16 @@ LETTA_TOOL_SET = set(
+ FILES_TOOLS
)
+LETTA_PARALLEL_SAFE_TOOLS = {
+ "conversation_search",
+ "archival_memory_search",
+ "run_code",
+ "web_search",
+ "fetch_webpage",
+ "grep_files",
+ "semantic_search_files",
+}
+
def FUNCTION_RETURN_VALUE_TRUNCATED(return_str, return_char: int, return_char_limit: int):
return (
diff --git a/letta/services/tool_manager.py b/letta/services/tool_manager.py
index b465980aa..7bf175142 100644
--- a/letta/services/tool_manager.py
+++ b/letta/services/tool_manager.py
@@ -13,6 +13,7 @@ from letta.constants import (
BASE_VOICE_SLEEPTIME_TOOLS,
BUILTIN_TOOLS,
FILES_TOOLS,
+ LETTA_PARALLEL_SAFE_TOOLS,
LETTA_TOOL_MODULE_NAMES,
LETTA_TOOL_SET,
LOCAL_ONLY_MULTI_AGENT_TOOLS,
@@ -662,12 +663,14 @@ class ToolManager:
continue
# create pydantic tool for validation and conversion
+ parallel_safe = name in LETTA_PARALLEL_SAFE_TOOLS
pydantic_tool = PydanticTool(
name=name,
tags=[tool_type.value],
source_type="python",
tool_type=tool_type,
return_char_limit=BASE_FUNCTION_RETURN_CHAR_LIMIT,
+ enable_parallel_execution=parallel_safe,
)
# auto-generate description if not provided