Skip to content
Back to skills

Memory Retrieval

ASecurity

How semantic memory works with compaction and the MemoryStore trait

  • 25 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 2, 2026
ai-agentsapi

Works with

  • terminal
  • api

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add lukacf/meerkat --skill memory-retrieval --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Memory Retrieval?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Memory Retrieval
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lukacf-memory-retrieval/badge)](https://www.skillsdirectory.com/skills/lukacf-memory-retrieval)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Memory Retrieval
description: How semantic memory works with compaction and the MemoryStore trait
requires_capabilities: [memory_store]
---

# Memory Retrieval

Use memory for knowledge retrieval and long-horizon context recall. Memory is
not live work state, not a scheduler, and not a commitment graph.

## Operating Rules

- Memory is scoped to the current session: it recalls turns compacted away
  earlier in this session, including turns compacted before a restart or
  resume of the same session.
- Use `memory_search` when compacted context from earlier in this session
  would materially improve the current answer. It accepts `query` and an
  optional `limit` (default 5, capped at 20).
- Treat matches as recalled evidence with similarity scores, not as current
  truth. Verify against live stores, files, APIs, or WorkGraph when correctness
  matters.
- Search results carry source message ranges when available. Use that typed
  provenance rather than guessing which later turn caused the compaction.
- Compaction summaries and host-injected context are intentionally excluded
  from memory indexing. Memory indexes eligible content discarded by
  compaction, not every message the model has seen.
- Use WorkGraph for pending, blocked, claimed, or terminal work.
- Use Schedule for future wakeups and recurrence.
- Use builtin tasks for private scratch tracking.

## Your Handover

When older turns are compacted away, the summary of them is written for you.
It is prose, and it can miss what you owe. What your next context must not
lose, you write down yourself with `memory_handover`:

- `obligations`: what you owe, to whom, and until when.
- `decisions`: what was decided, and by whom.
- `ids`: the ids you will need again, each with a `label` and the `id` exactly
  as you were given it (a work item, a schedule, a record, a file).
- `next_actions`: what you do next, in order.

A call replaces the fields it names and keeps the others; an empty list clears
a field. Each field holds at most 32 entries and 4096 bytes.

After a compaction, your handover stands on the summary row as structured
data, `{"handover": {...}}`, beside the summary's text, exactly as you wrote
it, and every later compaction carries it on. Nothing is read out of the
summary's prose. So:

- Keep it current. Write it when you take on or settle an obligation, when a
  decision is made, when you are given an id you will need again, and when
  your next action changes.
- You are told once when a compaction is near (a notice that names
  `memory_handover`): bring your handover up to date then at the latest. A
  host can also ask for a compaction at any time, without that notice: what
  you have not written when it comes is only in the summary.
- Where the summary and your handover disagree, the handover is what you
  wrote.
- The handover is a note to yourself in this session. It is not shared work
  state: an obligation other agents or people depend on belongs in WorkGraph
  or a schedule, and the handover holds its id.

## Scores

- Scores range from `0.0` to `1.0`.
- Higher scores are more similar, not automatically more authoritative.
- Prefer several corroborating matches over one weak match.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.