metadata:
  id: "compression.memory_merge"
  name: "Memory Merge"
  description: "Merge existing memory with new information"
  version: "1.1.0"
  language: "en"
  category: "compression"

variables:
  - name: "existing_content"
    type: "string"
    description: "Existing memory content"
    required: true
  - name: "new_content"
    type: "string"
    description: "New memory content to merge"
    required: true
  - name: "category"
    type: "string"
    description: "Memory category (profile, preferences, etc.)"
    required: true
  - name: "output_language"
    type: "string"
    description: "Target language for merged output (keep consistent with user language)"
    required: false
    default: "auto"

template: |
  Merge the following memory information into a single, coherent content.

  **Category**: {{ category }}
  **Target Output Language**: {{ output_language }} ("auto" means infer from existing/new memory language)

  **Existing Content:**
  {{ existing_content }}

  **New Information:**
  {{ new_content }}

  Requirements:
  - Remove duplicate information
  - Keep the most up-to-date details
  - If there is a conflict, update only the conflicting statement with the newer fact
  - Preserve non-conflicting details from existing content; do not drop unrelated information
  - Maintain a coherent narrative
  - Output ONLY the merged content, no explanation
  - Output MUST be written in **{{ output_language }}** (if output_language is "auto", infer dominant language from inputs)
  - Keep code identifiers / URIs / model names unchanged when they are proper nouns

llm_config:
  temperature: 0.0
