agentscope-ai / agentscope-ai/QwenPaw
[Feature]: Preserve agent persona and conversation style during Native context compaction
- Lingua principale
- TypeScript
- Stelle
- 35k
- Fork
- 3.1k
- Merge medio
- 1g 13h
- PR unite (30g)
- 228
Descrizione
## 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).
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start by locating the Native context strategy and the prompt or preservation logic that produces the five-section summary. Compare the first and repeated compaction behavior for persona, relationship, emotional, and communication context. Done means the existing structure remains intact while relevant conversational continuity survives repeated compactions, with focused tests covering the behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- ai, backend
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Attiva
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 45/100