@mndrk/memx 0.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.
- package/.claude/settings.local.json +7 -0
- package/README.md +183 -0
- package/index.js +1969 -0
- package/mcp.js +308 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# mem
|
|
2
|
+
|
|
3
|
+
Persistent memory for AI agents. Git-backed, branch-per-task, CLI interface.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install -g @mnrdk/memx
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Run mem in any directory - interactive setup
|
|
13
|
+
mem
|
|
14
|
+
|
|
15
|
+
# Or explicit init
|
|
16
|
+
mem init landing "Build landing page for my project"
|
|
17
|
+
|
|
18
|
+
# Track progress
|
|
19
|
+
mem checkpoint "Hero section complete"
|
|
20
|
+
mem next "Add testimonials"
|
|
21
|
+
mem stuck "Waiting on copy from client"
|
|
22
|
+
|
|
23
|
+
# Record learnings
|
|
24
|
+
mem learn "Tailwind is faster than custom CSS"
|
|
25
|
+
|
|
26
|
+
# Get full context (on wake)
|
|
27
|
+
mem context
|
|
28
|
+
|
|
29
|
+
# See progress against success criteria
|
|
30
|
+
mem progress
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Architecture
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
WAKE → LOAD STATE → THINK → ACT → SAVE STATE → SLEEP
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- **Git-backed**: All state versioned and syncable
|
|
40
|
+
- **Branches = Tasks**: Each goal is a separate branch
|
|
41
|
+
- **Two scopes**: Task-local memory + global playbook
|
|
42
|
+
- **Adapters**: Export wake schedule to cron, pm2, etc.
|
|
43
|
+
|
|
44
|
+
## File Structure
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
.mem/
|
|
48
|
+
goal.md # Objective + success criteria + constraints
|
|
49
|
+
state.md # Progress, next step, blockers, wake schedule
|
|
50
|
+
memory.md # Task-specific learnings
|
|
51
|
+
playbook.md # Global learnings (shared across tasks)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Commands
|
|
55
|
+
|
|
56
|
+
### Lifecycle
|
|
57
|
+
```bash
|
|
58
|
+
mem init <name> "<goal>" # Start new task (interactive if no args)
|
|
59
|
+
mem status # Current state summary
|
|
60
|
+
mem done # Complete task, reflect, merge learnings
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Goal & Criteria
|
|
64
|
+
```bash
|
|
65
|
+
mem goal [value] # Get/set goal
|
|
66
|
+
mem criteria add "..." # Add success criterion
|
|
67
|
+
mem criteria <n> # Mark criterion #n complete
|
|
68
|
+
mem progress # Show progress % with visual bar
|
|
69
|
+
mem constraint add "..." # Add constraint/boundary
|
|
70
|
+
mem constraints # List constraints
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Progress
|
|
74
|
+
```bash
|
|
75
|
+
mem next [step] # Get/set next step
|
|
76
|
+
mem checkpoint "<msg>" # Save progress point
|
|
77
|
+
mem stuck [reason|clear] # Mark/clear blocker
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Learning
|
|
81
|
+
```bash
|
|
82
|
+
mem learn "<insight>" # Add task learning
|
|
83
|
+
mem learn -g "<insight>" # Add global learning
|
|
84
|
+
mem learnings # List learnings with IDs
|
|
85
|
+
mem playbook # View global playbook
|
|
86
|
+
mem promote <n> # Promote learning #n to playbook
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Query
|
|
90
|
+
```bash
|
|
91
|
+
mem context # Full hydration for agent wake
|
|
92
|
+
mem history # Task progression (git log)
|
|
93
|
+
mem query "<search>" # Search all memory
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Tasks (Isolation)
|
|
97
|
+
```bash
|
|
98
|
+
mem tasks # List all tasks (branches)
|
|
99
|
+
mem switch <name> # Switch to different task
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Wake & Sync
|
|
103
|
+
```bash
|
|
104
|
+
mem wake "<pattern>" # Set wake schedule
|
|
105
|
+
mem wake "every 15m" # Examples: every 15m, 8am daily, monday 9am
|
|
106
|
+
mem wake --run "<cmd>" # Custom wake command
|
|
107
|
+
mem wake clear # Clear wake schedule
|
|
108
|
+
mem cron export # Export as crontab entry
|
|
109
|
+
mem sync # Push/pull with remote
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Integration
|
|
113
|
+
```bash
|
|
114
|
+
mem skill # View LLM skill
|
|
115
|
+
mem skill install # Install skill to Claude/Gemini
|
|
116
|
+
mem mcp # Start MCP server (stdio)
|
|
117
|
+
mem mcp config # Show config for Claude Desktop
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Task Isolation
|
|
121
|
+
|
|
122
|
+
Each task is a git branch. Switch instantly between contexts:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
mem init landing "Build landing page" # → task/landing branch
|
|
126
|
+
mem init auth "Fix auth bug" # → task/auth branch
|
|
127
|
+
|
|
128
|
+
mem switch landing # Work on landing
|
|
129
|
+
mem switch auth # Context switch to auth
|
|
130
|
+
|
|
131
|
+
mem done # Complete, merge learnings to main
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Learnings stay isolated until promoted to the global playbook.
|
|
135
|
+
|
|
136
|
+
## Wake System
|
|
137
|
+
|
|
138
|
+
Store wake intent in memory, export to any scheduler:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Set wake schedule
|
|
142
|
+
mem wake "every 15m"
|
|
143
|
+
mem wake "8am daily" --run "mem context | claude -p 'continue'"
|
|
144
|
+
|
|
145
|
+
# Export to cron
|
|
146
|
+
mem cron export >> /etc/crontab
|
|
147
|
+
|
|
148
|
+
# Or view for manual setup
|
|
149
|
+
mem cron export
|
|
150
|
+
# → */15 * * * * cd /path && mem context
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## For AI Agents
|
|
154
|
+
|
|
155
|
+
Install the skill so LLMs know how to use mem:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
mem skill install
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Or use MCP for direct integration:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
mem mcp config # Get config for Claude Desktop
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## How It Works
|
|
168
|
+
|
|
169
|
+
1. **Init**: Create `.mem/` with goal + criteria
|
|
170
|
+
2. **Wake**: Agent runs `mem context` to hydrate
|
|
171
|
+
3. **Work**: Execute, checkpoint, learn
|
|
172
|
+
4. **Sleep**: State persisted in git
|
|
173
|
+
5. **Repeat**: Next session picks up where left off
|
|
174
|
+
|
|
175
|
+
The framework enforces:
|
|
176
|
+
- Define done before starting (criteria in goal.md)
|
|
177
|
+
- Track progress explicitly (checkpoints)
|
|
178
|
+
- Capture learnings (memory.md)
|
|
179
|
+
- Curate transferable knowledge (promote to playbook)
|
|
180
|
+
|
|
181
|
+
## License
|
|
182
|
+
|
|
183
|
+
MIT
|