system_prompt: |
  Pre-compaction memory flush turn.
  The session is near auto-compaction; capture durable memories to disk.
  You may reply, but usually [SILENT] is correct.

user_message: |
  Pre-compaction memory flush.
  Current Date: {date}
  Store durable memories now (use {memory_dir}/YYYY-MM-DD.md; create {memory_dir}/ if needed).
  If nothing to store, reply with [SILENT].

user_message_default: |
  Pre-compaction memory flush turn.
  The session is near auto-compaction; capture durable memories to disk.

  Current Date: {date}
  Working Dir: {working_dir}

  Store durable memories now (use {memory_dir}/YYYY-MM-DD.md).

  Workflow:
  1. Use read_tool to read {memory_dir}/YYYY-MM-DD.md (if file doesn't exist, read_tool tool will return an error)
  2. Intelligently merge new information with existing content (skip if file doesn't exist):
     - Avoid duplicating information that's already recorded
     - Enrich existing entries with new details when relevant
     - Maintain chronological order when applicable
  3. Write the updated content:
     - Use edit_tool to update specific sections when possible
     - Use write_tool to overwrite the entire file if major restructuring is needed
  4. Create {memory_dir}/ if it doesn't exist

  Principles:
  - Always preserve timestamps, dates, and time-related context
  - Only add truly new or enriching information
  - Keep entries concise but complete
  - If nothing meaningful to store, reply with [SILENT]


user_message_default_zh: |
  预压缩内存刷新轮次。
  当前会话即将进入自动压缩阶段；请将持久化记忆捕获并写入磁盘。

  当前日期：{date}
  工作目录：{working_dir}

  立即存储持久化记忆（使用路径 {memory_dir}/YYYY-MM-DD.md）。

  工作流程：
  1. 使用 read_tool 读取 {memory_dir}/YYYY-MM-DD.md（如文件不存在，read_tool 会返回错误提示）
  2. 智能合并新信息与现有内容（若文件不存在则跳过合并）：
     - 避免重复已记录的信息
     - 在相关时丰富现有条目的新细节
     - 在适用时保持时间顺序
  3. 写入更新后的内容：
     - 尽可能使用 edit_tool 更新特定部分
     - 如需大幅重构则使用 write_tool 覆盖整个文件
  4. 如 {memory_dir}/ 不存在则创建

  原则：
  - 始终保留时间戳、日期和时间相关上下文
  - 仅添加真正新的或有丰富价值的信息
  - 保持条目简洁但完整
  - 若无有意义的内容可存储，请回复 [SILENT]


user_message_v1: |
  <conversation>
  {conversation}
  </conversation>

  The conversation is about to be compacted. Please extract persistent memories to disk.
  Current Date: {date}
  Working Dir: {working_dir}

  Execution Flow:
  1. Determine if the conversation contains information worth storing
     - If no: Reply with reason + [SILENT]
     - If yes: Continue to step 2

  2. Use Read tool to read {memory_dir}/YYYY-MM-DD.md (use actual date)
     - If file doesn't exist (Read returns error): Write new memories directly
     - If file exists:
       a) Compare and identify new/updated information from the read content
       c) Prefer `edit_tool` for precise additions (preserves existing content); `write_tool` overwrites entire file
       d) If no new information: Reply with explanation + [SILENT]

  Update Principles:
  - Only add unrecorded information, preserve all existing content
  - Intelligently merge duplicate information, retain key details like timestamps

  Example (information merging):
  Existing: "Alice joined Company A as Software Engineer on 2023-01-01"
  New: "Alice joined Company B as Senior Engineer on 2024-01-01"
  Result: "Alice joined Company A as Software Engineer on 2023-01-01, moved to Company B as Senior Engineer on 2024-01-01"

  Please store persistent memories, keeping entries concise and well-structured.

user_message_v1_zh: |
  <conversation>
  {conversation}
  </conversation>

  conversation即将压缩，请提取持久性记忆存储至磁盘。
  当前日期：{date}
  工作目录: {working_dir}

  执行流程：
  1. 判断对话是否包含值得存储的信息
     - 若无：回复原因 + [SILENT]
     - 若有：继续步骤 2

  2. 使用 Read 工具读取 {memory_dir}/YYYY-MM-DD.md（使用实际日期）
     - 文件不存在（Read 返回错误）：直接使用 `write_tool` 写入新记忆
     - 文件已存在：
       a) 从读取的内容中对比识别新增/更新信息
       c) 优先使用 `edit_tool` 精准添加新信息（保留已有内容）
       d) 若无新信息：回复说明 + [SILENT]

  更新原则：
  - 仅添加未记录的信息，保留所有已有内容
  - 智能合并重复信息，保留时间等关键细节

  示例（信息合并）：
  已有："Alice 于 2023-01-01 加入 A 公司任软件工程师"
  新增："Alice 于 2024-01-01 加入 B 公司任高级工程师"
  结果："Alice 于 2023-01-01 加入 A 公司任软件工程师，2024-01-01 转入 B 公司任高级工程师"

  请存储持久性记忆，保持条目简洁、结构清晰。
