Skip to content

feat(agent): introduce agent-level context management #1419

@DavdGao

Description

@DavdGao

Background
In AgentScope 1.0, context management is delegated to the memory module, which is too detached from the agent's runtime state to support fine-grained, agent-aware optimization. As agents handle longer and more complex tasks, better context control is needed to maintain both performance and output quality.

TBD: Note in 2.0.0, the memory module maybe deprecated.

Changes
Introduce context management directly at the agent level, with the following optimization strategies:

  • Tool result truncation — trim oversized tool outputs to prevent context bloat
  • Stale message removal (Snip) — remove outdated messages that are no longer relevant
  • Redundant message compaction (Micro-compact) — collapse repetitive tool messages to reduce noise

Metadata

Metadata

Assignees

No one assigned

    Labels

    milestone: 2.0.0The AgentScope 2.0.0 milestone related issues and pull requests

    Type

    No type

    Projects

    Status

    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions