Class ModelSummarizationStrategy

java.lang.Object
io.agentscope.spring.boot.admin.service.ModelSummarizationStrategy
All Implemented Interfaces:
SummarizationStrategy

public final class ModelSummarizationStrategy extends Object implements SummarizationStrategy
Default SummarizationStrategy that asks the agent's own model to produce a fresh rolling summary.

The strategy is intentionally conservative: it never includes the previous summary in the prompt verbatim (to avoid prompt explosion), only the existing summary plus the messages being folded. The model is instructed to keep names, dates, and any user-stated facts.

  • Constructor Details

    • ModelSummarizationStrategy

      public ModelSummarizationStrategy()
  • Method Details

    • summarize

      public reactor.core.publisher.Mono<String> summarize(io.agentscope.core.model.Model model, String existingSummary, List<io.agentscope.core.message.Msg> messagesToFold)
      Description copied from interface: SummarizationStrategy
      Produce a new rolling summary.
      Specified by:
      summarize in interface SummarizationStrategy
      Parameters:
      model - the model to use (must not be null)
      existingSummary - the prior summary, or empty string when none
      messagesToFold - the messages currently in the agent context — typically everything except the last keepLastMessages that the caller will retain verbatim
      Returns:
      the new summary text