agentscope-ai / agentscope-ai/QwenPaw

[Feature]: Preserve agent persona and conversation style during Native context compaction

Ouverte
#7,527 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
enhancement
Langage dominant
Python
Étoiles
34.9k
Forks
3.1k
Merge moyen
1 j 15 h
PR mergées (30 j)
225

Description

## Summary

Native context compaction preserves task information well, but repeated compaction can gradually weaken an agent's persona and conversational continuity. Please preserve important relationship context, forms of address, emotional state, and interaction style while keeping the current structured summary format.

## Component(s) Affected

- [x] Core / Backend (app, agents, config, providers, utils, local_models)
- [ ] Console (frontend web UI)
- [ ] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [ ] Documentation (website)
- [ ] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy

## Problem / Motivation

In QwenPaw `v2.2.0`, using the `Native` context strategy, compaction produces a structured summary with sections such as:

- `Task Overview`
- `Current State`
- `Important Discoveries`
- `Next Steps`
- `Context to Preserve`

This structure is useful for recovering tasks. However, after repeated compactions, persona-based or companionship conversations can become increasingly neutral and report-like. The agent may lose natural forms of address, relationship context, emotional continuity, and established interaction style, even though these details are important for continuing the conversation naturally.

This affects users who use QwenPaw for persona-based assistants, long-term companionship, role-based agents, or conversations that are not purely task-oriented.

## Proposed Solution

Please keep the existing Native structured summary format, but improve the compaction prompt and/or preservation logic so that it also retains meaningful conversational context:

- established relationships and natural forms of address;
- stable user preferences and communication style;
- relevant emotional state and interaction context;
- important wording or expressions from the original conversation;
- persona-related context needed to continue the conversation consistently;
- previously preserved persona and relationship context across repeated compactions.

The summary should not preserve every casual detail or become a full conversation transcript. It should avoid flattening companionship, emotional, casual, or role-based conversations into a generic work-task report.

The five existing sections can remain unchanged. The main request is to ensure that `Context to Preserve` carries forward the information needed for persona and conversational continuity.

## Alternatives Considered

- Replacing Native compaction with a fully free-form summary similar to earlier QwenPaw versions. This may preserve more natural language, but could reduce the stability and predictability of the current structured context-recovery format.
- Storing persona information only in `SOUL.md` or `PROFILE.md`. These files provide baseline instructions, but they do not preserve conversation-specific relationship changes, emotional state, or interaction history.
- Maintaining a separate long-term memory diary. This can help, but it does not replace the context summary needed immediately after compaction.

## Additional Context

Tested with:

- QwenPaw: `v2.2.0`
- Context strategy: `Native`
- Persona-based agent with established names, relationship context, and communication preferences

Example of the current summary format:

```text
Task Overview
Current State
Important Discoveries
Next Steps
Context to Preserve
```

After compaction, task-related information is retained, but the result is more report-like than the original conversation. Repeated compaction may therefore cause gradual persona drift.

The desired behavior is:

```text
Keep the current Native structure
+ preserve task continuity
+ preserve persona and relationship continuity
```

## Willing to Contribute

- [ ] I am willing to open a PR for this feature (after discussion).

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.