agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

AutoContextMemory 新的版本 这个废弃了吗?

Open 707348125 opened this issue 2 months ago • 1 comments

AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.

废弃AutoContextMemory了吗 那短期记忆只能使用InMemoryMemory ?????

707348125 avatar Sep 29 '26 08:09 707348125

Issue Evaluation

Category: question | Status: Answered

AutoContextMemory is not deprecated — it was removed. The whole agentscope-extensions-autocontext-memory module was deleted in commit 245080c0c ("Refactor memory handling: remove legacy memory references and introduce new context management"), which is already an ancestor of v2.0.0-RC3 / v2.0.0 / v2.0.1 / v2.0.2. There is no @Deprecated shim left and zero autocontext hits in Java, POMs or docs on the current revision (2.0.4-SNAPSHOT). v1.0.9 still ships the module.

And no — InMemoryMemory is not the replacement. The entire 1.0.x Memory family is @Deprecated(forRemoval = true, since = "2.0.0"), kept only as a write-only source-compat mirror:

  • agentscope-core/src/main/java/io/agentscope/core/memory/Memory.java:34
  • .../memory/InMemoryMemory.java:36, .../memory/StateBackedMemory.java:35, .../memory/AgentStateMemoryView.java:42
  • .../memory/LongTermMemory.java:70, .../memory/LongTermMemoryMode.java:53

Use instead:

Need Current API
Conversation / short-term history AgentState.getContext() (.../core/state/AgentState.java:171). A plain ReActAgent owns its history on AgentState — there is no memory object to wire.
Persistence any AgentStateStore, partitioned by (userId, sessionId): InMemoryAgentStateStore (tests/dev), JsonFileAgentStateStore (local durability), or Jdbc / Mysql / Postgres / Mongo / Redis / OSS / JPA in agentscope-extensions.
What AutoContextMemory actually did (context compression / offloading) HarnessAgent + compaction stack.

Compression example (CompactionConfig and ToolResultEvictionConfig are off by default):

HarnessAgent.builder()
    .compaction(CompactionConfig.builder()
        .triggerMessages(30)
        .keepMessages(10)
        .build())
    .toolResultEviction(ToolResultEvictionConfig.defaults())
    .build();

Runnable reference: agentscope-examples/documentation/.../harness/memory/MemoryCompactionExample.java. Docs: docs/v2/en/docs/harness/compaction.md, docs/v2/en/docs/harness/memory.md, and the migration note docs/v2/en/docs/change-log.md:186 (B.3 Memory → AgentStateStore + AgentState).

There is no drop-in replacement class: AutoContextConfig's progressive strategies map onto the Harness-level CompactionConfig + ToolResultEvictionConfig.


Automated evaluation by github-manager-bot

oss-maintainer avatar Sep 29 '26 09:09 oss-maintainer