/tmem-cli
Inspect/manage the local memory store via the tmem CLI — counts, keyword/hybrid search, view persona, list/open scenes (tmem scene <name>), recent changes, sync vectors, thresholds, and cross-project search (tmem search <q> --all, tmem projects). Trigger on "how many memories",
$ npx -y skills add baodq97/tencentdb-agent-memory --skill tmem-cli --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/tmem-cli
Context preview
The summary Claude sees to decide when to auto-load this skill.
Inspect/manage the local memory store via the tmem CLI — counts, keyword/hybrid search, view persona, list/open scenes (tmem scene <name>), recent changes, sync vectors, thresholds, and cross-project search (tmem search <q> --all, tmem projects). Trigger on "how many memories",
SKILL.md
tmem-cli.SKILL.mdname: tmem-cli
description: Inspect/manage the local memory store via the tmem CLI — counts, keyword/hybrid search, view persona, list/open scenes (tmem scene <name>), recent changes, sync vectors, thresholds, and cross-project search (tmem search <q> --all, tmem projects). Trigger on "how many memories", "show my persona", "what scenes exist", "search memories for X", "search across all projects".
tmem CLI
`tmem` is the memory store's command-line tool. Run it via Bash.
Most-used
tmem status # counts + persona + scenes + capture state at a glance
tmem recall "<query>" # hybrid recall (FTS5 + vector + RRF) + L2 scene-navigation — exactly what the hook injects
tmem search "<query>" # fast FTS5 keyword search (no vectors)
tmem scene <name> # print ONE full scene block by name
tmem scenes list # list scene blocks (name, heat, updated, summary)
tmem persona # show the persona document
Scene navigation → on-demand read (progressive disclosure)
Each turn, recall injects a `<scene-navigation>` block: a heat-ranked **index** of scene blocks (name + heat + summary), project scenes first, then global. It does NOT inline full scene content. When a summary looks relevant, load the full block with:
tmem scene <name> # <name> is the index entry, e.g. implementation-progress
`tmem scene` resolves project-first, then global. Names also come from `tmem scenes list`.
Cross-project memory
Each project keys its own store by the project **root** (the nearest `.git` ancestor; a subdir or linked worktree maps to the SAME store). Recall and default `search` see only the current project + global. To explore memory ACROSS projects by hand:
tmem projects # discover every store: slug, #records, #scenes ( * = current )
tmem search "<query>" --all # search them all at once, grouped by store
tmem search "<query>" --project <slug> # target one other project's store
If `tmem projects` shows many near-duplicate slugs that are subdirs/worktrees of one repo (legacy fragmentation from before root-keying), collapse them with `tmem migrate-fragments` (dry-run first, then `--apply`).
Read / Inspect
| Command | When to use | |---------|-------------| | `tmem status` | Overview: record counts, vector counts, persona, scenes, capture state | | `tmem recall "<query>"` | Full hybrid recall + scene-navigation — same as what the hook injects each turn | | `tmem search "<query>"` | Find memories by keyword (FTS5) in global + current project | | `tmem search "<query>" --all` | Cross-project: search EVERY project store, grouped + labelled by store | | `tmem search "<query>" --project <slug>` | Search global + one named project store (slug from `tmem projects`) | | `tmem projects` | List every memory store (slug, #records, #scenes), `*` marks the current project | | `tmem scene <name>` | Print one full scene block (project-first, then global) | | `tmem scenes list` | List all scene blocks with metadata (heat, updated, summary) | | `tmem persona` | Read the current persona document | | `tmem changelog [--last N]` | The N most recent memory writes (default 20) | | `tmem atoms [global\|project\|all]` | Dump raw L1 atoms as JSON — use sparingly, output can be large |
Write / Manage
| Command | When to use | |---------|-------------| | `echo JSON \| tmem write-l1 --session ID` | Write extracted L1 atoms (used by memory-seed) | | `echo CONTENT \| tmem write-scene --name N --summary S --heat H` | Write/update a scene block (used by memory-consolidate) | | `echo CONTENT \| tmem write-persona` | Write persona (used by memory-consolidate) | | `tmem scenes dedup [--dry-run]` | Find/remove duplicate scenes by keyword overlap | | `tmem migrate-fragments [--apply]` | Collapse legacy cwd-keyed fragment stores into their project root. Dry-run by default; `--apply` merges records (id-deduped) + scenes (newer wins) and ARCHIVES each fragment under `<base>/.migrated/`. Run `tmem sync` afterwards to embed moved records. | | `tmem sync [--full]` | Embed missing vectors (delta); `--full` rebuilds the whole index from FTS5 | | `tmem config` | Show effective config + stored values + env overrides | | `tmem config consolidate-every [N]` | Get/set consolidation threshold (default 20) | | `tmem config scene-max-tokens [N]` | Get/set scene-navigation token budget (default 200; `0` disables) | | `tmem config recall [on\|off]` | Per-project: get/set whether the UserPromptSubmit hook injects memory context. `off` stops the per-turn `<memory-context>` for THIS project only; ingest + consolidate keep running. Default: on. | | `tmem daemon status` | Health-ping the resident embed daemon → ready/warming/failed/stuck/down + pid (use when vector recall seems cold) | | `tmem daemon start` | Warm + serve the embed daemon in the foreground (like `ollama serve`); keeps vector recall hot | | `tmem daemon stop` | Stop the daemon + clear its pidfile (recovery: `status` → `stop` → `start`) | | `tmem mark-done` | Mark consolidation complete + release lock | | `tmem init` | Initialize memory store (normally via `/memory-init`) |
Disable per-turn context injection (per project)
To stop the memory hook from injecting `<memory-context>` into the main thread every turn for the current project — while STILL capturing turns and consolidating in the background:
tmem config recall off # this project: hook injects nothing; ingest + consolidate unaffected
tmem config recall on # re-enable (default)
tmem config recall # show current state (on/off)
The flag is stored per project-root in `state.json` (`projects.<hash>.recall`). It's additive and fail-open: projects without the flag keep recall ON, so existing stores are unaffected. Manual `tmem recall "<query>"` still works regardless — only the automatic per-turn injection is gated.
Which binary runs?
`tmem` is symlinked t
Read more
name: tmem-cli description: Inspect/manage the local memory store via the tmem CLI — counts, keyword/hybrid search, view persona, list/open scenes (tmem scene <name>), recent changes, sync vectors, thresholds, and cross-project search (tmem search <q> --all, tmem projects). Trigger on "how many memories", "show my persona", "what scenes exist", "search memories for X", "search across all projects".
tmem CLI
`tmem` is the memory store's command-line tool. Run it via Bash.
Most-used
tmem status # counts + persona + scenes + capture state at a glance tmem recall "<query>" # hybrid recall (FTS5 + vector + RRF) + L2 scene-navigation — exactly what the hook injects tmem search "<query>" # fast FTS5 keyword search (no vectors) tmem scene <name> # print ONE full scene block by name tmem scenes list # list scene blocks (name, heat, updated, summary) tmem persona # show the persona document
Scene navigation → on-demand read (progressive disclosure)
Each turn, recall injects a `<scene-navigation>` block: a heat-ranked **index** of scene blocks (name + heat + summary), project scenes first, then global. It does NOT inline full scene content. When a summary looks relevant, load the full block with:
tmem scene <name> # <name> is the index entry, e.g. implementation-progress
`tmem scene` resolves project-first, then global. Names also come from `tmem scenes list`.
Cross-project memory
Each project keys its own store by the project **root** (the nearest `.git` ancestor; a subdir or linked worktree maps to the SAME store). Recall and default `search` see only the current project + global. To explore memory ACROSS projects by hand:
tmem projects # discover every store: slug, #records, #scenes ( * = current ) tmem search "<query>" --all # search them all at once, grouped by store tmem search "<query>" --project <slug> # target one other project's store
If `tmem projects` shows many near-duplicate slugs that are subdirs/worktrees of one repo (legacy fragmentation from before root-keying), collapse them with `tmem migrate-fragments` (dry-run first, then `--apply`).
Read / Inspect
| Command | When to use | |---------|-------------| | `tmem status` | Overview: record counts, vector counts, persona, scenes, capture state | | `tmem recall "<query>"` | Full hybrid recall + scene-navigation — same as what the hook injects each turn | | `tmem search "<query>"` | Find memories by keyword (FTS5) in global + current project | | `tmem search "<query>" --all` | Cross-project: search EVERY project store, grouped + labelled by store | | `tmem search "<query>" --project <slug>` | Search global + one named project store (slug from `tmem projects`) | | `tmem projects` | List every memory store (slug, #records, #scenes), `*` marks the current project | | `tmem scene <name>` | Print one full scene block (project-first, then global) | | `tmem scenes list` | List all scene blocks with metadata (heat, updated, summary) | | `tmem persona` | Read the current persona document | | `tmem changelog [--last N]` | The N most recent memory writes (default 20) | | `tmem atoms [global\|project\|all]` | Dump raw L1 atoms as JSON — use sparingly, output can be large |
Write / Manage
| Command | When to use | |---------|-------------| | `echo JSON \| tmem write-l1 --session ID` | Write extracted L1 atoms (used by memory-seed) | | `echo CONTENT \| tmem write-scene --name N --summary S --heat H` | Write/update a scene block (used by memory-consolidate) | | `echo CONTENT \| tmem write-persona` | Write persona (used by memory-consolidate) | | `tmem scenes dedup [--dry-run]` | Find/remove duplicate scenes by keyword overlap | | `tmem migrate-fragments [--apply]` | Collapse legacy cwd-keyed fragment stores into their project root. Dry-run by default; `--apply` merges records (id-deduped) + scenes (newer wins) and ARCHIVES each fragment under `<base>/.migrated/`. Run `tmem sync` afterwards to embed moved records. | | `tmem sync [--full]` | Embed missing vectors (delta); `--full` rebuilds the whole index from FTS5 | | `tmem config` | Show effective config + stored values + env overrides | | `tmem config consolidate-every [N]` | Get/set consolidation threshold (default 20) | | `tmem config scene-max-tokens [N]` | Get/set scene-navigation token budget (default 200; `0` disables) | | `tmem config recall [on\|off]` | Per-project: get/set whether the UserPromptSubmit hook injects memory context. `off` stops the per-turn `<memory-context>` for THIS project only; ingest + consolidate keep running. Default: on. | | `tmem daemon status` | Health-ping the resident embed daemon → ready/warming/failed/stuck/down + pid (use when vector recall seems cold) | | `tmem daemon start` | Warm + serve the embed daemon in the foreground (like `ollama serve`); keeps vector recall hot | | `tmem daemon stop` | Stop the daemon + clear its pidfile (recovery: `status` → `stop` → `start`) | | `tmem mark-done` | Mark consolidation complete + release lock | | `tmem init` | Initialize memory store (normally via `/memory-init`) |
Disable per-turn context injection (per project)
To stop the memory hook from injecting `<memory-context>` into the main thread every turn for the current project — while STILL capturing turns and consolidating in the background:
tmem config recall off # this project: hook injects nothing; ingest + consolidate unaffected tmem config recall on # re-enable (default) tmem config recall # show current state (on/off)
The flag is stored per project-root in `state.json` (`projects.<hash>.recall`). It's additive and fail-open: projects without the flag keep recall ON, so existing stores are unaffected. Manual `tmem recall "<query>"` still works regardless — only the automatic per-turn injection is gated.
Which binary runs?
`tmem` is symlinked t
Showing the first part of this file.
Four-layer long-term memory (L0 Conversation → L1 Atom → L2 Scene → L3 Persona) for Claude Code, inspired by Tencent/TencentDB-Agent-Memory. Fully local — no external Gateway, no paid API, no Python.
Repo: baodq97/tencentdb-agent-memory
Other skills on tencentdb-agent-memory.
- /contrib-consolidate
Internal phase — consolidate a contributor's L1 atoms into an L3 persona (11 dimensions). Invoked by contrib-profile / `/contrib build`.
Open skill - /contrib-ingest
Internal phase — extract L1 contributor atoms from a GitHub subject's raw activity. Invoked by contrib-profile / `/contrib ingest`.
Open skill - /contrib-profile
Orchestrator for Contributor Intelligence. Trigger when the user pastes a GitHub profile/repo URL or handle and asks to profile, analyze, learn from, or study an engineer (EN/VI — "phân tích người này", "học từ người này"). Runs add→ingest→build→playbook end-to-end via the
Open skill - /contrib-synthesize
Internal phase — synthesize learnable playbooks, cross-engineer common capabilities, and you-vs-role-model comparisons from built personas. Invoked by contrib-profile / `/contrib playbook|compare`.
Open skill - /memory-consolidate
Consolidate L1 memory atoms into L2 scene blocks and L3 persona. Invoked by the memory-consolidator agent, or manually via /memory-consolidate.
Open skill - /memory-seed
Extract L1 memory atoms from Claude Code conversation history. Run manually via /memory-seed.
Open skill

