枚举类 LongTermMemoryMode

java.lang.Object
java.lang.Enum<LongTermMemoryMode>
io.agentscope.core.memory.LongTermMemoryMode
所有已实现的接口:
Serializable, Comparable<LongTermMemoryMode>, Constable

@Deprecated(forRemoval=true, since="2.0.0") public enum LongTermMemoryMode extends Enum<LongTermMemoryMode>
已过时, 待删除: 此 API 元素将从以后的版本中删除。
since 2.0.0. Long-term memory is removed.
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>>
  • 枚举常量概要

    枚举常量
    枚举常量
    说明
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    Agent actively controls memory through tool calls.
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    Combines both agent control and automatic framework management.
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    Framework automatically manages memory without agent involvement.
  • 方法概要

    修饰符和类型
    方法
    说明
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    返回带有指定名称的该类的枚举常量。
    已过时, 待删除: 此 API 元素将从以后的版本中删除。
    返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同

    从类继承的方法 java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 枚举常量详细资料

    • AGENT_CONTROL

      public static final LongTermMemoryMode AGENT_CONTROL
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Agent actively controls memory through tool calls.
    • STATIC_CONTROL

      public static final LongTermMemoryMode STATIC_CONTROL
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Framework automatically manages memory without agent involvement.
    • BOTH

      public static final LongTermMemoryMode BOTH
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      Combines both agent control and automatic framework management.
  • 方法详细资料

    • values

      public static LongTermMemoryMode[] values()
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      返回包含该枚举类的常量的数组, 顺序与声明这些常量的顺序相同
      返回:
      包含该枚举类的常量的数组,顺序与声明这些常量的顺序相同
    • valueOf

      public static LongTermMemoryMode valueOf(String name)
      已过时, 待删除: 此 API 元素将从以后的版本中删除。
      返回带有指定名称的该类的枚举常量。 字符串必须与用于声明该类的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - 如果该枚举类没有带有指定名称的常量
      NullPointerException - 如果参数为空值