Skip to content
Skills Library
AI & agents · Research

memory-search

/memory-search

Tier 1 semantic memory search across the Serena corpus with progressive disclosure and token-budget warnings. The focused search operation split out of the memory router per ADR-063. Use when you say `search memory`, `what do we know about X`, or `recall prior context`. Do NOT use to extract session episodes (use memory-reflexion) or add citations (use memory-enhancement).

Repository
ai-agents ↗
Licence
MIT
Last repository change
12.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Tier 1 semantic memory search across the Serena corpus with progressive disclosure and token-budget warnings. The focused search operation split out of the memory router per ADR-063. Use when you say `search memory`, `what do we know about X`, or `recall prior context`. Do NOT use to extract session episodes (use memory-reflexion) or add citations (use memory-enhancement).

Original author description

Tier 1 semantic memory search across the Serena corpus with progressive disclosure and token-budget warnings. The focused search operation split out of the memory router per ADR-063. Use when you say `search memory`, `what do we know about X`, or `recall prior context`. Do NOT use to extract session episodes (use memory-reflexion) or add citations (use memory-enhancement).

How it works

  1. Triggers
  2. Quick Start
  3. Quick Reference
  4. Routing
  5. Progressive Disclosure
  6. Graceful Degradation
  7. Decision Tree
  8. Verification
  9. Anti-Patterns
  10. Process
Original SKILL.md headings · 157 lines, 921 words
SKILL.md preview
---
name: memory-search
description: Tier 1 semantic memory search across the Serena corpus with
  progressive disclosure and token-budget warnings. The focused search operation
  split out of the memory router per ADR-063. Use when you say `search memory`,
  `what do we know about X`, or `recall prior context`. Do NOT use to extract
  session episodes (use memory-reflexion) or add citations (use
  memory-enhancement).
metadata:
  adr: ADR-038, ADR-063, ADR-103, ADR-106
  capability:
    kind: reusable-primitive
    status: active
  parent: memory
  routing:
    role: front-door
    invoker: autoplan
    trigger: autoplan routes what-do-we-know-about-X requests to memory-search
    user-facing: false
---

# Memory Search

Tier 1 semantic search over memory: the focused search operation extracted from
the `memory` router per ADR-063 (memory-skill decomposition). `memory` still
routes here; a caller that needs only search loads this sub-skill instead of the
full memory surface.

## Triggers

Use this skill when the user says:

- `search memory` for semantic search across stored knowledge
- `what do we know about X` to recall facts, patterns, or constraints
- `recall prior context` before changing existing code or architecture

## Quick Start

```bash
# Search memory (Tier 1)
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/memory/scripts/search_memory.py "git hooks"; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )

# JSON output for scripting
( for d in "${CLAUDE_PLUGIN_ROOT}" "${COPILOT_PLUGIN_ROOT}" .claude; do if [ -n "$d" ] && [ -f "$d/lib/ptk_run.py" ]; then exec python3 "$d/lib/ptk_run.py" skills/memory/scripts/search_memory.py "git hooks" --format json; fi; done; echo "ptk_run: no plugin root holds lib/ptk_run.py" >&2; exit 2 )
```

The search script is canonical and shared with the `memory` router; this
sub-skill does not reimplement it. It lives at
`skills/memory/scripts/search_memory.py`, which the locator above runs.

## Quick Reference

| Operation | Script | Key Parameters |
|-----------|--------|----------------|
| Search facts/patterns | `search_memory.py` | `query`, `--max-results`, `--format` |

## Routing

`search_memory.py "<q>"` keyword-ranks Serena memory names, also searches the
Tier 2 episode store, flags large memories by token estimate, and returns the
relevant `*-index`. Read that index, then follow its links to
the atomic file.

Raw fallback when scripting: guess `read_memory("<intuitive-name>")` (a miss is
a cheap "not found", not a list), then the domain `*-index`, then
`read_memory("memory-index")`. Prefer these name and index lookups over a bare
`list_memories`.

## Progressive Disclosure

This skill implements progressive disclosure: list names, read details, deep
dive on cross-references. The point is to avoid loading a large memory when a
small slice answers the query.

| Layer | Tool | Cost | When to Use |
|-------|------|------|-------------|
| Index | `search_memory.py` | ~100-500 tokens | Always start here |
| Details | `read_memory` | ~500-10K tokens | After index confirms relevance |
| Deep Dive | Follow cross-references | Variable | For complete understanding |

Progressive disclosure prevents loading 9,500 tokens when only 1,200 are
relevant. List names first, then read only the entry the query needs.

## Graceful Degradation

Search degrades, it does not fail. Serena is the canonical store and travels
with the repository as plain markdown, so there is no service to be unreachable
and no fallback mode to select. A search that matches nothing returns an empty
result list plus a coverage note, never an error (ADR-007).

## Decision Tree

```text
What do you need?
│
├─► Current facts, patterns, or rules?
│   └─► search_memory.py "<query>"
│
└─► Not sure which tier?
    └─► Start here (Tier 1), escalate to the memory router if insufficient
```

