AS AgentScopeAPI 手册 / API Reference

LongTermMemoryMode

@Deprecated(forRemoval = true, since = "2.0.0") public enum LongTermMemoryMode
源码Source 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
staticfinal

执行智能体 CONTROL相关操作。

Agent actively controls memory through tool calls.

源码Source io/agentscope/core/memory/LongTermMemoryMode.java:59

STATIC_CONTROL

STATIC_CONTROL
staticfinal

执行STATIC CONTROL相关操作。

Framework automatically manages memory without agent involvement.

源码Source io/agentscope/core/memory/LongTermMemoryMode.java:64

BOTH

BOTH
staticfinal

执行 BOTH 方法。

Combines both agent control and automatic framework management.

源码Source io/agentscope/core/memory/LongTermMemoryMode.java:69
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.