LongTermMemoryMode
@Deprecated(forRemoval = true, since = "2.0.0") public enum LongTermMemoryMode
io/agentscope/core/memory/LongTermMemoryMode.java:53–70定义Long Term 记忆模式相关取值的枚举。位于 io.agentscope.core.memory 包。核心成员包括 AGENT_CONTROL、STATIC_CONTROL、BOTH。
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();
`
枚举常量摘要Enum Constant Summary
| 常量Constant | 说明Description |
|---|---|
AGENT_CONTROL | 执行智能体 CONTROL相关操作。 Agent actively controls memory through tool calls. |
STATIC_CONTROL | 执行STATIC CONTROL相关操作。 Framework automatically manages memory without agent involvement. |
BOTH | 执行 `BOTH` 方法。 Combines both agent control and automatic framework management. |
枚举常量详情Enum Constant Detail
AGENT_CONTROL
AGENT_CONTROL
执行智能体 CONTROL相关操作。
Agent actively controls memory through tool calls.
io/agentscope/core/memory/LongTermMemoryMode.java:59STATIC_CONTROL
STATIC_CONTROL
执行STATIC CONTROL相关操作。
Framework automatically manages memory without agent involvement.
io/agentscope/core/memory/LongTermMemoryMode.java:64BOTH
BOTH
执行 BOTH 方法。
Combines both agent control and automatic framework management.
io/agentscope/core/memory/LongTermMemoryMode.java:69