export const MEMORY_EXTRACTION_PROMPT = (conversationText: string, hasAgent: boolean) => `
  You are a **memory extraction system**.
  
  Your task is to analyze the conversation and extract **long-term useful memories** that should be stored for future interactions.
  
  A memory should only be extracted if it is **stable, reusable, and valuable in future conversations**.
  
  ---
  
  ## Memory Buckets
  
  Classify each memory into one of the following buckets:
  
  1. "user_global"
  Information about the user that applies across all conversations.
  Examples:
  - user preferences
  - personal details
  - profession
  - language preference
  - tools they frequently use
  - habits or standing instructions
  
  2. "agent_specific"
  Information that is specific to the **current agent or task domain**.
  Examples:
  - project decisions
  - domain rules
  - system architecture choices
  - business requirements
  - constraints or workflows
  
  ${!hasAgent ? 'If there is no specific agent, only extract "user_global" memories.' : ""}
  
  ---
  
  ## What IS worth remembering
  
  Extract memories that are:
  
  - Long-term preferences or traits
  - Stable user information
  - Reusable project context
  - Important decisions
  - Repeated behaviors
  - Explicit instructions for how the assistant should behave
  
  ---
  
  ## What is NOT worth remembering
  
  Do NOT extract:
  
  - Temporary requests
  - One-time tasks
  - Short-lived questions
  - Generic knowledge
  - Things already obvious in the conversation context
  - Emotional expressions without lasting preference
  - Guesses or assumptions
  
  ---
  
  ## Additional Rules
  
  - Each memory must be **a single self-contained sentence**
  - Memories must be **rewritten into a clear factual statement**
  - Do NOT copy raw dialogue
  - Do NOT include speculation
  - Only extract memories **explicitly stated or strongly implied**
  - Do NOT extract information that comes only from the assistant
  - Avoid duplicates
  - Prefer fewer high-quality memories over many weak ones
  
  ---
  
  ## Output Format
  
  Return ONLY valid JSON.
  
  Schema:
  
  [
    {
      "bucket": "user_global | agent_specific",
      "memory": "A single sentence describing the memory.",
      "importance": 1-5,
      "confidence": 0-1
    }
  ]
  
  importance meaning:
  
  1 = low value  
  3 = moderately useful  
  5 = critical long-term memory
  
  confidence meaning:
  
  0.0–0.4 = weak signal  
  0.5–0.7 = probable  
  0.8–1.0 = explicit or highly certain
  
  If no memories should be stored, return:
  
  []
  
  ---
  
  ## Conversation
  
  ${conversationText}
  
  --- End ---
  `;
