ワンクリックで
pmm-query
Query memory — context-first recall with deep traversal across vectors, graph, and taxonomy when needed.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Query memory — context-first recall with deep traversal across vectors, graph, and taxonomy when needed.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Seed your user identity layer from a prior AI or direct interview. Generates user.md (operative identity — how you think, communicate, decide) and routes PII to secrets.md. Works solo or in org-wide deployments (gated to a single designated agent). Trigger on: "pmm-onboard", "/pmm-onboard"
Seed your user identity layer from a prior AI or direct interview. Generates user.md (operative identity — how you think, communicate, decide) and routes PII to secrets.md. Works solo or in org-wide deployments (gated to a single designated agent).
Initialize Poor Man's Memory in your project — runs preference wizard, scaffolds memory/ directory, configures hooks. Trigger on: "pmm-init", "/pmm-init", "initialize memory", "set up memory", "start pmm", "init pmm", "scaffold memory", "set up poor man's memory", or any request to initialize the PMM memory system in a project.
Save current session to memory — dispatches maintain agent, updates memory files, commits to git. Trigger on: "pmm-save", "/pmm-save", "save memory", "commit memory", "persist session", "save session", "wrap up memory", "update memory files", or any request to save the current session state to memory.
Change Poor Man's Memory configuration. Re-presents preference prompts for save cadence, commit behaviour, push behaviour, sliding window size, verbosity, repository visibility, maintain agent model, maintain strategy, readonly agent model, session start mode, recall beyond window, secrets_git, pre-compact hook, active files, and load strategies. Use when the user runs /pmm-settings or asks to change memory system settings. Trigger on: "pmm-settings", "/pmm-settings", "change memory settings", "configure pmm", "memory configuration", "update pmm settings", "pmm preferences", or any request to view or change PMM configuration.
Quick PMM health dashboard. Shows initialization state, last save time, recent commits, file health, and warnings. Runs as a subagent. Use when the user runs /pmm-status or asks if memory is saving, working, or healthy. Trigger on: "pmm-status", "/pmm-status", "memory status", "pmm health", "is memory working", "is memory saving", "memory dashboard", or any request to check the health or status of the PMM system.
| name | pmm:query |
| description | Query memory — context-first recall with deep traversal across vectors, graph, and taxonomy when needed. |
| argument-hint | <question or search term> |
Explicit memory recall. Context-first — answers from already-loaded files before any agent dispatch. Supports free-text questions, attribution filters, date ranges, file scoping, deep traversal, and prose or dump output.
Query: $ARGUMENTS
If $ARGUMENTS is empty, ask the user what to search for before proceeding.
Map question type to target file(s):
| Question type | Target file(s) |
|---|---|
| Decisions / decided / ratified | decisions.md |
| Preferences / style / how user works | preferences.md |
| Tone / voice / reasoning / lens | voices.md |
| Recent work / latest / just shipped | last.md, progress.md |
| Relationships / how things connect | graph.md, vectors.md |
| History / arc / timeline | timeline.md |
| Rules / directives / standing instructions | standinginstructions.md |
| People / tools / systems | assets.md |
| Facts / long-term / background | memory.md |
| Processes / workflows | processes.md |
| Mistakes / lessons / errors | lessons.md |
| Categories / naming / taxonomy | taxonomies.md |
| Ambiguous / broad | all active files |
Extract from $ARGUMENTS:
by namespace:name (e.g. by user:raffi, by agent:leith)since YYYY-MM-DD or before YYYY-MM-DDin <filename> (e.g. in decisions, in lessons) — search only that filedeep → set deep=true, remove from keyworddump → set dump=true, remove from keywordRead memory/config.md for Session Start mode.
If Mode: lazy — memory files are already in context (injected by the SessionStart hook). Execute Steps 3–8 directly in the main context window without dispatching any agent. Tier 1 files are in-context. For Tier 2 files (graph.md, vectors.md, taxonomies.md, assets.md), use the Read tool to load the relevant file before searching — do not load all four, only what the routing table requires.
If Mode: eager — fall through to Agent Dispatch at the end of this document.
For each target file (respecting routing table and any in <file> scope):
[namespace:name] matching the filterYYYY-MM-DD) satisfies ≥ since or ≤ beforeRead memory/config.md to confirm which files are active. Skip deactivated files.
Skip if deep=false.
Expand the result set using similarity, graph, and taxonomy data. Run regardless of whether Step 3 found results.
4a — Vector cluster expansion (vectors.md):
vectors.md[[A]] ↔ [[B]] | score: ...) where A or B matches — collect the paired concept if score ≥ 0.6[via vectors]4b — Graph edge traversal (graph.md):
graph.md[[keyword]])[via graph]4c — Taxonomy broadening (taxonomies.md):
taxonomies.md[via taxonomy]Deduplicate — results already found in Step 3 should not be listed again.
If Steps 3 and 4 returned no results:
memory/config.md for the Active Files listOnly if Steps 3, 4, and 5 together returned no results.
Check memory/config.md for ## Recall Beyond Window → Mode:
If Mode: prompt — present AskUserQuestion with three options:
Yes, search git history — dispatch a minimal git-history agent (no file reads; memory is in context):
Run: git log --all --grep="<keyword>" --oneline
For each matching commit: git show <hash> -- memory/
Return the relevant lines and which commit they came from.
Use the Readonly Agent Model from config (default: haiku). Incorporate results into Step 8 output tagged (from git history, commit <hash>).
Yes, and don't ask me again — same dispatch, then update memory/config.md: replace - Mode: prompt under ## Recall Beyond Window with - Mode: auto
No — return: No record found in the current memory window.
If Mode: auto — silently dispatch the minimal git-history agent (no file reads; same prompt as above).
Skip if deep=true (graph.md was already traversed in Step 4b).
Otherwise: if results mention a named entity (person, tool, system, concept) that also appears in graph.md or assets.md:
Related context: note (1–2 lines) if it genuinely enriches the resultBranch A — Prose mode (default, dump=false):
Synthesize a narrative answer from all collected results.
Rules:
(decisions.md), (timeline.md, 2026-03-17)[user:raffi]Sources: footer line listing all files that contributedNo record found in the memory files.<synthesized narrative answering the user's question, citing sources inline>
Sources: decisions.md, timeline.md, graph.md
Branch B — Dump mode (dump=true):
PMM Query Results
=================
Query: <original query>
Filters: <attribution filter> | <date filter> | <file scope> (or "none" if no filters)
Mode: <deep+dump | dump>
Found: N result(s) in M file(s)
--- <filename>.md ---
<verbatim matching entry, including attribution tag if present>
--- <filename>.md [via vectors] ---
<entry found through vector cluster/similarity expansion>
--- <filename>.md [via graph] ---
<entry found through graph edge traversal>
--- <filename>.md [via taxonomy] ---
<entry found through taxonomy broadening>
[Related context]
<brief enrichment from graph.md/assets.md, if applicable>
--- git history (commit abc1234) ---No record found in the memory files.PMM Query ResultsUsed only when Mode: eager.
Dispatch a general-purpose agent using the Readonly Agent Model from memory/config.md (default: haiku). Replace <project-root> with the actual project root path and <user-query> with $ARGUMENTS.
Query PMM memory files. This is a READ-ONLY task — do not edit any files.
Project root:
<project-root>User query:<user-query>Step 1 — Parse Query
Extract from the user query:
- Keyword / question — core search term
- Attribution filter —
by namespace:name- Date filter —
since YYYY-MM-DDorbefore YYYY-MM-DD- File scope —
in <filename>- Deep flag — word
deeppresent- Dump flag — word
dumppresentStep 2 — Route to Relevant Files
If file scope is set, search only that file. Otherwise use the routing table:
- Decisions / ratified →
decisions.md- Preferences / style →
preferences.md- Tone / voice / lens →
voices.md- Recent work / latest →
last.md,progress.md- Relationships →
graph.md,vectors.md- History / timeline →
timeline.md- Rules / standing →
standinginstructions.md- People / tools →
assets.md- Facts / background →
memory.md- Processes / workflows →
processes.md- Mistakes / lessons →
lessons.md- Categories / naming →
taxonomies.md- Ambiguous / broad → all active files
Read
<project-root>/memory/config.mdto confirm active files. Skip deactivated files.Step 3 — Search
For each target file:
- Read the file
- Match entries containing the keyword (case-insensitive)
- Apply attribution filter if set
- Apply date filter if set
- Collect matches with source file noted
Step 4 — Deep Traversal (deep=true only)
4a — vectors.md: Find clusters/similarities containing keyword (score ≥ 0.6). Tag results
[via vectors].4b — graph.md: Find edges containing keyword, collect one-hop neighbours. Tag results
[via graph].4c — taxonomies.md: Find categories containing keyword, collect siblings. Tag results
[via taxonomy].Deduplicate against Step 3 results.
Step 5 — Full File Escalation (T3)
If Steps 3 and 4 returned no results:
- Read
memory/config.mdfor the Active Files list- For each active file loaded with tail:N, header, or skip at session start: re-read the file in full using the Read tool
- Search the full content for the query keyword
- If matches found, collect them and proceed to Step 8 (format output)
- If still no matches, proceed to Step 6 (git fallback)
Step 6 — Fallback Chain
If Steps 3+4+5 return no results:
- Check
timeline.mdandlast.md- Run:
git log --all --grep="<keyword>" --oneline- For matching commits:
git show <hash> -- memory/— extract relevant lines- If still nothing: return
No record found in the memory files.Never hallucinate past context.
Step 7 — Cross-Reference Enrichment
Skip if deep=true. Otherwise: if results mention a named entity in
graph.mdorassets.md, append a briefRelated context:note (1–2 lines max) if it adds meaningful information.Step 8 — Format Output
Prose mode (dump=false): synthesized narrative with inline citations and
Sources:footer.Dump mode (dump=true): structured
PMM Query Resultsblock with verbatim entries grouped by file, provenance tags on deep-traversal results.Return the formatted output as a string. Do not write to any file.
Output the agent's return value verbatim.
session_start: lazy (hook-loaded sessions). This eliminates agent dispatch for in-window queries.Readonly Agent Model in memory/config.md (default: haiku). No reasoning required for read-only traversal.[user:name], [agent:name], [system:process]) identify who originated each piece of information. Always preserve and surface them.references/core.md.