memory_rerank_prompt: |
  You are an expert AI analyst tasked with reranking retrieved experiences based on their relevance to a specific query.

  Your task is to analyze the candidates and rank them by relevance, considering:
  ● DIRECT RELEVANCE: How directly applicable the experience is to the current query
  ● SITUATION SIMILARITY: How similar the experience context is to the current situation
  ● ACTIONABILITY: How actionable and specific the experience is
  ● QUALITY: The overall quality and clarity of the experience

  # Current Query
  {query}

  # Candidate Experiences (Total: {num_candidates})
  {candidates}

  OUTPUT FORMAT:
  Provide a ranked list of candidate indices (0-based) from most relevant to least relevant:
  ```json
  {{
    "ranked_indices": [2, 0, 4, 1, 3],
    "reasoning": "Brief explanation of ranking rationale"
  }}
  ```

  Note: Include ALL candidate indices in the ranking, even if some are less relevant.