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 +13 -4
- package/package.json +5 -2
- package/scripts/install-skills.ps1 +25 -19
- package/scripts/install-skills.sh +24 -19
- package/skills/agent/SKILL.md +104 -0
- package/skills/cursor/SKILL.md +104 -0
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)
|
|
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
|
|
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
|
-
│ │ │
|
|
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.
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
$
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|