---
name: memory-recall
title: "Memory Recall"
description: "Strategy for graph-powered memory recall and multi-layer search"
category: core
status: active
triggers:
  - "what do I know about"
  - "what do you know about"
  - "remind me about"
  - "how is X related to"
  - "what happened with"
  - "tell me about"
  - "who is"
  - "what's the connection between"
---

## Instructions

When the user asks about an entity, relationship, or past event, use the layered recall strategy:

### Layer 1: Knowledge Graph (fast, structured)

Use `query_memory_graph` first. This returns:
- **Entity facts** grouped by predicate (works_at, knows, prefers, etc.)
- **Authority levels** — explicit facts are most reliable, inferred are suggestive
- **Connected entities** — who/what is linked within 2 hops
- **Path queries** — for "how are X and Y connected?" questions

### Layer 2: Daily Memory Files (deep, contextual)

Use `recall_memory` for context that triples can't capture:
- Narrative details, conversation excerpts, emotional context
- Events that happened on specific dates
- The "why" behind decisions (triples capture "what", files capture "why")

### Layer 3: Memory Archives (historical, deep)

Use `deep_memory_recall` when the user asks about **patterns over time**, **past periods**, or when Layers 1-2 don't have enough context:
- "What happened in Q1?" → search quarter archives
- "What were my patterns last month?" → search month archives
- "How has my focus changed over the year?" → search year archives
- "What was I working on in week 12?" → read specific period `2026-W12`

Archive structure:
- **Weekly archives** (~52/year) — vivid detail, recent events
- **Monthly archives** (12/year) — patterns, key events
- **Quarterly archives** (4/year) — milestones, turning points
- **Yearly archives** (1/year) — what defined the year

Use `list_archives=true` first to see what periods are available, then `period` to read a specific one, or `query` to search across all.

### Layer 4: Connected Entity Expansion

When the direct query returns partial results:
- Follow graph connections to related entities
- Check if related entities have relevant triples
- Build a fuller picture from the neighborhood

### Response Assembly

When presenting recalled information:

1. **Lead with explicit-authority facts** — these are user-confirmed, most reliable
2. **Support with system-authority facts** — agent-observed, high confidence
3. **Note inferred connections** — always qualify: "Based on co-occurrence, it appears that..."
4. **Cite sources with dates** — "According to your journal on 2026-03-15..."
5. **Flag approaching decay** — "Note: this fact hasn't been accessed in 45 days and may become stale"
6. **Show the graph** — when relationships are complex, describe the connection path

### Path Queries

For "how are X and Y connected?" questions:
- Use `query_memory_graph` with both `entity` and `related_to` parameters
- Walk the path and explain each hop with supporting triples
- If no direct path exists, note that they appear unconnected in your memory

## Rules

- Graph before files — structured facts first, narrative context second
- Never present inferred facts as certainties — always qualify confidence level
- Respect decay — if a fact is decayed, mention it was known but may be outdated
- Access tracking feeds decay — every query keeps facts alive, so recall is self-reinforcing
- If nothing found, say so honestly — don't fabricate from partial matches
- For "who is" questions, check entity type and present the most relevant triples first
