|
| 1 | +--- |
| 2 | +name: recall |
| 3 | +type: command |
| 4 | +description: > |
| 5 | + Search the shared eidetic memory store and get back ranked, provenanced |
| 6 | + records. Drives `eidetic recall` with four search modes — exact (verbatim |
| 7 | + substring), approximate (vector/semantic), keyword (BM25 lexical), and hybrid |
| 8 | + (a weighted blend of vector+keyword, the default) — each hit carrying its |
| 9 | + text, full metadata, a relevance `score`, and a freshness `signal`. Recall |
| 10 | + passively reinforces matched records (bumps last_recall + recall_count). |
| 11 | + Shadowed and archived records are excluded by default; use |
| 12 | + --include-shadowed / --include-archived to retrieve them. The store lives at |
| 13 | + ~/.eidetic/memory (a home-dir path outside any git worktree); the wrapper |
| 14 | + defaults queries to this agent's PERSONAL, PRIVATE scope (`--scope culture-tools |
| 15 | + --visibility private`, suffix read from culture.yaml) — matching where |
| 16 | + /remember writes — so a no-flag recall returns this agent's own private records |
| 17 | + plus the shared public pool, and Claude and the colleague backend recall each |
| 18 | + other's memories because both resolve the same suffix via this skill. Use |
| 19 | + when the user says "recall", "what do we know about X", "search memory", |
| 20 | + "have we seen X before", "look it up in memory", "eidetic recall", or before |
| 21 | + answering from scratch when prior context may already be stored. Pairs with |
| 22 | + the sibling /remember skill. |
| 23 | +--- |
| 24 | + |
| 25 | +# recall — search the shared eidetic memory |
| 26 | + |
| 27 | +`recall` drives **`eidetic recall`**: given a query, it returns the top-k stored |
| 28 | +records ranked by relevance, each with its `text`, full `metadata` (provenance), |
| 29 | +a numeric `score`, and a freshness `signal`. It is the read half of the memory |
| 30 | +surface; the write half is the sibling **/remember** skill. |
| 31 | + |
| 32 | +The point of a *shared* store is that memory is a **team faculty**, not a |
| 33 | +per-agent silo: a record Claude wrote is recallable by the colleague backend |
| 34 | +(and vice versa), because both resolve the same `~/.eidetic/memory` path. |
| 35 | + |
| 36 | +## How to run |
| 37 | + |
| 38 | +```bash |
| 39 | +bash .claude/skills/recall/scripts/recall.sh "<query>" [flags...] |
| 40 | +``` |
| 41 | + |
| 42 | +The wrapper resolves the CLI portably (installed `eidetic` on `PATH`, else |
| 43 | +`uv run eidetic` from the checkout) and forwards every flag verbatim, so it is |
| 44 | +exactly `eidetic recall …`. Run it from anywhere; the store is the same. |
| 45 | + |
| 46 | +## Search modes (`--mode`, default `hybrid`) |
| 47 | + |
| 48 | +| Mode | What it matches | Needs embed server? | |
| 49 | +|------|-----------------|---------------------| |
| 50 | +| `exact` | case-insensitive verbatim substring (`--case-sensitive` to tighten) | no — offline-safe | |
| 51 | +| `approximate` | vector cosine / semantic similarity | yes (falls back offline) | |
| 52 | +| `keyword` | BM25 lexical; only records sharing a query term | no — offline-safe | |
| 53 | +| `hybrid` | `alpha*approximate + (1-alpha)*keyword` (`--alpha`, default 0.5) | uses it when up | |
| 54 | + |
| 55 | +`hybrid` is the default because the two signals cover each other's blind spots: |
| 56 | +vector catches paraphrases, keyword catches exact ids/quotes. When the embed |
| 57 | +server is unreachable, `hybrid` collapses to keyword-only (it never fuses |
| 58 | +meaningless offline-fallback cosine). |
| 59 | + |
| 60 | +## Output fields |
| 61 | + |
| 62 | +Each hit in `--json` output includes: |
| 63 | + |
| 64 | +| Field | Notes | |
| 65 | +|-------|-------| |
| 66 | +| `id` | stable record identity | |
| 67 | +| `text` | the stored chunk | |
| 68 | +| `type` | record type | |
| 69 | +| `metadata` | full provenance, round-tripped verbatim from ingest | |
| 70 | +| `score` | relevance score from the chosen search mode (freshness-blended) | |
| 71 | +| `signal` | freshness strength in [0, 1]; computed at recall time from age, recall frequency, and staleness | |
| 72 | +| `created` | ISO-8601 ingest date (may be DATE_UNKNOWN for legacy records) | |
| 73 | +| `last_recall` | ISO-8601 timestamp of the most recent recall hit (null if never recalled) | |
| 74 | +| `recall_count` | number of times this record has been recalled (passive reinforcement counter) | |
| 75 | +| `lifecycle` | `active`, `shadowed`, or `archived` | |
| 76 | +| `links` | list of related-memory ids | |
| 77 | + |
| 78 | +## Freshness signal |
| 79 | + |
| 80 | +Every `recall` hit carries a `signal` field (float in `[0, 1]`). The signal |
| 81 | +blends **multiplicatively** into the lexical/vector score so recently-created |
| 82 | +and frequently-recalled records surface ahead of stale ones. The formula: |
| 83 | + |
| 84 | +``` |
| 85 | +access_bonus = min(0.5, recall_count * 0.05) |
| 86 | +age_factor = 1 / (1 + days_since_creation * 0.01) |
| 87 | +staleness = days_since_last_recall * 0.01 |
| 88 | +signal = clamp((0.5 - staleness + access_bonus) * age_factor, 0, 1) |
| 89 | +blended_score = score * (1 + 0.25 * (signal - 0.5)) |
| 90 | +``` |
| 91 | + |
| 92 | +Records with no temporal data (legacy, undated) are an exact no-op — the blend |
| 93 | +is skipped for them so pre-existing fixture scores are unchanged. |
| 94 | + |
| 95 | +Each `recall` call is also **passive reinforcement**: it bumps `last_recall` and |
| 96 | +`recall_count` on every matched record, so frequently-recalled memories organically |
| 97 | +gain signal strength over time. |
| 98 | + |
| 99 | +## Lifecycle flags |
| 100 | + |
| 101 | +By default, `recall` returns only `active` records. Use these flags to retrieve |
| 102 | +non-active records: |
| 103 | + |
| 104 | +- `--include-shadowed` — include records whose `lifecycle == "shadowed"` (records |
| 105 | + superseded within their scope by a newer record). Shadowed records are preserved |
| 106 | + and still searchable; they are just hidden from the default result set. |
| 107 | +- `--include-archived` — include records whose `lifecycle == "archived"` (records |
| 108 | + older than ~1 year or below the signal threshold). Archived records are fully |
| 109 | + preserved; the flag makes them retrievable again. |
| 110 | + |
| 111 | +Both flags can be combined. Neither affects ranking — shadowed/archived records |
| 112 | +compete on score/signal just like active ones when included. |
| 113 | + |
| 114 | +## Common flags (forwarded to `eidetic recall`) |
| 115 | + |
| 116 | +- `--mode exact|approximate|keyword|hybrid` — default `hybrid`. |
| 117 | +- `--top-k N` — max results (default 5). |
| 118 | +- `--alpha F` — hybrid blend weight in `[0,1]` (default 0.5). |
| 119 | +- `--case-sensitive` — for `--mode exact`. |
| 120 | +- `--filter KEY=VALUE` — metadata facet filter (repeatable): e.g. `--filter source=docs`. |
| 121 | +- `--scope NAME` / `--visibility public|private` — scope isolation (no private |
| 122 | + leak). **The wrapper defaults this to the agent's PERSONAL, PRIVATE scope** |
| 123 | + (`--scope culture-tools --visibility private`, suffix read from `culture.yaml`), |
| 124 | + matching where `/remember` writes — so a no-flag recall returns this agent's |
| 125 | + own private records **plus** the shared public pool, while those private records |
| 126 | + stay invisible to a `default`/other-scope recall. Pass `--scope`/`--visibility` |
| 127 | + to query elsewhere; a wheel install with no `culture.yaml` falls back to the |
| 128 | + CLI default `default`/`public`. |
| 129 | +- `--backend files|mongo|neo4j` — default `files` (the shared home-dir store). |
| 130 | +- `--include-shadowed` — include shadowed records in results (excluded by default). |
| 131 | +- `--include-archived` — include archived records in results (excluded by default). |
| 132 | +- `--json` — structured list to stdout (use this when an agent parses the result). |
| 133 | + |
| 134 | +## Examples |
| 135 | + |
| 136 | +```bash |
| 137 | +# Default hybrid recall, JSON for an agent to parse: |
| 138 | +bash .claude/skills/recall/scripts/recall.sh "jetson nano power draw" --json |
| 139 | + |
| 140 | +# Find the exact message that mentions a phrase: |
| 141 | +bash .claude/skills/recall/scripts/recall.sh "Orin Nano" --mode exact |
| 142 | + |
| 143 | +# Keyword search, offline-safe, narrowed to a source: |
| 144 | +bash .claude/skills/recall/scripts/recall.sh "thermal throttle" --mode keyword \ |
| 145 | + --filter source=discord --top-k 10 |
| 146 | + |
| 147 | +# Retrieve a record that was recently shadowed (its superseding record is now active): |
| 148 | +bash .claude/skills/recall/scripts/recall.sh "old topic" --include-shadowed --json |
| 149 | + |
| 150 | +# Retrieve all records including archived (to audit stale memories): |
| 151 | +bash .claude/skills/recall/scripts/recall.sh "power" --include-archived --include-shadowed --json |
| 152 | +``` |
| 153 | + |
| 154 | +## Notes |
| 155 | + |
| 156 | +- **Provenance is mandatory** on every hit — recall is for *cited* answers. |
| 157 | +- The embed endpoint defaults to the local model-gear embed gear |
| 158 | + (`http://localhost:8002/v1`, model `Qwen/Qwen3-Embedding-0.6B`); override with |
| 159 | + `EIDETIC_EMBED_URL` / `EIDETIC_EMBED_MODEL`. `exact`/`keyword` ignore it. |
| 160 | +- **Use the wrapper, not a bare `eidetic`.** The console script may not be on |
| 161 | + `PATH` (in a dev checkout it isn't) — the wrapper resolves it for you (`PATH` |
| 162 | + first, else `uv run eidetic`). For the docs, run `eidetic explain recall` if |
| 163 | + installed, otherwise `uv run --project <eidetic-cli checkout> eidetic explain |
| 164 | + recall`. (`explain` is an **`eidetic`** verb — a sibling tool like `devex` |
| 165 | + won't know it.) |
| 166 | +- **Reading scores:** `exact`, `keyword`, and `hybrid` drop non-matching records |
| 167 | + (hybrid drops any record with a `0.0` blended score), so their hits are real |
| 168 | + matches. `approximate` keeps every candidate ranked by raw cosine, so it can |
| 169 | + return low/near-zero scores when the store is small — lower `--top-k` to trim. |
| 170 | + A `--min-score` threshold is a tracked follow-up. |
| 171 | +- **Sharing scope = one OS user.** The default store is `~/.eidetic/memory`, so |
| 172 | + every agent/process running as the *same* OS user shares it (that is the point — |
| 173 | + Claude + colleague). It is not isolated between OS users by anything but file |
| 174 | + permissions; keep genuinely private data in a `--visibility private` scope and |
| 175 | + treat the host as the trust boundary. |
| 176 | + |
| 177 | +## Provenance |
| 178 | + |
| 179 | +First-party to **eidetic-cli** — eidetic owns its memory surface. Cite, don't |
| 180 | +import: downstream repos copy this skill, they don't symlink it. See |
| 181 | +[`docs/skill-sources.md`](../../../docs/skill-sources.md). |
0 commit comments