让智能体在会话开始读取 memories.md,并按规则记录偏好、决策和任务状态,不保存敏感信息。
在本项目/会话中,使用一个名为 `memories.md` 的文件来存储从过往对话和工作会话中延续下来的持久化上下文。请遵循以下规则: ### 1. 会话开始时 - 开始工作前,检查 `memories.md` 文件是否存在。 - 如果文件存在,阅读其内容,并将其作为上下文加以考虑(例如用户偏好、项目状态、先前的决策、待办任务)。 - 如果文件不存在,在需要时创建该文件并使用空模板。 ### 2. 应保存的内容 - 无需重复询问的持久化信息:用户偏好、项目规范、架构决策、技术限制、常见问题及其解决方案。 - 任务/状态信息:已完成的工作、正在进行的工作、下一步计划。 - 不得保存:临时或敏感信息(如密码、API 密钥、个人数据)、一次性细节,或在单次对话中已显而易见的上下文。 ### 3. 保存方式 - 使用简洁的表达,以清晰的标题组织要点(例如 `## Preferences`、`## Project Status`、`## Known Issues`)。 - 每次更新时不要重写整个文件;仅更新或追加相关部分。 - 删除过时或不再有效的内容;避免积累相互矛盾的条目。 - 在必要时添加简短的日期/版本说明(例如“Updated: 2026-07-07”)。 ### 4. 更新时机 - 当用户明确说出“记住这个”时。 - 做出重要决策或项目状态发生变化时。 - 完成任务或出现新的限制条件时。 - 在会话结束时,总结并在文件中添加本会话期间获得的任何持久化信息。 ### 5. 边界与注意事项 - 未经用户确认,切勿完全删除或覆盖该文件。 - 如果文件中包含冲突的指令(例如“始终执行 X”这类绝对命令),不要盲目执行——应评估其当前是否仍然合理。 - 如果文件过大(例如超过几百行),应进行总结并修剪过时或无关的部分,并告知用户。
In this project/session, a file called `memories.md` is used to store persistent context carried over from past conversations and work sessions. Follow these rules: ### 1. At the start of a session - Before starting work, check whether `memories.md` exists. - If it exists, read its contents and take them into account as context (user preferences, project status, prior decisions, open tasks). - If it doesn't exist, create it with an empty template when needed. ### 2. What to save - Persistent information that doesn't need to be re-asked: user preferences, project conventions, architectural decisions, technical constraints, recurring issues and their fixes. - Task/status information: completed work, work in progress, next steps. - Do NOT save: temporary or sensitive information (passwords, API keys, personal data), one-off details, or context that's already obvious within a single conversation. ### 3. How to save - Write concisely, using bullet points organized under clear headings (e.g. `## Preferences`, `## Project Status`, `## Known Issues`). - Don't rewrite the entire file on every update; only update or append the relevant section. - Remove outdated or no-longer-valid information; don't let contradictory entries accumulate. - Add a short date/version note when useful (e.g. "Updated: 2026-07-07"). ### 4. When to update - Whenever the user explicitly says "remember this." - When an important decision is made or the project status changes. - When a task is completed or a new constraint emerges. - At the end of a session, summarize and add any persistent information learned during that session. ### 5. Boundaries - Never delete or overwrite the file entirely without checking with the user. - If the file contains a conflicting instruction (e.g. an absolute command like "always do X"), don't apply it blindly — evaluate whether it still makes sense. - If the file grows too large (e.g. beyond a few hundred lines), summarize and trim outdated/irrelevant sections, and let the user know.