枚举类 LongTermMemoryMode
- 所有已实现的接口:
Serializable,Comparable<LongTermMemoryMode>,Constable
Defines how long-term memory is integrated with agent behavior.
This enum controls whether memory management is handled automatically by the framework, actively by the agent through tool calls, or both. The mode affects:
- When memory recording and retrieval occur
- Whether memory management tools are registered in the agent's toolkit
- How much control the agent has over its own memory
Choosing the Right Mode:
- AGENT_CONTROL: Use when you want the agent to have full autonomy over memory decisions. Good for advanced agents that understand when information is important.
- STATIC_CONTROL: Use when you want automatic, framework-managed memory without agent involvement. Good for simpler agents or when memory should be comprehensive.
- BOTH: Recommended default. Combines automatic background memory with agent control, providing the best of both approaches.
Usage Example:
ReActAgent agent = ReActAgent.builder()
.name("Assistant")
.model(model)
.longTermMemory(memory)
.longTermMemoryMode(LongTermMemoryMode.BOTH) // Recommended
.build();
- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
枚举常量概要
枚举常量枚举常量说明Agent actively controls memory through tool calls.Combines both agent control and automatic framework management.Framework automatically manages memory without agent involvement. -
方法概要
修饰符和类型方法说明static LongTermMemoryMode返回带有指定名称的该类的枚举常量。static LongTermMemoryMode[]values()返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同
-
枚举常量详细资料
-
AGENT_CONTROL
Agent actively controls memory through tool calls. -
STATIC_CONTROL
Framework automatically manages memory without agent involvement. -
BOTH
Combines both agent control and automatic framework management.
-
-
方法详细资料
-
values
返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同- 返回:
- 包含该枚举类的常量的数组,顺序与声明这些常量的顺序相同
-
valueOf
返回带有指定名称的该类的枚举常量。 字符串必须与用于声明该类的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- 如果该枚举类没有带有指定名称的常量NullPointerException- 如果参数为空值
-