agentscope-ai / agentscope-ai/QwenPaw

[Feature]: Feature: Support per-agent auto-memory profiles

オープン
#6,263 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
34.9k
フォーク
3.1k
平均マージ
1日 15時間
マージ済み PR(30日)
225

説明

## Summary

QwenPaw/ReMe currently uses a shared `auto_memory.yaml` for all agents, even though different agents may need different memory formats. Please add a per-agent auto-memory profile so companion agents can use chronological daily diaries while technical agents can use topic-oriented memory notes.

## 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

The current auto-memory prompt and writing strategy are shared globally through the ReMe `auto_memory.yaml` pipeline. This works poorly when one QwenPaw installation contains agents with different roles.

For example:

- A companion agent benefits from one chronological daily diary such as `memory/YYYY-MM-DD.md`, because relationship events, daily life, emotions, images, and recurring habits are best preserved as a continuous narrative.
- A QA or technical agent benefits from topic-oriented notes such as `memory/YYYY-MM-DD/.md`, because debugging sessions, root causes, configuration changes, patches, and reusable procedures are easier to maintain and review separately.

At present, changing the global auto-memory prompt affects every agent. Choosing a diary-oriented format for a companion agent can therefore make technical agents lose useful topic boundaries; choosing topic-oriented notes for technical agents can make companion agents produce fragmented, archive-like memories.

The existing per-agent persona files (`SOUL.md`, `PROFILE.md`, and `AGENTS.md`) already provide agent-specific identity and behavior, but they do not currently provide an equivalent per-agent choice for memory format and writing strategy.

## Proposed Solution

Add a per-agent auto-memory profile, configured in the agent-level configuration, for example:

```json
{
"auto_memory_profile": "diary"
}
```

Possible built-in profiles could include:

- `diary`: write and merge one chronological `memory/YYYY-MM-DD.md` file.
- `topic_archive`: write topic-oriented notes under `memory/YYYY-MM-DD/`.

The selected profile should control the auto-memory prompt and the related writing workflow, while the existing agent-specific persona injection should remain unchanged. The auto-memory step should continue to use the current agent's concrete workspace files:

- `SOUL.md`
- `PROFILE.md`
- `AGENTS.md`

For backward compatibility, the default profile should preserve the current behavior for existing installations. The profile should ideally be optional, so users who do not configure it experience no change.

A first implementation could use built-in prompt profiles rather than allowing arbitrary user-supplied YAML paths. This would keep configuration simpler and reduce path-validation and security concerns. The configuration could be exposed at the QwenPaw agent level while the actual profile implementation remains in the ReMe auto-memory layer.

The feature should also include tests covering at least:

1. Different agents selecting different profiles in the same installation.
2. Existing configurations without a profile retaining backward-compatible behavior.
3. Diary mode merging into one daily file.
4. Topic-archive mode creating or updating topic notes.
5. Persona files remaining agent-specific in both modes.

## Alternatives Considered

1. **Keep one global prompt for all agents.**
This is the current behavior, but it cannot represent the different needs of companion and technical agents.

2. **Maintain separate patched installations.**
This can isolate prompts, but is difficult to maintain, is fragile across upgrades, and is not a practical solution for users running multiple agents in one QwenPaw installation.

3. **Allow each agent to specify an arbitrary YAML file path.**
This would provide maximum flexibility, but would introduce more configuration complexity and potential path-validation or security issues than a small set of built-in profiles.

4. **Rely only on vector/BM25 retrieval to compensate.**
Better retrieval helps find information, but it does not solve the different writing and file-organization requirements of companion and technical agents.

## Additional Context

The motivation came from comparing two memory styles:

- A topic-oriented note such as `memory/2026-07-19/qa-agent-memory-system-config.md` is convenient for technical issue tracking.
- A single diary such as `memory/2026-07-19.md` is more natural for a companion agent that shares daily life with the user.

The requested feature is not intended to remove the existing memory backend, vector search, BM25 search, history storage, or context compaction. It only provides per-agent control over the auto-memory writing profile and output organization.

This would allow one installation to support both of these legitimate use cases without requiring users to modify package-level files such as `reme/steps/evolve/auto_memory.yaml` or maintain local patches.

## Willing to Contribute

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。