Skip to content

[FEATURE] Expose ConversationManager's reduce_context() as Hook Event #2048

@VincentBai-dotcom

Description

@VincentBai-dotcom

Problem Statement

I'm building observability plugin to Strands agent. The end goal is to have a dashboard listing what has the agent done during an invocation. So far I'm able to expose the tool calls, model outputs, and more, but I can't natively collect the event when the ConversationManager decides to reduce context.

Proposed Solution

Expose BeforeReduceContext and AfterReduceContext as Hook Event that allows developers to pass in custom callbacks that get executed during these two events, along with the existing Hook Event described here: https://strandsagents.com/docs/user-guide/concepts/agents/hooks/.

This can possibly solve another existing feature request too: #1679

Use Case

Need this feature such that developers can detect conversation context compaction event and collect it in their observability layer.

Alternatives Solutions

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions