Enum Class 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 LongTermMemoryModeReturns the enum constant of this class with the specified name.static LongTermMemoryMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
枚举常量详细资料
-
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
Returns an array containing the constants of this enum class, in the order they are declared.- 返回:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- 参数:
name- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- 如果参数为空值
-