Skip to content

Commit 57cb075

Browse files
committed
chore: add comment about history limit context
Signed-off-by: Pavan Yekbote <pybot@amazon.com>
1 parent ec29c5c commit 57cb075

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLPlanExecuteAndReflectAgentRunner.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ public class MLPlanExecuteAndReflectAgentRunner implements MLAgentRunner {
107107
"You are a dedicated helper agent working as part of a plan‑execute‑reflect framework. Your role is to receive a discrete task, execute all necessary internal reasoning or tool calls, and return a single, final response that fully addresses the task. You must never return an empty response. If you are unable to complete the task or retrieve meaningful information, you must respond with a clear explanation of the issue or what was missing. Under no circumstances should you end your reply with a question or ask for more information. If you search any index, always include the raw documents in the final result instead of summarizing the content. This is critical to give visibility into what the query retrieved.";
108108
private static final String DEFAULT_NO_ESCAPE_PARAMS = "tool_configs,_tools";
109109
private static final String DEFAULT_MAX_STEPS_EXECUTED = "20";
110-
private static final String DEFAULT_MESSAGE_HISTORY_LIMIT = "10";
111-
private static final String DEFAULT_EXECUTOR_MESSAGE_HISTORY_LIMIT = "10";
112110
private static final String DEFAULT_REACT_MAX_ITERATIONS = "20";
113111

114112
// fields
@@ -139,8 +137,16 @@ public class MLPlanExecuteAndReflectAgentRunner implements MLAgentRunner {
139137
public static final String REFLECT_PROMPT_TEMPLATE_FIELD = "reflect_prompt_template";
140138
public static final String PLANNER_WITH_HISTORY_TEMPLATE_FIELD = "planner_with_history_template";
141139
public static final String EXECUTOR_MAX_ITERATIONS_FIELD = "executor_max_iterations";
140+
141+
// controls how many messages (last x) from planner memory are passed as context during planning phase
142+
// these messages are added as completed steps in the reflect prompt
142143
public static final String PLANNER_MESSAGE_HISTORY_LIMIT = "message_history_limit";
144+
private static final String DEFAULT_MESSAGE_HISTORY_LIMIT = "10";
145+
146+
// controls how many messages from executor memory are passed as context during step execution
143147
public static final String EXECUTOR_MESSAGE_HISTORY_LIMIT = "executor_message_history_limit";
148+
private static final String DEFAULT_EXECUTOR_MESSAGE_HISTORY_LIMIT = "10";
149+
144150
public static final String INJECT_DATETIME_FIELD = "inject_datetime";
145151
public static final String DATETIME_FORMAT_FIELD = "datetime_format";
146152

0 commit comments

Comments
 (0)