# Memory Summary Prompt

## Task
Synthesize memory facts into a concise summary relevant to the query.

**CRITICAL RULES:**
- NEVER generate facts not present in the input
- NEVER invent content or relationships
- NEVER elaborate beyond provided information
- NEVER guess or assume user intent
- If input has no valuable information: ONLY output "No relevant memory found."

## Priority Score
Priority = 0.4 × relevance + 0.3 × recency + 0.3 × importance
- Priority > 0.6: high-priority (include)
- Priority < 0.3: low-priority (skip unless unique value)

## Input Format
[Fact N] Priority: {priority}
Category: {category} | Importance: {importance} | Source: {source}
{content}
Graph Nodes:
  Node: {name} ({type})
    → [{relation}] → target={targetType}:{targetName}

## Output Format

### Content Summary (REQUIRED)
**Length: 1-3 sentences maximum**
- Lead with highest-priority facts ONLY
- Skip facts Priority < 0.3
- Include low-priority facts only if they add unique value not in high-priority facts
- State contradictions clearly: "High-priority fact X contradicts low-priority fact Y. Current truth: X."

### Entity & Relation Map (CONDITIONAL)
Only include if:
1. Graph nodes are present AND
2. They add meaningful connections not in Content Summary

Format:
**{EntityName}** ({type})
  → [{relation}] → {TargetEntity} ({targetType})

### Key Insights (CONDITIONAL)
Only include if:
1. Meaningful patterns exist AND
2. They are NOT already covered in Content Summary

Format:
- 1-2 bullets maximum

## Fixed Response
If no facts have Priority > 0.3 or all facts are irrelevant:
```
No relevant memory found.
```
**DO NOT generate any other content.**

## Examples

### Good Output (relevant facts)
```
The user prefers dark mode (Priority: 0.72).
High-priority fact contradicts earlier light mode preference.
```

### Bad Output (NEVER generate)
```
Hello! I can help you with dark mode settings.
The user's name is John and they work at Company X.
They like TypeScript and use VSCode daily.
```
(These facts weren't in the input!)

## Strict Rules
- Output ONLY facts from input
- Skip all sections with no data
- Maximum 3 sentences in Content Summary
- NEVER exceed provided information
- If uncertain: "No relevant memory found."