## Verification

| Operation | Verification |
|-----------|--------------|
| Search completed | Result count > 0 OR logged "no results" |
| Empty corpus | Coverage note present; empty result list returned |

## Anti-Patterns

| Anti-Pattern | Do This Instead |
|--------------|-----------------|
| Skipping memory search | Always search before multi-step reasoning |
| Loading full memory eagerly | List names first, read only the relevant entry |
| Assuming a second backend exists | Serena is the only store; there is no semantic tier to fall back from |

## Process

### Phase 1: Query

Run `search_memory.py` with the query.

### Phase 2: Validate

Verify results are non-empty and relevant to the query context. A zero-result
search is a valid outcome; log it.

### Phase 3: Report

Return the relevant index name and the atomic entries it links, with source
attribution, to the caller.

## Related Skills

| Skill | When to Use Instead |
|-------|---------------------|
| `memory` | Router for episode extraction, health, or maintenance |
| `memory-enhancement` | Add citations, verify code references, track confidence |
| `curating-memories` | Memory maintenance (obsolete, deduplicate, link) |
| `context-gather` | Multi-source gather across Serena, Context7, DeepWiki, and web |

## Troubleshooting

| Symptom | Cause | Recovery |
|---------|-------|----------|
| Zero results | Query too narrow or memory index empty | Broaden query terms; verify memory index contains relevant entries |
| Slow response | Large memory corpus | Lower `--max-results`; every matched file is read for its preview |
| Partial results | Token budget hit mid-retrieval | Results include coverage note; caller decides whether to continue |

## Extension Points

| Extension | How to Add |
|-----------|------------|
| New memory tier | Create sibling sub-skill (e.g., `memory-episode`); register in `memory` router |
| Custom search backend | Implement script matching `search_memory.py` interface; update skill to invoke |
| Result post-processing | Chain output through `memory-enhancement` for citations or confidence scoring |

## References

- ADR-007: Memory system architecture
- ADR-037: Memory tier boundaries
- ADR-038: Episodic memory structure
- ADR-056: Memory progressive disclosure
- ADR-063: Memory skill decomposition (this extraction)

These reference files travel with the search operation per ADR-063. They are
demand-loaded; read one when you need the detail it covers.

| Document | Content |
|----------|---------|
| [references/quick-start.md](references/quick-start.md) | Common search and usage workflows |
| [references/memory-router.md](references/memory-router.md) | ADR-037 router architecture behind `search_memory.py` |
| [references/api-reference.md](references/api-reference.md) | Complete function reference for the memory API |
| [references/skill-reference.md](references/skill-reference.md) | Detailed `search_memory.py` script parameters |
| [references/where-to-search.md](references/where-to-search.md) | Ordered source list for searching before building, cheapest first |
Files in this package (6)
  • SKILL.md 7 KB
  • references/api-reference.md 13 KB
  • references/memory-router.md 13 KB
  • references/quick-start.md 12 KB
  • references/skill-reference.md 9 KB
  • references/where-to-search.md 1 KB

Versions

RepositoryScoreLicence
This page · rjmurillo/ai-agents100MIT
rjmurillo/ai-agents100MIT
S3YED/appie-kit100MIT
S3YED/appie-kit100MIT
davila7/claude-code-templates95MIT
23blocks-OS/ai-maestro-plugins95MIT
doloopz94/virtual-office-muse-ai90MIT
ibrain-bvba/gutt-claude-code-plugin90MIT
aristoapp/membase90MIT

Database snapshot: 13.11.2026 · package version 746792ea8a1e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100memory
    Thin router for the tiered memory system. Points callers at the focused sub-skills for each operation, Tier 1 search, the reflexion write path, the memory-first gate, maintenance, and consolidation. Use when you ask "what do we know about X", "recall prior context", or "search…
  • 100memory
    Thin router for the tiered memory system. Points callers at the focused sub-skills for each operation, Tier 1 search, the reflexion write path, the memory-first gate, maintenance, and consolidation. Use when you ask "what do we know about X", "recall prior context", or "search…
  • 100mem-search
    Search persistent memory using keyword or semantic (TF-IDF) search. Use when the user asks "do we have any notes on X", "what do we know about Y", "did we decide anything about Z", "search memory for", "recall anything about", "look up in memory", or any question about past…
  • 95pact-memory
    Persistent memory for PACT agents. Save context, goals, lessons learned, decisions, and entities. Semantic search across sessions. Use when: saving session context, recalling past decisions, searching lessons. Triggers: memory, save memory, search memory, lessons learned, remember, recall
  • 93serena-usage
    Serena MCP for project memory and code navigation. Use when managing Serena memories, navigating symbols, performing intelligent refactoring, or maintaining context/continuity across AI agent sessions.
  • 98knowledge
    Browse, search, and prune what the framework's agents remember across sessions (native agent memory under ~/.claude/agent-memory/, plus project Serena memories), and detect and migrate orphaned bare-named memory directories — use when asked "what do the agents remember", "browse…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.