musememory 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +512 -0
  3. package/dist/index.js +25177 -0
  4. package/package.json +52 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Harsh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,512 @@
1
+ # <h1> ๐Ÿง  Muse Memory</h1>
2
+
3
+ <div align="center">
4
+
5
+ ![GitHub Release](https://img.shields.io/github/v/release/harshsinghmp/musememory?style=for-the-badge&logo=github&color=blue)
6
+ ![NPM Version](https://img.shields.io/npm/v/musememory?style=for-the-badge&logo=npm&color=red)
7
+ ![Bun](https://img.shields.io/badge/Bun-1.3.14-black?style=for-the-badge&logo=bun)
8
+ ![MCP](https://img.shields.io/badge/MCP-2024--11--05-green?style=for-the-badge&logo=anthropic)
9
+ ![CI Tests](https://img.shields.io/badge/Tests-128%20Passed-brightgreen?style=for-the-badge&logo=checkmarx)
10
+ ![Docker Ready](https://img.shields.io/badge/Docker-Ready-2496ED?style=for-the-badge&logo=docker)
11
+ ![License](https://img.shields.io/badge/License-MIT-purple?style=for-the-badge)
12
+
13
+ **Autonomous, Self-Organizing Cognitive Memory System for AI Agents & Agency Networks**
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## ๐Ÿ’ก What is Muse Memory? (TL;DR)
20
+
21
+ Most AI chatbots and coding assistants have **"goldfish memory"**: every time you close a chat and start a new one, they forget everything about your project, your habits, and the bugs you solved yesterday.
22
+
23
+ **Muse Memory gives your AI assistants a persistent, self-organizing notebook directly on your machine.**
24
+
25
+ - ๐Ÿ‘ค **Remembers You (`USER.md`)**: Configures your role (developer, designer, marketer, casual) and communication preferences so the AI speaks your language.
26
+ - ๐Ÿ“ **Remembers Project Rules (`CURRENT.md`)**: Injects active hard constraints and open loops so agents never break established invariants.
27
+ - ๐Ÿง  **Learns As You Build**: Automatically captures bug workarounds and architectural decisions, feeding only relevant notes back into future sessions.
28
+ - ๐Ÿ”Œ **Auto-Connects to 80+ AI Tools**: Single-command setup (`npx musememory install`) wires Claude Code, Cursor, Windsurf, Hermes, OpenCode, and more.
29
+ - ๐Ÿ›ก๏ธ **100% Private & Daemon-Free**: Pure file-backed storage (`.memory/`) with built-in secret scrubbing (Vibeguard) that prevents API keys or passwords from ever being saved.
30
+
31
+ ---
32
+
33
+ ## โšก Architecture & Dual-Scope Storage
34
+
35
+ - **Primary Command**: `**memory**` (alias: `musememory` or `**npx musememory**`)
36
+ - **Zero-Install NPX Execution**: Run directly with `npx musememory <cmd>` or `bunx musememory <cmd>` without needing `npm i -g`.
37
+ - **Local Workspace Storage**: `.memory/` (automatically detected in your project root; `.musememory/` supported for backward compatibility)
38
+ - **Global System Storage**: `~/.memory/` (available across all directories or explicitly with `--global` / `-g`)
39
+ - **Smart Agent Auto-Detection & Clean Connect**: Probes workstation for 80+ coding agents (Claude Code, Cursor, Hermes Agent, OpenCode, OpenClaw, Codex, Gemini, Goose, Continue, Cline, Roo, Pi, Crush, etc.) and wires **ONLY installed agents**, skipping uninstalled ones to keep workspaces clean without generating unneeded folders.
40
+ - **Universal Provider Auto-Detection & Migration**: Auto-detects existing memory stores across 24+ formats (`memory detect` / `memory migrate`) with strict state preservation (active โž” confirmed, archived โž” superseded, core constraints โž” `CURRENT.md`).
41
+ - **Dynamic Prompt Token Budgeter**: Exact token packing (`--token-budget <N>` / `token_budget` in MCP) for zero-bloat prompt injection.
42
+ - **Universal Transcript Ingestion**: Ingest raw `.jsonl` conversation transcripts (`memory import-transcript <file.jsonl>`) from Claude Code, Antigravity, Cursor, and Codex.
43
+ - **Operational Audit Ledger**: Append-only compliance log (`.memory/audit.jsonl` / `memory audit`) tracking all memory mutations.
44
+
45
+ ---
46
+
47
+ ## ๐Ÿš€ Quick Start & Installation
48
+
49
+ > [!TIP]
50
+ >
51
+ > ### โšก Instant 5-Second Setup (Zero-Install NPX / BunX)
52
+ >
53
+ > **No global installation required. No package clutter.** Set up your memory system and wire your AI agents with a single command:
54
+ >
55
+ > ```bash
56
+ > npx musememory install
57
+ > # (or with Bun: bunx musememory install)
58
+ > ```
59
+ >
60
+ > This one command:
61
+ >
62
+ > 1. Initializes `.memory/` and `CURRENT.md` in your project folder (or `~/.memory/` with `--global`).
63
+ > 2. Auto-detects all installed AI coding agents (Claude Code, Cursor, Antigravity, Windsurf, Codex, Gemini CLI, Hermes Agent, OpenCode, OpenClaw, etc.).
64
+ > 3. Auto-wires the memory MCP server into installed agents with zero-permission auto-approval.
65
+ > 4. Scans for existing memory stores (AgentMemory, Supermemory, Beads, Mem0, etc.) for instant migration.
66
+ >
67
+ > **Verify anytime**: `npx musememory doctor`
68
+ > **Query memories**: `npx musememory briefing` or `npx musememory search "auth"`
69
+
70
+ ---
71
+
72
+ ### ๐Ÿ“ฆ Persistent Installation Options
73
+
74
+ ```bash
75
+ # Option A: Global Install with NPM or Bun (Recommended)
76
+ npm install -g musememory
77
+ # or with Bun:
78
+ bun add -g musememory
79
+
80
+ # Option B: One-Line Shell Installer
81
+ curl -fsSL https://raw.githubusercontent.com/harshsinghmp/musememory/main/scripts/install.sh | bash
82
+
83
+ # Option C: Docker Container
84
+ git clone https://github.com/harshsinghmp/musememory.git && cd musememory
85
+ docker build -t musememory .
86
+ ```
87
+
88
+ Once installed, you can run `memory` anywhere:
89
+ ```bash
90
+ memory install # One-line full workspace & agent configuration
91
+ memory doctor # Comprehensive system health check
92
+ memory connect --all # Auto-wire all detected AI coding agents
93
+ memory briefing # Summarize active knowledge & constraints
94
+ ```
95
+
96
+ ---
97
+
98
+ ## ๐Ÿ”„ Complete NPX Lifecycle (Install โ†’ Verify โ†’ Uninstall)
99
+
100
+ Every command below works with **zero installation** via `npx musememory <cmd>` (or `bunx musememory <cmd>`). Swap in plain `memory <cmd>` if you did a global install.
101
+
102
+ ### 1๏ธโƒฃ Install & Auto-Wire
103
+
104
+ ```bash
105
+ # Full setup: init .memory/, detect agents, wire MCP, scan for migratable stores
106
+ npx musememory install
107
+
108
+ # Initialize a workspace only (no agent wiring)
109
+ npx musememory init
110
+ ```
111
+
112
+ ### 2๏ธโƒฃ Verify Installation
113
+
114
+ ```bash
115
+ # Ecosystem health diagnostic (storage, agents, MCP wiring)
116
+ npx musememory doctor
117
+
118
+ # Smoke-test the store
119
+ npx musememory stats
120
+ npx musememory briefing
121
+ ```
122
+
123
+ ### 3๏ธโƒฃ Connect Agents
124
+
125
+ ```bash
126
+ # Scan workstation for 80+ coding agents
127
+ npx musememory agents
128
+
129
+ # Auto-wire all detected agents (zero permissions)
130
+ npx musememory connect all
131
+
132
+ # Wire one specific agent
133
+ npx musememory connect claude-code
134
+
135
+ # Re-wire / repair configs that were edited or deleted
136
+ npx musememory connect all --force
137
+ ```
138
+
139
+ ### 4๏ธโƒฃ Uninstall (Clean Removal)
140
+
141
+ ```bash
142
+ # Preview what would be unwired
143
+ npx musememory uninstall --dry-run
144
+
145
+ # Unwire MCP from all agents (keeps .memory/ data)
146
+ npx musememory uninstall
147
+
148
+ # Unwire AND purge project .memory/ data
149
+ npx musememory uninstall --purge
150
+
151
+ # Remove a persistent global install (if you used Option A above)
152
+ npm uninstall -g musememory # or: bun remove -g musememory
153
+ rm -f ~/.local/bin/memory ~/.local/bin/musememory
154
+ ```
155
+
156
+ ### ๐Ÿ› ๏ธ Troubleshooting
157
+
158
+ | Symptom | Check | Fix |
159
+ |---|---|---|
160
+ | `command not found: memory` | You skipped global install, or `~/.local/bin` is not on PATH | Use `npx musememory <cmd>` instead, or add `~/.local/bin` to PATH |
161
+ | `npx` hangs or prompts to install | Package not cached yet | Confirm prompt with `y`, or pre-install: `npm install -g musememory` |
162
+ | Bun vs npm mismatch / broken binary | `which memory` points at stale symlink | `rm -f ~/.local/bin/memory ~/.local/bin/musememory`, reinstall via npm/bun |
163
+ | Agent doesn't show the MCP server | Run `npx musememory doctor` and re-check agent config | `npx musememory connect <agent> --force` to rewrite config |
164
+ | MCP configured but tools missing | Agent session started before wiring | Restart the agent session so it reloads MCP config |
165
+ | Permission errors during connect/uninstall | Config files owned by another user | Fix ownership of the agent config dir, then retry |
166
+ | Store seems empty / wrong scope | You may be in a subdirectory; root detection walks up | Run from project root, or set an explicit dir: `npx musememory stats <dir>` |
167
+ | Stale/partial install after upgrade | Old dist cached by npx | Clear npx cache (`npx clear-npx-cache`) or reinstall globally |
168
+
169
+ ---
170
+
171
+ ### Step 2: 100% Permission-Free Multi-Agent Connect
172
+
173
+ Muse Memory scans your workstation for 80+ coding agents (Claude Code, Cursor, Hermes Agent, OpenCode, OpenClaw, Codex CLI, Gemini CLI, Goose, Continue, Cline, Roo Code, Pi, Crush, etc.) and auto-wires MCP into **only installed agents**, skipping uninstalled ones to keep your filesystem clean:
174
+
175
+ ```bash
176
+ # 1. Scan your workstation for 80+ coding agents
177
+ memory agents
178
+
179
+ # 2. Auto-wire all installed agents with zero-permission auto-approval
180
+ memory connect --all
181
+
182
+ # 3. Or wire a specific agent explicitly
183
+ memory connect claude-code # Auto-approves tools in ~/.claude/settings.json
184
+ memory connect cursor # Auto-approves memory in ~/.cursor/mcp.json
185
+ memory connect hermes # Auto-wires MCP in ~/.hermes/config.yaml
186
+ memory connect opencode # Auto-wires local MCP in ~/.config/opencode/opencode.json
187
+ memory connect openclaw # Auto-wires MCP in ~/.openclaw/openclaw.json
188
+ memory connect antigravity # Configures Antigravity CLI MCP
189
+ memory connect windsurf # Configures Windsurf MCP config
190
+ memory connect codex # Configures Codex CLI MCP
191
+ memory connect gemini-cli # Configures Gemini CLI MCP
192
+ ```
193
+
194
+ #### ๐Ÿ”น Manual MCP Configuration (Alternative):
195
+
196
+ ```json
197
+ {
198
+ "mcpServers": {
199
+ "memory": {
200
+ "command": "memory",
201
+ "args": ["mcp"]
202
+ }
203
+ }
204
+ }
205
+ ```
206
+
207
+ ---
208
+
209
+ ### Step 3: Zero-Setup Universal Workspace &amp; Global Memory
210
+
211
+ **Do I need to start Muse Memory manually?**
212
+
213
+ > **No!** When configured in your MCP settings, your AI IDE / Agent **automatically launches Muse Memory as a background subprocess on agent launch** and stops it when closed. You do not need to run any manual background server or database daemon.
214
+
215
+ Whenever your AI Agent starts in *any* project folder:
216
+
217
+ 1. `memory` automatically detects or creates a `.memory/` folder in your project (or falls back to `~/.memory/` globally).
218
+ 2. The AI agent automatically retrieves relevant past fixes and constraints (`get_context`, `memory_recall`).
219
+ 3. When the AI solves a bug or makes an architectural decision, it distills it into an atomic memory entry (`memory_harvest`, `memory_capture`).
220
+ 4. You can check what your agents know anytime from your terminal:
221
+ ```bash
222
+ memory briefing
223
+ memory search "authentication redirect"
224
+
225
+ # Or view global memories
226
+ memory --global briefing
227
+ ```
228
+
229
+ ---
230
+
231
+ ## ๐ŸŒ Built-In Visual Dashboard (`memory ui`)
232
+
233
+ Muse Memory includes a **100% self-contained, zero-dependency visual graph inspector**:
234
+
235
+ ```bash
236
+ memory ui
237
+ # or specify a custom port
238
+ memory ui --port 3000
239
+ ```
240
+
241
+ Open `http://localhost:3000` in your browser to:
242
+
243
+ - ๐Ÿ•ธ๏ธ Explore the **interactive 2D knowledge graph** connecting decisions, failures, fixes, and dependencies.
244
+ - ๐Ÿ” Live search and filter memory units by type (`fix`, `decision`, `constraint`, `failure`) and verification level.
245
+ - ๐Ÿšฆ Inspect staleness heatmaps and confirm candidate memories with a single click.
246
+
247
+ ---
248
+
249
+ ## โšก How Memory Grows, Reloads &amp; Auto-Archives
250
+
251
+ ```mermaid
252
+ flowchart TD
253
+ subgraph HotPath["Active Conversation (Hot Path)"]
254
+ User["User asks question / gives task"]
255
+ Agent["AI Agent executes turn"]
256
+ Recall["1. Auto-Retrieve Top-K Context & Active Constraints"]
257
+ Distill["2. Auto-Distill Fixes & Decisions (Harvest)"]
258
+ end
259
+
260
+ subgraph DefenseGate["Self-Contained Vibeguard"]
261
+ Scan["3. Zero-Leakage Secret Scan (Blocks API keys & DB URLs)"]
262
+ end
263
+
264
+ subgraph StoreLifecycle["Self-Organizing Knowledge Engine (.memory/)"]
265
+ Atomic["4. Atomic Write (m_timestamp_slug.yaml)"]
266
+ Lifecycle["5. Lifecycle Transitions (Candidate โž” Confirmed โž” Superseded)"]
267
+ Decay["6. Temporal Staleness Decay & Auto-Archiving"]
268
+ end
269
+
270
+ User --> Agent
271
+ Agent --> Recall
272
+ Recall --> Agent
273
+ Agent --> Distill
274
+ Distill --> Scan
275
+ Scan --> Atomic
276
+ Atomic --> Lifecycle
277
+ Lifecycle --> Decay
278
+ ```
279
+
280
+ - **Incremental Auto-Growing**: Every decision, bug fix, operational rule, and session checkpoint is saved as a discrete, human-readable YAML document in `.memory/memories/`.
281
+ - **Context Reload Continuity**: On a fresh turn or session restart, `get_context` feeds only the Top-$K$ highest-salience, verified knowledge unitsโ€”reducing context tokens by **85โ€“95%** and eliminating outdated hallucinations.
282
+ - **Smart Archiving &amp; Controlled Forgetting**: Old approaches are marked `superseded` with explicit forward/backward links. Time-based staleness policies (e.g. 30 days for temporary discoveries, 90 days for fixes, 365 days for architecture) automatically down-weight decaying knowledge.
283
+
284
+ ---
285
+
286
+ ## ๐Ÿ‘ค User Persona & Preferences (`USER.md`) & Setup Wizard
287
+
288
+ Muse Memory maintains a persistent user profile (`~/.memory/USER.md` globally, or `.memory/USER.md` locally) to ground AI agents in your working style, communication preferences, and toolchain rules.
289
+
290
+ ### ๐ŸŽญ 5 Zero-Fingerprint Role Archetypes
291
+
292
+ When running `memory install`, an interactive setup wizard configures your primary archetype (or choose one manually anytime):
293
+
294
+ 1. **`developer`** (Default): Code-first, direct, concise, runnable diffs, strict types, fail-fast mechanics.
295
+ 2. **`designer`**: Visual hierarchy, CSS/Tailwind systems, GSAP animations, WCAG accessibility, Figma/tokens design tokens.
296
+ 3. **`marketer`**: Conversion-rate optimization (CRO), punchy benefit-driven copy, SEO clustering, audience hooks.
297
+ 4. **`casual`**: Plain English, jargon-free explanations, step-by-step guidance.
298
+ 5. **`custom`**: Clean blank template ready for personalized instructions.
299
+
300
+ ```bash
301
+ # View active profile
302
+ memory user get
303
+
304
+ # Initialize with a specific archetype
305
+ memory user init developer
306
+ memory user init designer --global
307
+
308
+ # Update user profile
309
+ memory user set "- Prefers TypeScript, Bun, and ultra terse responses"
310
+ ```
311
+
312
+ ### ๐Ÿง  Prompt Injection Hierarchy & Proactive Self-Nudge
313
+ When `get_context` or `formatPromptContext()` builds the LLM prompt context, it structures information deterministically:
314
+ 1. **`### User Profile & Preferences (USER.md)`** (Tone, role, rules)
315
+ 2. **`### Active Working Constraints (CURRENT.md)`** (Project invariants & open loops)
316
+ 3. **`### Relevant Memories & Learned Patterns`** (Top-$K$ ranked memories)
317
+ 4. **`*Memory Directive: When learning durable facts, bug resolutions, or user preferences, call memory_capture immediately.*`**
318
+
319
+ ---
320
+
321
+ ## ๐Ÿ“œ Full-Text Transcript Search with Conversation Bookends
322
+
323
+ Search across past `.jsonl` transcripts (Claude Code, Cursor, Antigravity, Codex) with surrounding dialogue context windows and session start/end bookends:
324
+
325
+ ```bash
326
+ # Search transcript with dialogue window
327
+ memory search-transcript "database connection pooling" session.jsonl --window 2 --max 5
328
+ ```
329
+
330
+ ---
331
+
332
+ ## ๐Ÿ›ก๏ธ Built-In Vibeguard Secret Defense (Zero External Dependencies)
333
+
334
+ `musememory` includes a pure TypeScript, zero-dependency security scanner that protects your repositories:
335
+
336
+ - **Zero-Leakage Guarantee**: Intercepts OpenAI/Anthropic keys (`sk-*`), GitHub tokens (`ghp_*`), NPM tokens, AWS access keys (`AKIA*`), private key blocks, database connection strings, and plaintext credentials before they can ever be written to disk.
337
+ - **100% Standalone**: Does not require any external scripts or system installations.
338
+
339
+ ---
340
+
341
+ ## ๐Ÿ”ฎ Scope of Work & Roadmap
342
+
343
+ Every Scope-of-Work item is tracked as a GitHub issue and delivered via pull request. Status: โ˜ planned ยท โ— in progress ยท โœ… done. Live status: [issue tracker](https://github.com/harshsinghmp/musememory/issues).
344
+
345
+ | Status | Item | Tracker |
346
+ | :--- | :--- | :--- |
347
+ | โœ… | Dynamic Prompt Token Budgeter (`--token-budget N`) โ€” knapsack packing under hard token ceilings | shipped v1.1.0 |
348
+ | โœ… | Scene-Based Hierarchical Consolidation (`memory consolidate`) | [#1](https://github.com/harshsinghmp/musememory/issues/1) |
349
+ | โœ… | Autonomous Verification Oracle (`memory verify <id>`) | [#2](https://github.com/harshsinghmp/musememory/issues/2) |
350
+ | โœ… | Multi-Hop Causality Graph Tracer (`memory trace <id>`) | [#3](https://github.com/harshsinghmp/musememory/issues/3) |
351
+ | โœ… | In-Place Core Memory Partitioning (`memory core`) | [#4](https://github.com/harshsinghmp/musememory/issues/4) |
352
+ | โœ… | Automated Post-Turn Transcript Harvester Hook | [#5](https://github.com/harshsinghmp/musememory/issues/5) |
353
+ | โœ… | Real-Time Agency WebSocket Hub (`memory daemon`) | [#6](https://github.com/harshsinghmp/musememory/issues/6) |
354
+ | โœ… | Local Offline Hybrid Vector Engine | [#7](https://github.com/harshsinghmp/musememory/issues/7) |
355
+ | โœ… | Delete Deprecated `MemoryStore` Shim *(target: October 2026)* | [#8](https://github.com/harshsinghmp/musememory/issues/8) |
356
+ | โœ… | Self-Evolving Skill Distillation | [#9](https://github.com/harshsinghmp/musememory/issues/9) |
357
+ | โœ… | 3-Layer Progressive Disclosure | [#10](https://github.com/harshsinghmp/musememory/issues/10) |
358
+ | โœ… | Bi-Temporal Reinforcement Feedback | [#11](https://github.com/harshsinghmp/musememory/issues/11) |
359
+ | โœ… | Ambient Open-Loop Tracker | [#12](https://github.com/harshsinghmp/musememory/issues/12) |
360
+ | โœ… | Knowledge Graph UI v2 | [#13](https://github.com/harshsinghmp/musememory/issues/13) |
361
+ | โœ… | Proactive Nudges & Check-ins (`memory nudge`) โ€” SOW-101 | [#28](https://github.com/harshsinghmp/musememory/issues/28) |
362
+ | โœ… | Daily Briefing & Routines Scheduler (cron-invoked, no daemon) โ€” SOW-102 | [#29](https://github.com/harshsinghmp/musememory/issues/29) |
363
+ | โœ… | Open-Loop / Task Extraction from Transcripts โ€” SOW-103 | [#30](https://github.com/harshsinghmp/musememory/issues/30) |
364
+ | โœ… | Calendar / Time-Aware Follow-ups (`due_at` / `expires_at`) โ€” SOW-104 | [#31](https://github.com/harshsinghmp/musememory/issues/31) |
365
+ | โœ… | muse-agents โ†” musememory Integration Contract (`--for-agent`) โ€” SOW-106 | [#33](https://github.com/harshsinghmp/musememory/issues/33) |
366
+
367
+ ---
368
+
369
+ ## ๐Ÿ’ป CLI Command Reference
370
+
371
+ ```bash
372
+ memory <command> [arguments] [flags] # alias: musememory
373
+ ```
374
+
375
+ | Command | Arguments / Flags | Description |
376
+ | :------------------- | :------------------------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------- |
377
+ | `install` | `[path] [--global]` | **One-line complete setup**: initializes `.memory/`, `USER.md` profile, and auto-wires all detected coding agents. |
378
+ | `doctor` | `[path] [--global]` | **System diagnostic**: health check for storage, YAML schemas, secrets, MCP connectivity, and audit ledger. |
379
+ | `uninstall` | `[agent] [--purge] [--dry-run]` | **Clean uninstaller**: unwires MCP configuration from coding agents (and optionally purges `.memory/`). |
380
+ | `init` | `[path] [--legacy] [--global]` | Initialize `.memory/` directory (or global `~/.memory/`). Auto-detects existing memories. |
381
+ | `user` | `[get\|init\|set] [args] [--global]` | Manage `USER.md` persona & preferences across 5 clean archetypes (`developer`, `designer`, `marketer`, etc.). |
382
+ | `connect` | `[agent] [--all] [--force] [--dry-run]` | Auto-wire MCP server into detected installed agents (skipping uninstalled ones to keep files clean). |
383
+ | `agents` | *(none)* | Scan machine for 80+ coding agents (Claude Code, Cursor, Hermes, OpenCode, OpenClaw, Codex, etc.). |
384
+ | `detect` | *(none)* | Scan workstation and local workspace for existing memory systems across 24+ formats. |
385
+ | `migrate` | `[--from P] [--all] [--dry-run] [--overwrite] [--project P]` | Auto-detect and migrate memories into Muse Memory preserving active/archived state & secrets. |
386
+ | `ui` | `[--port N] [--global]` | Launch zero-dependency visual knowledge graph dashboard. |
387
+ | `context` | `[query] [--limit N] [--token-budget N] [--project P] [--type T] [--status S] [--verified] [--global]` | Retrieve Top-$K$ ranked active context (with token budget limit). |
388
+ | `search` | `<query> [--limit N] [--token-budget N] [--include-superseded] [--type T] [--status S] [--global]` | Ranked token search with scores and status indicators. |
389
+ | `search-transcript` | `<query> [file.jsonl] [--window N] [--max N]` | Search transcript with dialogue context window and start/end conversation bookends. |
390
+ | `harvest` | `<text\|file> --project P [--confirmed] [--global]` | Distill raw text/transcripts into structured outcome/fix memory units. |
391
+ | `import-transcript` | `<file.jsonl\|text> [--project P] [--confirmed] [--global]` | Ingest `.jsonl` session transcript from Claude Code / Antigravity / Cursor into memories (alias: `import-jsonl`). |
392
+ | `capture` | `<text> --project P [--title T] [--tags a,b] [--type T] [--confirmed] [--global]` | Fast proposal with inline zero-leakage secret scan. |
393
+ | `propose` | `<text> --project P [--title T] [--tags a,b] [--type T] [--confirmed] [--global]` | Create a candidate memory entry. |
394
+ | `recall` | `<query> [--limit N] [--token-budget N] [--project P] [--type T] [--status S] [--verified] [--global]` | Rich recall displaying verification levels and related graph links. |
395
+ | `confirm` | `<id> [--global]` | Promote `candidate`, `disputed`, or `stale` entry to `confirmed`. |
396
+ | `supersede` | `<old_id> --with <new_id> [--global]` | Mark old entry superseded by new confirmed entry. |
397
+ | `mark-stale` | `<id> [--reason <text>] [--global]` | Mark an entry stale and append deprecation reason. |
398
+ | `reject` | `<id> [--global]` | Mark an entry rejected. |
399
+ | `delete` | `<id> [--reason <text>] [--global]` | Permanently delete a memory entry and record audit event. |
400
+ | `audit` | `[--operation OP] [--entry-id ID] [--limit N] [--global]` | Query append-only operational audit trail (`.memory/audit.jsonl`). |
401
+ | `link` | `<id> --related <id1,id2> [--global]` | Synchronize bidirectional relation links between entries. |
402
+ | `export` | `[--out <file.json>] [--global]` | Export memory snapshot for agency network sync. |
403
+ | `import` | `<file.json> [--overwrite] [--global]` | Import and validate memory snapshot into local store. |
404
+ | `list` / `ls` | `[--status S] [--type T] [--project P] [--global]` | List memory entries with multi-field status, type, and project filtering. |
405
+ | `stats` | `[--global]` | Display breakdown statistics of total memories, status distribution, and type metrics. |
406
+ | `briefing` | `[--limit N] [--global]` | Active summary of recent entries, status counts, and due/overdue items. |
407
+ | `nudge` | `[--global]` | Proactive attention list: overdue/due-soon entries, stale-by-policy, open loops (exit code = nudge count). |
408
+ | `routine` | `run <name>` / `install [name]` | Execute `.memory/routines.yaml` steps or print crontab lines (cron-invoked, no daemon). |
409
+ | `stale` | `[--days N] [--global]` | Audit active entries exceeding per-type staleness policies. |
410
+ | `session` | `start --project P [--note T]` / `end <id>` | Record session start/end timeline nodes. |
411
+ | `current` | `get` / `set <text> --project P` | Read or append hard constraints to `.memory/CURRENT.md`. |
412
+ | `graph` | `status` | Query active CodeGraph provider status. |
413
+ | `mcp` | *(none)* | Start stdio MCP server. |
414
+
415
+
416
+ ---
417
+
418
+ ## ๐Ÿ”Œ MCP Server Tools
419
+
420
+ When registered as an MCP server, `musememory` exposes the following tools to any AI model:
421
+
422
+
423
+ | MCP Tool | Description |
424
+ | :-------------------------- | :--------------------------------------------------------------------------------------------------- |
425
+ | `get_context` | Fetches Top-$K$ ranked memories tailored for active prompt injection with optional `token_budget`. |
426
+ | `search` | Searches memory units with query, token budget, project, type, and verification filters. |
427
+ | `memory_get_user_profile` | Reads the active user persona and preferences (`USER.md`). |
428
+ | `memory_set_user_profile` | Updates `USER.md` persona and preferences with inline secret defense. |
429
+ | `memory_search_transcripts` | Full-text search over past `.jsonl` transcripts with conversation bookends and context window. |
430
+ | `memory_detect_agents` | Scans machine for 80+ coding agents (Claude Code, Cursor, Hermes, OpenCode, OpenClaw, Codex, etc.). |
431
+ | `memory_connect` | Auto-wires MCP into installed agents or a specified agent with zero permissions. |
432
+ | `memory_detect_providers` | Scans workspace and machine for external memory formats (24+ providers). |
433
+ | `memory_migrate` | Migrates memories from detected providers with state preservation and secret scrubbing. |
434
+ | `memory_harvest` | Distills conversation turns into structured fix/outcome units. |
435
+ | `memory_import_transcript` | Ingests JSONL transcripts into structured memory units. |
436
+ | `memory_capture` | Saves memory with strict inline secret scanning. |
437
+ | `memory_recall` | Rich inspection of knowledge units, verification, relations, and token budgeting. |
438
+ | `memory_confirm` | Promotes candidate or stale memories to confirmed status. |
439
+ | `memory_supersede` | Supersedes outdated knowledge with a confirmed target. |
440
+ | `memory_link` | Connects related memory units bidirectionally. |
441
+ | `memory_mark_stale` | Flags decaying knowledge units. |
442
+ | `memory_reject` | Marks rejected or refuted hypotheses. |
443
+ | `memory_delete` | Permanently deletes a memory unit and logs audit record. |
444
+ | `memory_audit` | Queries the append-only operational audit ledger. |
445
+ | `memory_export` | Exports full memory snapshot JSON. |
446
+ | `memory_import` | Imports validated memories from a snapshot. |
447
+ | `memory_validate` | Audits store integrity and detects credential leaks. |
448
+ | `graph_status` | Inspects CodeGraph AST integration status. |
449
+
450
+
451
+ ---
452
+
453
+ ## ๐Ÿงน Uninstallation & Complete Cleanup
454
+
455
+ If you wish to export your knowledge base, unwire MCP connections, or completely remove Muse Memory from your machine:
456
+
457
+ ### Step 1: Export Your Memories (Recommended Backup)
458
+ Export a portable JSON snapshot before removing data:
459
+ ```bash
460
+ # Export local workspace memories
461
+ memory export --out my-memories-backup.json
462
+
463
+ # Or export global system memories
464
+ memory export --global --out global-memories-backup.json
465
+ ```
466
+
467
+ ### Step 2: Unwire MCP from Coding Agents
468
+ Unwire the Muse Memory MCP server from all configured AI coding agents (Claude Code, Cursor, Hermes, OpenCode, Codex, etc.):
469
+ ```bash
470
+ # Dry-run inspection
471
+ memory uninstall --dry-run
472
+
473
+ # Unwire MCP configurations without touching memory files
474
+ memory uninstall
475
+
476
+ # Unwire a specific agent only
477
+ memory uninstall claude-code
478
+ ```
479
+
480
+ ### Step 3: Complete Removal & Data Purge
481
+ ```bash
482
+ # Unwire MCP agents AND purge the project .memory/ directory
483
+ memory uninstall --purge
484
+
485
+ # Remove storage directories
486
+ rm -rf .memory/ # Local workspace store
487
+ rm -rf ~/.memory/ # Global system store
488
+
489
+ # Uninstall global binaries/packages
490
+ npm uninstall -g musememory
491
+ # or with Bun:
492
+ bun remove -g musememory
493
+ # or remove fallback symlinks
494
+ rm -f ~/.local/bin/memory ~/.local/bin/musememory
495
+ ```
496
+
497
+ ---
498
+
499
+ ## ๐Ÿงช Testing & Verification
500
+
501
+ ```bash
502
+ bun install
503
+ bun test # 128 tests passing across 22 test suites
504
+ bunx tsc --noEmit # 0 type errors
505
+ bun run build # Clean bundled distribution build (dist/index.js)
506
+ ```
507
+
508
+ ---
509
+
510
+ ## ๐Ÿ“œ License
511
+
512
+ MIT License. Designed for the AI Developer Ecosystem.