myagentmemory 0.4.3 → 0.4.4

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # agent-memory
2
2
 
3
- Persistent memory for coding agents — [Claude Code](https://claude.ai/code) and [OpenAI Codex](https://github.com/openai/codex). Semantic search powered by [qmd](https://github.com/tobi/qmd).
3
+ Persistent memory for coding agents — [Claude Code](https://claude.ai/code), [OpenAI Codex](https://github.com/openai/codex), Cursor, and Agent (Cursor CLI). Semantic search powered by [qmd](https://github.com/tobi/qmd).
4
4
 
5
5
  Thanks to https://github.com/skyfallsin/pi-mem for inspiration.
6
6
 
@@ -12,6 +12,9 @@ Long-term facts, daily logs, and a scratchpad checklist stored as plain markdown
12
12
  # Install the CLI globally
13
13
  npm install -g myagentmemory
14
14
 
15
+ # If you hit SSL errors due to corporate MITM/inspection, try:
16
+ # npm config set strict-ssl false
17
+
15
18
  # Or build from source
16
19
  bun run build:cli
17
20
  # => produces dist/agent-memory
@@ -19,7 +22,7 @@ bun run build:cli
19
22
  # Initialize memory directory
20
23
  agent-memory init
21
24
 
22
- # Install skill files for Claude Code and Codex
25
+ # Install skill files for Claude Code, Codex, Cursor, and Agent
23
26
  bash scripts/install-skills.sh
24
27
  pwsh -File scripts/install-skills.ps1
25
28
  ```
@@ -27,8 +30,12 @@ pwsh -File scripts/install-skills.ps1
27
30
  This installs:
28
31
  - `~/.claude/skills/agent-memory/SKILL.md` — Claude Code skill
29
32
  - `~/.codex/skills/agent-memory/SKILL.md` — Codex skill
33
+ - `~/.cursor/skills/agent-memory/SKILL.md` — Cursor skill
34
+ - `~/.agents/skills/agent-memory/SKILL.md` — Agent CLI skill (Cursor)
30
35
  - `%USERPROFILE%\.claude\skills\agent-memory\SKILL.md` — Claude Code skill (Windows)
31
36
  - `%USERPROFILE%\.codex\skills\agent-memory\SKILL.md` — Codex skill (Windows)
37
+ - `%USERPROFILE%\.cursor\skills\agent-memory\SKILL.md` — Cursor skill (Windows)
38
+ - `%USERPROFILE%\.agents\skills\agent-memory\SKILL.md` — Agent CLI skill (Windows)
32
39
 
33
40
  ### Optional: Enable search with qmd
34
41
 
@@ -58,7 +65,9 @@ Without qmd, all core tools (write/read/scratchpad) work normally. Only `memory_
58
65
  ┌──────────┐ ┌──────────────┐
59
66
  │ src/ │ │ skills/ │
60
67
  │ cli.ts │ │ ├─ claude-code/SKILL.md
61
- │ │ │ └─ codex/SKILL.md
68
+ │ │ │ ├─ codex/SKILL.md
69
+ │ │ │ ├─ cursor/SKILL.md
70
+ │ │ │ └─ agent/SKILL.md
62
71
  └──────────┘ └──────────────┘
63
72
  CLI binary instruction files
64
73
  `agent-memory` that invoke CLI
@@ -116,7 +125,7 @@ Before every agent turn, the following are injected into the system prompt (in p
116
125
 
117
126
  Total injection is capped at 16K chars. When qmd is unavailable, step 3 is skipped and the rest works as before.
118
127
 
119
- For Claude Code, context is injected via the `!`agent-memory context`` syntax in the SKILL.md. For Codex, the agent runs `agent-memory context` at session start.
128
+ For Claude Code, context is injected via the `!`agent-memory context`` syntax in the SKILL.md. For Codex, Cursor, and Agent, the agent runs `agent-memory context` at session start.
120
129
 
121
130
  ### Selective injection
122
131
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "myagentmemory",
3
- "version": "0.4.3",
4
- "description": "Persistent memory for coding agents (Claude Code, Codex) with qmd-powered semantic search across daily logs, long-term memory, and scratchpad",
3
+ "version": "0.4.4",
4
+ "description": "Persistent memory for coding agents (Claude Code, Codex, Cursor, Agent) with qmd-powered semantic search across daily logs, long-term memory, and scratchpad",
5
5
  "main": "./dist/core.js",
6
6
  "types": "./dist/core.d.ts",
7
7
  "exports": {
@@ -22,6 +22,8 @@
22
22
  "daily-log",
23
23
  "claude-code",
24
24
  "codex",
25
+ "cursor",
26
+ "agent",
25
27
  "agent-memory",
26
28
  "coding-agent"
27
29
  ],
@@ -60,6 +62,7 @@
60
62
  },
61
63
  "devDependencies": {
62
64
  "@biomejs/biome": "^2.4.0",
65
+ "@types/node": "^25.3.0",
63
66
  "tsx": "^4.0.0",
64
67
  "typescript": "^5.9.3"
65
68
  },
@@ -3,28 +3,34 @@ $ErrorActionPreference = "Stop"
3
3
  $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
4
4
  $ProjectDir = Split-Path -Parent $ScriptDir
5
5
 
6
- # Claude Code skill
7
- $ClaudeSkillDir = Join-Path $env:USERPROFILE ".claude\\skills\\agent-memory"
8
- $ClaudeSkillSrc = Join-Path $ProjectDir "skills\\claude-code\\SKILL.md"
9
- if (Test-Path $ClaudeSkillSrc) {
10
- New-Item -ItemType Directory -Force -Path $ClaudeSkillDir | Out-Null
11
- Copy-Item -Force $ClaudeSkillSrc (Join-Path $ClaudeSkillDir "SKILL.md")
12
- Write-Host "Installed Claude Code skill: $ClaudeSkillDir\\SKILL.md"
13
- } else {
14
- Write-Host "Skipping Claude Code skill (skills\\claude-code\\SKILL.md not found)"
15
- }
6
+ function Install-Skill {
7
+ param(
8
+ [string]$Label,
9
+ [string]$SrcDir,
10
+ [string]$DestDir,
11
+ [string]$HomeMarker
12
+ )
16
13
 
17
- # Codex skill
18
- $CodexSkillDir = Join-Path $env:USERPROFILE ".codex\\skills\\agent-memory"
19
- $CodexSkillSrc = Join-Path $ProjectDir "skills\\codex\\SKILL.md"
20
- if (Test-Path $CodexSkillSrc) {
21
- New-Item -ItemType Directory -Force -Path $CodexSkillDir | Out-Null
22
- Copy-Item -Force $CodexSkillSrc (Join-Path $CodexSkillDir "SKILL.md")
23
- Write-Host "Installed Codex skill: $CodexSkillDir\\SKILL.md"
24
- } else {
25
- Write-Host "Skipping Codex skill (skills\\codex\\SKILL.md not found)"
14
+ if (-not (Test-Path $HomeMarker)) {
15
+ Write-Host "Skipping $Label ($HomeMarker not found)"
16
+ return
17
+ }
18
+
19
+ $SkillSrc = Join-Path $SrcDir "SKILL.md"
20
+ if (Test-Path $SkillSrc) {
21
+ New-Item -ItemType Directory -Force -Path $DestDir | Out-Null
22
+ Copy-Item -Force $SkillSrc (Join-Path $DestDir "SKILL.md")
23
+ Write-Host "Installed $Label: $DestDir\\SKILL.md"
24
+ } else {
25
+ Write-Host "Skipping $Label ($SkillSrc not found)"
26
+ }
26
27
  }
27
28
 
29
+ Install-Skill -Label "Claude Code skill" -SrcDir (Join-Path $ProjectDir "skills\\claude-code") -DestDir (Join-Path $env:USERPROFILE ".claude\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".claude")
30
+ Install-Skill -Label "Codex skill" -SrcDir (Join-Path $ProjectDir "skills\\codex") -DestDir (Join-Path $env:USERPROFILE ".codex\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".codex")
31
+ Install-Skill -Label "Cursor skill" -SrcDir (Join-Path $ProjectDir "skills\\cursor") -DestDir (Join-Path $env:USERPROFILE ".cursor\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".cursor")
32
+ Install-Skill -Label "Agent CLI skill" -SrcDir (Join-Path $ProjectDir "skills\\agent") -DestDir (Join-Path $env:USERPROFILE ".agents\\skills\\agent-memory") -HomeMarker (Join-Path $env:USERPROFILE ".agents")
33
+
28
34
  Write-Host ""
29
35
  Write-Host "Done."
30
36
  Write-Host ""
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # Install agent-memory skills for Claude Code and Codex CLI.
2
+ # Install agent-memory skills for Claude Code, Codex, Cursor, and Agent CLI.
3
3
  # Usage: bash scripts/install-skills.sh
4
4
 
5
5
  set -euo pipefail
@@ -7,25 +7,30 @@ set -euo pipefail
7
7
  SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8
8
  PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
9
9
 
10
- # Claude Code skill
11
- CLAUDE_SKILL_DIR="$HOME/.claude/skills/agent-memory"
12
- if [ -d "$PROJECT_DIR/skills/claude-code" ]; then
13
- mkdir -p "$CLAUDE_SKILL_DIR"
14
- cp "$PROJECT_DIR/skills/claude-code/SKILL.md" "$CLAUDE_SKILL_DIR/SKILL.md"
15
- echo "Installed Claude Code skill: $CLAUDE_SKILL_DIR/SKILL.md"
16
- else
17
- echo "Skipping Claude Code skill (skills/claude-code/ not found)"
18
- fi
10
+ install_skill() {
11
+ local label="$1"
12
+ local src_dir="$2"
13
+ local dest_dir="$3"
14
+ local home_marker="$4"
19
15
 
20
- # Codex skill
21
- CODEX_SKILL_DIR="$HOME/.codex/skills/agent-memory"
22
- if [ -d "$PROJECT_DIR/skills/codex" ]; then
23
- mkdir -p "$CODEX_SKILL_DIR"
24
- cp "$PROJECT_DIR/skills/codex/SKILL.md" "$CODEX_SKILL_DIR/SKILL.md"
25
- echo "Installed Codex skill: $CODEX_SKILL_DIR/SKILL.md"
26
- else
27
- echo "Skipping Codex skill (skills/codex/ not found)"
28
- fi
16
+ if [ ! -d "$home_marker" ]; then
17
+ echo "Skipping $label ($home_marker not found)"
18
+ return
19
+ fi
20
+
21
+ if [ -d "$src_dir" ]; then
22
+ mkdir -p "$dest_dir"
23
+ cp "$src_dir/SKILL.md" "$dest_dir/SKILL.md"
24
+ echo "Installed $label: $dest_dir/SKILL.md"
25
+ else
26
+ echo "Skipping $label ($src_dir not found)"
27
+ fi
28
+ }
29
+
30
+ install_skill "Claude Code skill" "$PROJECT_DIR/skills/claude-code" "$HOME/.claude/skills/agent-memory" "$HOME/.claude"
31
+ install_skill "Codex skill" "$PROJECT_DIR/skills/codex" "$HOME/.codex/skills/agent-memory" "$HOME/.codex"
32
+ install_skill "Cursor skill" "$PROJECT_DIR/skills/cursor" "$HOME/.cursor/skills/agent-memory" "$HOME/.cursor"
33
+ install_skill "Agent CLI skill" "$PROJECT_DIR/skills/agent" "$HOME/.agents/skills/agent-memory" "$HOME/.agents"
29
34
 
30
35
  echo ""
31
36
  echo "Done."
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: agent-memory
3
+ description: Persistent memory across coding sessions — long-term facts, daily logs, scratchpad checklist, and semantic search.
4
+ ---
5
+
6
+ # Agent Memory
7
+
8
+ You have a persistent memory system. Use it to remember decisions, preferences, lessons learned, and context across sessions.
9
+
10
+ ## Important: Load context at session start
11
+
12
+ At the beginning of each session, run this command to load your memory context:
13
+
14
+ ```bash
15
+ agent-memory context --no-search 2>/dev/null
16
+ ```
17
+
18
+ ## Memory Commands
19
+
20
+ All commands use the `agent-memory` CLI. Examples:
21
+
22
+ ### Write to memory
23
+
24
+ ```bash
25
+ # Save a long-term fact, decision, or preference
26
+ agent-memory write --target long_term --content "User prefers TypeScript with strict mode"
27
+
28
+ # Overwrite MEMORY.md entirely (use with care)
29
+ agent-memory write --target long_term --content "..." --mode overwrite
30
+
31
+ # Append to today's daily log
32
+ agent-memory write --target daily --content "Fixed auth bug in login.ts — was missing token refresh"
33
+ ```
34
+
35
+ ### Read memory
36
+
37
+ ```bash
38
+ # Read long-term memory
39
+ agent-memory read --target long_term
40
+
41
+ # Read today's daily log
42
+ agent-memory read --target daily
43
+
44
+ # Read a specific day's log
45
+ agent-memory read --target daily --date 2026-02-15
46
+
47
+ # List all daily logs
48
+ agent-memory read --target list
49
+
50
+ # Read scratchpad
51
+ agent-memory read --target scratchpad
52
+ ```
53
+
54
+ ### Manage scratchpad (checklist)
55
+
56
+ ```bash
57
+ # Add an item
58
+ agent-memory scratchpad add --text "Review PR #42"
59
+
60
+ # List items
61
+ agent-memory scratchpad list
62
+
63
+ # Mark item as done (matches by substring)
64
+ agent-memory scratchpad done --text "PR #42"
65
+
66
+ # Undo a done item
67
+ agent-memory scratchpad undo --text "PR #42"
68
+
69
+ # Remove all completed items
70
+ agent-memory scratchpad clear_done
71
+ ```
72
+
73
+ ### Search memory (requires qmd)
74
+
75
+ ```bash
76
+ # Fast keyword search
77
+ agent-memory search --query "database choice" --mode keyword
78
+
79
+ # Semantic search (finds related concepts)
80
+ agent-memory search --query "how do we handle auth" --mode semantic
81
+
82
+ # Deep hybrid search with reranking
83
+ agent-memory search --query "performance optimization" --mode deep --limit 10
84
+ ```
85
+
86
+ ### Setup and status
87
+
88
+ ```bash
89
+ # Initialize memory directory and qmd collection
90
+ agent-memory init
91
+
92
+ # Show configuration and status
93
+ agent-memory status
94
+ ```
95
+
96
+ ## Guidelines
97
+
98
+ - When someone says "remember this" or asks you to note something, write it immediately using `agent-memory write`
99
+ - Use `--target long_term` for durable facts: decisions, preferences, architecture choices, lessons learned
100
+ - Use `--target daily` for session notes: what you worked on, bugs found, progress updates
101
+ - Use the scratchpad for TODOs, follow-ups, and things to keep in mind
102
+ - Use `#tags` (e.g. `#decision`, `#preference`, `#lesson`) and `[[links]]` (e.g. `[[auth-strategy]]`) in content to improve future search recall
103
+ - Before starting a task, check if relevant context exists via `agent-memory search`
104
+ - At the end of a significant work session, summarize what was done in the daily log
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: agent-memory
3
+ description: Persistent memory across coding sessions — long-term facts, daily logs, scratchpad checklist, and semantic search.
4
+ ---
5
+
6
+ # Agent Memory
7
+
8
+ You have a persistent memory system. Use it to remember decisions, preferences, lessons learned, and context across sessions.
9
+
10
+ ## Important: Load context at session start
11
+
12
+ At the beginning of each session, run this command to load your memory context:
13
+
14
+ ```bash
15
+ agent-memory context --no-search 2>/dev/null
16
+ ```
17
+
18
+ ## Memory Commands
19
+
20
+ All commands use the `agent-memory` CLI. Examples:
21
+
22
+ ### Write to memory
23
+
24
+ ```bash
25
+ # Save a long-term fact, decision, or preference
26
+ agent-memory write --target long_term --content "User prefers TypeScript with strict mode"
27
+
28
+ # Overwrite MEMORY.md entirely (use with care)
29
+ agent-memory write --target long_term --content "..." --mode overwrite
30
+
31
+ # Append to today's daily log
32
+ agent-memory write --target daily --content "Fixed auth bug in login.ts — was missing token refresh"
33
+ ```
34
+
35
+ ### Read memory
36
+
37
+ ```bash
38
+ # Read long-term memory
39
+ agent-memory read --target long_term
40
+
41
+ # Read today's daily log
42
+ agent-memory read --target daily
43
+
44
+ # Read a specific day's log
45
+ agent-memory read --target daily --date 2026-02-15
46
+
47
+ # List all daily logs
48
+ agent-memory read --target list
49
+
50
+ # Read scratchpad
51
+ agent-memory read --target scratchpad
52
+ ```
53
+
54
+ ### Manage scratchpad (checklist)
55
+
56
+ ```bash
57
+ # Add an item
58
+ agent-memory scratchpad add --text "Review PR #42"
59
+
60
+ # List items
61
+ agent-memory scratchpad list
62
+
63
+ # Mark item as done (matches by substring)
64
+ agent-memory scratchpad done --text "PR #42"
65
+
66
+ # Undo a done item
67
+ agent-memory scratchpad undo --text "PR #42"
68
+
69
+ # Remove all completed items
70
+ agent-memory scratchpad clear_done
71
+ ```
72
+
73
+ ### Search memory (requires qmd)
74
+
75
+ ```bash
76
+ # Fast keyword search
77
+ agent-memory search --query "database choice" --mode keyword
78
+
79
+ # Semantic search (finds related concepts)
80
+ agent-memory search --query "how do we handle auth" --mode semantic
81
+
82
+ # Deep hybrid search with reranking
83
+ agent-memory search --query "performance optimization" --mode deep --limit 10
84
+ ```
85
+
86
+ ### Setup and status
87
+
88
+ ```bash
89
+ # Initialize memory directory and qmd collection
90
+ agent-memory init
91
+
92
+ # Show configuration and status
93
+ agent-memory status
94
+ ```
95
+
96
+ ## Guidelines
97
+
98
+ - When someone says "remember this" or asks you to note something, write it immediately using `agent-memory write`
99
+ - Use `--target long_term` for durable facts: decisions, preferences, architecture choices, lessons learned
100
+ - Use `--target daily` for session notes: what you worked on, bugs found, progress updates
101
+ - Use the scratchpad for TODOs, follow-ups, and things to keep in mind
102
+ - Use `#tags` (e.g. `#decision`, `#preference`, `#lesson`) and `[[links]]` (e.g. `[[auth-strategy]]`) in content to improve future search recall
103
+ - Before starting a task, check if relevant context exists via `agent-memory search`
104
+ - At the end of a significant work session, summarize what was done in the daily log