@aman_asmuei/amem 0.1.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/LICENSE +21 -0
- package/README.md +791 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +252 -0
- package/dist/cli.js.map +1 -0
- package/dist/database.d.ts +29 -0
- package/dist/database.js +124 -0
- package/dist/database.js.map +1 -0
- package/dist/embeddings.d.ts +14 -0
- package/dist/embeddings.js +54 -0
- package/dist/embeddings.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +147 -0
- package/dist/index.js.map +1 -0
- package/dist/memory.d.ts +48 -0
- package/dist/memory.js +77 -0
- package/dist/memory.js.map +1 -0
- package/dist/tools.d.ts +3 -0
- package/dist/tools.js +373 -0
- package/dist/tools.js.map +1 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,791 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# Aman AI Memory
|
|
4
|
+
|
|
5
|
+
**Persistent AI memory in markdown files. Multi-user ready.**
|
|
6
|
+
**Works with any AI. Auto-integrates with Claude Code.**
|
|
7
|
+
|
|
8
|
+
[](https://claude.ai/claude-code)
|
|
9
|
+
[](https://en.wikipedia.org/wiki/Markdown)
|
|
10
|
+
[](#credits)
|
|
11
|
+
|
|
12
|
+
<br>
|
|
13
|
+
|
|
14
|
+
*Your AI remembers you across conversations — your name, preferences, projects, and decisions.*
|
|
15
|
+
*No database. No API keys. No setup complexity. Just markdown.*
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## What Is This?
|
|
22
|
+
|
|
23
|
+
Every time you start a new conversation with an AI (ChatGPT, Claude, Gemini), it forgets everything about you. Your name, your projects, your preferences — gone.
|
|
24
|
+
|
|
25
|
+
**Aman AI Memory fixes this.** It gives your AI a set of files where it stores what it learns about you. Next conversation, it reads those files and picks up right where you left off.
|
|
26
|
+
|
|
27
|
+
- **It remembers your name** and how you like to work
|
|
28
|
+
- **It tracks your projects** and decisions you've made
|
|
29
|
+
- **It learns your style** over time, adapting to your preferences
|
|
30
|
+
- **It works with any AI** — Claude Code has full automation, others work with copy-paste
|
|
31
|
+
- **Your data stays on your computer** — no cloud, no accounts, just plain text files
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### Install (one-liner)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
curl -fsSL https://raw.githubusercontent.com/amanasmuei/aman-ai-memory/main/get.sh | bash
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Downloads everything, initializes a fresh git repo, and launches the guided setup wizard. Just answer a few questions — pick from numbered choices or press Enter for defaults.
|
|
44
|
+
|
|
45
|
+
> [!TIP]
|
|
46
|
+
> No terminal experience needed. Git is installed automatically as part of setup. Each install gets its own clean git history — no template commits carried over.
|
|
47
|
+
|
|
48
|
+
<details>
|
|
49
|
+
<summary><strong>Install into a specific folder</strong></summary>
|
|
50
|
+
|
|
51
|
+
<br>
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Custom folder name
|
|
55
|
+
curl -fsSL https://raw.githubusercontent.com/amanasmuei/aman-ai-memory/main/get.sh | bash -s -- my-project/ai-memory
|
|
56
|
+
|
|
57
|
+
# Or clone and run the wizard (init.sh replaces template history with a fresh repo)
|
|
58
|
+
git clone https://github.com/amanasmuei/aman-ai-memory.git
|
|
59
|
+
cd aman-ai-memory && ./init.sh
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
</details>
|
|
63
|
+
|
|
64
|
+
<details>
|
|
65
|
+
<summary><strong>Already have the files?</strong> — just run the wizard</summary>
|
|
66
|
+
|
|
67
|
+
<br>
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
./init.sh
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Or run the steps separately:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
./setup.sh # Fill in memory.md only
|
|
77
|
+
./install.sh # Install hooks into host project only
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
</details>
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Your First Conversation
|
|
85
|
+
|
|
86
|
+
There are two ways to get started — pick whichever feels more comfortable:
|
|
87
|
+
|
|
88
|
+
### Option A: Just start talking (recommended for beginners)
|
|
89
|
+
|
|
90
|
+
1. **Open Claude Code** in your project folder
|
|
91
|
+
2. **Say hello** — the AI detects this is your first time and walks you through setup
|
|
92
|
+
3. **Answer a few questions** — your name, what you work on, what to call the AI
|
|
93
|
+
4. **Done!** The AI remembers you from now on
|
|
94
|
+
|
|
95
|
+
The AI asks questions conversationally, 2-3 at a time. No forms, no commands — just a friendly chat.
|
|
96
|
+
|
|
97
|
+
### Option B: Run the setup wizard first
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
./init.sh
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The wizard asks the same questions with numbered choices. Good if you prefer filling things in quickly before your first conversation.
|
|
104
|
+
|
|
105
|
+
### After Setup
|
|
106
|
+
|
|
107
|
+
1. **Chat normally** — the AI quietly takes notes as you work together
|
|
108
|
+
2. **Say "save"** before ending important sessions — this tells the AI to remember what it learned
|
|
109
|
+
3. **Next time**, the AI greets you by name and remembers everything from before
|
|
110
|
+
|
|
111
|
+
That's it. No commands to memorize. Just talk naturally and say "save" when it matters.
|
|
112
|
+
|
|
113
|
+
> [!TIP]
|
|
114
|
+
> **Using ChatGPT, Gemini, or another AI?** At the start of each conversation, paste: *"Read memory.md and session.md, then follow the instructions in CLAUDE.md."* At the end, say: *"Save progress."*
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Quick Reference
|
|
119
|
+
|
|
120
|
+
**Things you can say to the AI:**
|
|
121
|
+
|
|
122
|
+
| Say this | What happens |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| *(just start talking)* | AI loads your memory and continues where you left off |
|
|
125
|
+
| **"save"** | AI saves what it learned — patterns, decisions, projects |
|
|
126
|
+
| **"write diary entry"** | AI creates a dated log of today's session |
|
|
127
|
+
| **"plan"** | AI creates a work plan with checkboxes to track |
|
|
128
|
+
| *"what did we decide about X?"* | AI searches its memory and diary for past context |
|
|
129
|
+
|
|
130
|
+
**Scripts you can run in the terminal (optional — the AI handles most of this):**
|
|
131
|
+
|
|
132
|
+
| Command | What it does |
|
|
133
|
+
| --- | --- |
|
|
134
|
+
| `./recall.sh <word>` | Search all memory files for a keyword |
|
|
135
|
+
| `./archive.sh` | Clean up old entries when memory gets full |
|
|
136
|
+
| `./add-user.sh <name>` | Add another person's profile |
|
|
137
|
+
| `./switch-user.sh` | Switch between profiles |
|
|
138
|
+
| `./setup.sh` | Reconfigure your AI's name and personality |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Project Structure
|
|
143
|
+
|
|
144
|
+
<details>
|
|
145
|
+
<summary>Click to view all files</summary>
|
|
146
|
+
|
|
147
|
+
<br>
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
aman-ai-memory/
|
|
151
|
+
│
|
|
152
|
+
├── memory.md Your AI's long-term memory (identity, patterns, decisions)
|
|
153
|
+
├── session.md Current conversation notes (resets each time)
|
|
154
|
+
├── plans.md Work plans with checkboxes (created when you say "plan")
|
|
155
|
+
├── diary/ Daily session logs (optional)
|
|
156
|
+
├── archive/ Old entries moved here to keep memory lean
|
|
157
|
+
│
|
|
158
|
+
├── CLAUDE.md Instructions the AI follows automatically
|
|
159
|
+
├── .claude/
|
|
160
|
+
│ └── settings.json Automation hooks (runs behind the scenes)
|
|
161
|
+
│
|
|
162
|
+
├── get.sh Remote installer (the curl one-liner)
|
|
163
|
+
├── init.sh Setup wizard (start here)
|
|
164
|
+
├── setup.sh Configure your AI's identity
|
|
165
|
+
├── install.sh Install into an existing project
|
|
166
|
+
├── auto-save.sh Saves your notes when conversation ends
|
|
167
|
+
├── reset-session.sh Prepares a fresh session on start
|
|
168
|
+
├── validate-memory.sh Checks memory files aren't corrupted
|
|
169
|
+
├── archive.sh Moves old entries to archive
|
|
170
|
+
├── recall.sh Searches memory for past context
|
|
171
|
+
├── add-user.sh Adds a new user profile
|
|
172
|
+
├── switch-user.sh Switches between user profiles
|
|
173
|
+
│
|
|
174
|
+
├── profiles/ Per-user data (multi-user mode only)
|
|
175
|
+
│ └── <name>/
|
|
176
|
+
│ ├── memory.md
|
|
177
|
+
│ ├── session.md
|
|
178
|
+
│ └── diary/
|
|
179
|
+
└── archive/ Archived entries (created by archive.sh)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
</details>
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## How It Works
|
|
187
|
+
|
|
188
|
+
Here's what happens behind the scenes during each conversation:
|
|
189
|
+
|
|
190
|
+
### Conversation Lifecycle
|
|
191
|
+
|
|
192
|
+
```text
|
|
193
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
194
|
+
│ SESSION START │
|
|
195
|
+
│ ┌─────────────┐ ┌────────────────┐ ┌────────────────┐ │
|
|
196
|
+
│ │ Load memory │──▶│ Reset session │──▶│ Ready to work │ │
|
|
197
|
+
│ │ + archive │ │ + inject time │ │ (time-aware) │ │
|
|
198
|
+
│ └─────────────┘ │ + archive diary│ └───────┬────────┘ │
|
|
199
|
+
│ └────────────────┘ │ │
|
|
200
|
+
│ DURING SESSION ▼ │
|
|
201
|
+
│ ┌───────────────────────────────────────────────────────┐ │
|
|
202
|
+
│ │ AI updates Working Notes as you make progress │ │
|
|
203
|
+
│ │ AI can recall past context from diary and archive │ │
|
|
204
|
+
│ │ You say "save" for intelligent save (optional) │ │
|
|
205
|
+
│ │ You say "plan" to create a tracked work plan │ │
|
|
206
|
+
│ └───────────────────────────────────┬───────────────────┘ │
|
|
207
|
+
│ │ │
|
|
208
|
+
│ SESSION END ▼ │
|
|
209
|
+
│ ┌──────────────┐ ┌────────────────────────────────────┐ │
|
|
210
|
+
│ │ Auto-save │──▶│ Working Notes → Summary │ │
|
|
211
|
+
│ │ (mechanical) │ │ Ready for next session │ │
|
|
212
|
+
│ └──────────────┘ └────────────────────────────────────┘ │
|
|
213
|
+
└──────────────────────────────────────────────────────────────┘
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
| Step | When | What Happens |
|
|
217
|
+
| --- | --- | --- |
|
|
218
|
+
| **Load** | Conversation starts | AI reads `memory.md` + `session.md` + `archive/memory-archive.md` |
|
|
219
|
+
| **Reset** | Conversation starts | Session resets, injects current time, archives old diary months |
|
|
220
|
+
| **Adapt** | Conversation starts | AI adapts tone to time of day (morning/afternoon/evening/night) |
|
|
221
|
+
| **Work** | During conversation | AI updates Working Notes, can recall from diary and archive |
|
|
222
|
+
| **Plan** | User says "plan" | AI creates or updates `plans.md` with tracked checkboxes |
|
|
223
|
+
| **Save** | User says "save" | AI saves patterns, decisions, projects (max 10), archives old entries |
|
|
224
|
+
| **Auto-save** | Conversation ends | Working Notes copied to summary mechanically |
|
|
225
|
+
| **Validate** | After every edit | Checks structure, size limits (200/500 lines), and append-only rules |
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### Two Types of Save
|
|
230
|
+
|
|
231
|
+
<table>
|
|
232
|
+
<tr>
|
|
233
|
+
<th width="200"></th>
|
|
234
|
+
<th width="350">Auto-save (on exit)</th>
|
|
235
|
+
<th width="350">Manual save (user says "save")</th>
|
|
236
|
+
</tr>
|
|
237
|
+
<tr>
|
|
238
|
+
<td><strong>What</strong></td>
|
|
239
|
+
<td>Copies Working Notes to End-of-Session Summary</td>
|
|
240
|
+
<td>Updates patterns, decisions, projects, summary</td>
|
|
241
|
+
</tr>
|
|
242
|
+
<tr>
|
|
243
|
+
<td><strong>How</strong></td>
|
|
244
|
+
<td>Bash script — no AI involved</td>
|
|
245
|
+
<td>AI with full conversation context</td>
|
|
246
|
+
</tr>
|
|
247
|
+
<tr>
|
|
248
|
+
<td><strong>Cost</strong></td>
|
|
249
|
+
<td>0 tokens, instant</td>
|
|
250
|
+
<td>Normal AI usage</td>
|
|
251
|
+
</tr>
|
|
252
|
+
<tr>
|
|
253
|
+
<td><strong>When</strong></td>
|
|
254
|
+
<td>Every exit, automatically</td>
|
|
255
|
+
<td>When you explicitly ask</td>
|
|
256
|
+
</tr>
|
|
257
|
+
<tr>
|
|
258
|
+
<td><strong>Best for</strong></td>
|
|
259
|
+
<td>Preserving context between sessions</td>
|
|
260
|
+
<td>Recording long-term patterns and decisions</td>
|
|
261
|
+
</tr>
|
|
262
|
+
</table>
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
### What Each File Stores
|
|
267
|
+
|
|
268
|
+
| File | What Goes Here | Who Updates It | Resets? |
|
|
269
|
+
| --- | --- | --- | --- |
|
|
270
|
+
| `memory.md` | AI identity, user profile, learned patterns, decision log, projects (max 10) | You (setup) + AI (save) | Never — grows over time |
|
|
271
|
+
| `session.md` | Previous recap, time context, goals, working notes, session summary | AI during conversation | Every conversation |
|
|
272
|
+
| `diary/YYYY-MM-DD.md` | Daily session logs | AI when you ask | Never — append-only |
|
|
273
|
+
| `archive/memory-archive.md` | Archived decisions and completed projects | AI (during archive) | Never — append-only |
|
|
274
|
+
| `plans.md` | Active work plans with checkboxes | AI when you say "plan" | When plans complete |
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Detailed Setup Guide
|
|
279
|
+
|
|
280
|
+
### All-in-One (Recommended)
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
curl -fsSL https://raw.githubusercontent.com/amanasmuei/aman-ai-memory/main/get.sh | bash
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
The installer downloads everything and launches the guided wizard. It handles:
|
|
287
|
+
|
|
288
|
+
- Single-user or multi-user mode selection
|
|
289
|
+
- Friendly questions with numbered choices (pick 1, 2, 3...)
|
|
290
|
+
- Sensible defaults (press Enter to skip)
|
|
291
|
+
- Auto-detects if you're in a subfolder and offers to install hooks
|
|
292
|
+
- Initializes a fresh git repo (no template history carried over)
|
|
293
|
+
- Shows a summary when done
|
|
294
|
+
|
|
295
|
+
> [!TIP]
|
|
296
|
+
> **You can skip the wizard entirely.** If you prefer, just open Claude Code and start talking — the AI will walk you through setup conversationally on your first conversation. See [Your First Conversation](#your-first-conversation).
|
|
297
|
+
|
|
298
|
+
### Adding to an Existing Project
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Download into your project
|
|
302
|
+
curl -fsSL https://raw.githubusercontent.com/amanasmuei/aman-ai-memory/main/get.sh | bash -s -- my-project/ai-memory
|
|
303
|
+
|
|
304
|
+
# Run the wizard
|
|
305
|
+
cd my-project/ai-memory && ./init.sh
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
> [!NOTE]
|
|
309
|
+
> The wizard auto-detects that you're inside another project and offers to install hooks for you.
|
|
310
|
+
|
|
311
|
+
### Other AI Platforms (ChatGPT, Gemini, etc.)
|
|
312
|
+
|
|
313
|
+
<details>
|
|
314
|
+
<summary>Click to expand</summary>
|
|
315
|
+
|
|
316
|
+
<br>
|
|
317
|
+
|
|
318
|
+
The auto-save and validation hooks are Claude Code specific. For other platforms:
|
|
319
|
+
|
|
320
|
+
1. Run `./init.sh` to fill in `memory.md` (or edit `memory.md` directly — replace the `[AI_NAME]` and `[YOUR_NAME]` placeholders with your details)
|
|
321
|
+
2. At the **start** of each conversation, paste:
|
|
322
|
+
|
|
323
|
+
> Read memory.md and session.md, then follow the instructions in CLAUDE.md for how to manage memory during our session.
|
|
324
|
+
|
|
325
|
+
3. At the **end** of each conversation, say:
|
|
326
|
+
|
|
327
|
+
> Save progress to memory.md and session.md.
|
|
328
|
+
|
|
329
|
+
No automation, but the memory files work the same way.
|
|
330
|
+
|
|
331
|
+
</details>
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Usage Guide
|
|
336
|
+
|
|
337
|
+
### Day-to-Day Workflow
|
|
338
|
+
|
|
339
|
+
| What You Want | What To Do |
|
|
340
|
+
| --- | --- |
|
|
341
|
+
| Start a conversation | Just start — AI loads memory automatically |
|
|
342
|
+
| Save important context | Say **"save"** |
|
|
343
|
+
| Write a diary entry | Say **"write diary entry"** |
|
|
344
|
+
| Create a work plan | Say **"plan"** — AI creates `plans.md` with checkboxes |
|
|
345
|
+
| Search past context | Run **`./recall.sh <keyword>`** or ask the AI |
|
|
346
|
+
| Exit without saving | Just exit — Working Notes are auto-saved |
|
|
347
|
+
| Archive old entries | Run **`./archive.sh`** or say "save" (AI archives automatically) |
|
|
348
|
+
| Add a team member | Run **`./add-user.sh <name>`** |
|
|
349
|
+
| Switch user profile | Run **`./switch-user.sh <name>`** |
|
|
350
|
+
|
|
351
|
+
### Tips for Best Results
|
|
352
|
+
|
|
353
|
+
> [!IMPORTANT]
|
|
354
|
+
> Say **"save"** before ending important sessions. Auto-save preserves your working notes, but only manual save captures learned patterns and decisions intelligently.
|
|
355
|
+
|
|
356
|
+
1. **Be explicit about decisions.** Say *"let's go with approach X because Y"* — the AI will log it in the Decision Log when you save.
|
|
357
|
+
|
|
358
|
+
2. **Review `memory.md` occasionally.** Check that learned patterns and decisions are accurate. Delete anything wrong.
|
|
359
|
+
|
|
360
|
+
3. **Keep it under 200 lines.** Run `./archive.sh` when it grows, or just say "save" — the AI archives automatically when approaching the limit.
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
### What the AI Remembers
|
|
365
|
+
|
|
366
|
+
After a few sessions, `memory.md` will contain:
|
|
367
|
+
|
|
368
|
+
| Section | Example |
|
|
369
|
+
| --- | --- |
|
|
370
|
+
| **Learned Patterns** | *"Prefers concise answers"*, *"Always wants tests before merging"* |
|
|
371
|
+
| **Decision Log** | *"Chose PostgreSQL over MongoDB — relational data needs"* |
|
|
372
|
+
| **Active Projects** | *"API rewrite — in progress — migrating from REST to GraphQL"* |
|
|
373
|
+
|
|
374
|
+
This context is loaded at the start of every conversation, so the AI picks up where you left off.
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## Validation
|
|
379
|
+
|
|
380
|
+
Every edit to memory files is automatically checked in the background. You don't need to do anything — if something goes wrong, the AI is told to fix it.
|
|
381
|
+
|
|
382
|
+
<details>
|
|
383
|
+
<summary>View all validation checks</summary>
|
|
384
|
+
|
|
385
|
+
<br>
|
|
386
|
+
|
|
387
|
+
| Check | What It Catches |
|
|
388
|
+
| --- | --- |
|
|
389
|
+
| Required sections | AI accidentally deleted a section heading |
|
|
390
|
+
| Table format | Decision Log or Active Projects lost their table structure |
|
|
391
|
+
| Placeholder check | `[AI_NAME]` still present — setup not complete (AI will guide you through it) |
|
|
392
|
+
| Size guard | `memory.md` over 200 lines or `session.md` over 500 lines |
|
|
393
|
+
| Append-only integrity | Learned Patterns or Decision Log entries were deleted |
|
|
394
|
+
| Session structure | `session.md` missing required sections |
|
|
395
|
+
| Diary format | Wrong filename, missing fields, missing session header |
|
|
396
|
+
|
|
397
|
+
</details>
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
## Diary Format
|
|
402
|
+
|
|
403
|
+
<details>
|
|
404
|
+
<summary>View diary entry template</summary>
|
|
405
|
+
|
|
406
|
+
<br>
|
|
407
|
+
|
|
408
|
+
One file per day (`diary/YYYY-MM-DD.md`), multiple entries appended. Never edit past entries.
|
|
409
|
+
|
|
410
|
+
```markdown
|
|
411
|
+
## Session — HH:MM
|
|
412
|
+
**Topics**: [comma-separated]
|
|
413
|
+
**Summary**: [1-2 sentences]
|
|
414
|
+
**Decisions**: [any choices made]
|
|
415
|
+
**Learned**: [new user patterns discovered]
|
|
416
|
+
---
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
Previous months are automatically archived to `diary/archive/YYYY-MM/` at the start of each conversation.
|
|
420
|
+
|
|
421
|
+
</details>
|
|
422
|
+
|
|
423
|
+
---
|
|
424
|
+
|
|
425
|
+
## Multi-User
|
|
426
|
+
|
|
427
|
+
For teams or shared machines where multiple people need their own AI memory.
|
|
428
|
+
|
|
429
|
+
### Getting Started
|
|
430
|
+
|
|
431
|
+
**During initial setup** — the wizard asks "Just me" or "Multiple people":
|
|
432
|
+
|
|
433
|
+
```text
|
|
434
|
+
How will this be used?
|
|
435
|
+
|
|
436
|
+
1) Just me — single user
|
|
437
|
+
2) Multiple people — shared project
|
|
438
|
+
|
|
439
|
+
Pick one [1]: 2
|
|
440
|
+
Your profile name [aman]:
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
Each user gets an isolated profile with their own `memory.md`, `session.md`, and `diary/`.
|
|
444
|
+
|
|
445
|
+
### Adding Users Later
|
|
446
|
+
|
|
447
|
+
Already running single-user? No problem — `add-user.sh` migrates your data automatically:
|
|
448
|
+
|
|
449
|
+
```bash
|
|
450
|
+
./add-user.sh alice
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
> [!NOTE]
|
|
454
|
+
> The first time you add a user, the script asks for a name for your **existing** profile so your data is preserved. After that, it simply creates a new empty profile.
|
|
455
|
+
|
|
456
|
+
### Switching Profiles
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
./switch-user.sh # Interactive — lists all profiles, pick one
|
|
460
|
+
./switch-user.sh alice # Switch directly
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
After switching, all scripts, hooks, and AI instructions work with the new profile — no reconfiguration needed.
|
|
464
|
+
|
|
465
|
+
### How It Works
|
|
466
|
+
|
|
467
|
+
Root files (`memory.md`, `session.md`, `diary/`) become **symlinks** to the active profile. This means zero changes to CLAUDE.md, hooks, or AI workflows.
|
|
468
|
+
|
|
469
|
+
```text
|
|
470
|
+
aman-ai-memory/
|
|
471
|
+
├── memory.md → profiles/aman/memory.md (symlink)
|
|
472
|
+
├── session.md → profiles/aman/session.md (symlink)
|
|
473
|
+
├── diary → profiles/aman/diary (symlink)
|
|
474
|
+
│
|
|
475
|
+
└── profiles/
|
|
476
|
+
├── aman/
|
|
477
|
+
│ ├── memory.md ← AI reads/writes here when aman is active
|
|
478
|
+
│ ├── session.md
|
|
479
|
+
│ ├── diary/
|
|
480
|
+
│ └── archive/
|
|
481
|
+
└── alice/
|
|
482
|
+
├── memory.md
|
|
483
|
+
├── session.md
|
|
484
|
+
├── diary/
|
|
485
|
+
└── archive/
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### Multi-User Commands
|
|
489
|
+
|
|
490
|
+
| Command | What It Does |
|
|
491
|
+
| --- | --- |
|
|
492
|
+
| `./add-user.sh <name>` | Create a new profile (migrates single-user data if needed) |
|
|
493
|
+
| `./switch-user.sh` | List profiles and switch interactively |
|
|
494
|
+
| `./switch-user.sh <name>` | Switch to a specific profile directly |
|
|
495
|
+
| `./setup.sh` | Reconfigure the **active** profile's identity and preferences |
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
## Archiving
|
|
500
|
+
|
|
501
|
+
AI context windows have limits. When `memory.md` exceeds ~200 lines, details in the middle get lost. The archiving system keeps your memory lean while preserving history.
|
|
502
|
+
|
|
503
|
+
### What Gets Archived
|
|
504
|
+
|
|
505
|
+
| Entry Type | Trigger | Example |
|
|
506
|
+
| --- | --- | --- |
|
|
507
|
+
| **Completed projects** | Status is *done*, *completed*, *shipped*, *cancelled*, or *closed* | `API rewrite — Completed — shipped to prod` |
|
|
508
|
+
| **Old decisions** | Date older than 90 days (configurable) | `2024-11-01 — Chose PostgreSQL over MongoDB` |
|
|
509
|
+
|
|
510
|
+
Archived entries move to `archive/memory-archive.md`.
|
|
511
|
+
|
|
512
|
+
> [!IMPORTANT]
|
|
513
|
+
> **Archived memories are NOT lost.** The AI loads the archive file at the start of every conversation alongside `memory.md`. You don't need to do anything — old decisions and completed projects are still recalled automatically.
|
|
514
|
+
|
|
515
|
+
### How Recall Works
|
|
516
|
+
|
|
517
|
+
```text
|
|
518
|
+
Conversation starts
|
|
519
|
+
│
|
|
520
|
+
├─ 1. Read memory.md ← active memory (always loaded)
|
|
521
|
+
├─ 2. Read session.md ← last session recap (always loaded)
|
|
522
|
+
└─ 3. Read archive/memory-archive.md ← archived history (loaded if exists)
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
| Memory type | Stored in | Loaded automatically? | Purpose |
|
|
526
|
+
| --- | --- | --- | --- |
|
|
527
|
+
| **Active** | `memory.md` | Yes, always | Current identity, patterns, active projects |
|
|
528
|
+
| **Archived** | `archive/memory-archive.md` | Yes, if file exists | Past decisions, completed projects |
|
|
529
|
+
| **Session** | `session.md` | Yes, always | Previous session recap, working notes |
|
|
530
|
+
| **Diary** | `diary/YYYY-MM-DD.md` | On demand | Detailed daily logs (AI checks when asked) |
|
|
531
|
+
|
|
532
|
+
Archiving keeps `memory.md` lean (under 200 lines) while the AI still has full historical context through the archive file. Think of it like moving old emails to a folder — they're organized separately but still searchable.
|
|
533
|
+
|
|
534
|
+
### Automatic (during "save")
|
|
535
|
+
|
|
536
|
+
When you say **"save"**, the AI checks the line count. If `memory.md` is approaching 200 lines, it automatically archives eligible entries before saving new ones.
|
|
537
|
+
|
|
538
|
+
### Manual
|
|
539
|
+
|
|
540
|
+
```bash
|
|
541
|
+
./archive.sh # Interactive — previews what can be archived, asks to confirm
|
|
542
|
+
./archive.sh --days 60 # Archive decisions older than 60 days instead of the default 90
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
Example output:
|
|
546
|
+
|
|
547
|
+
```text
|
|
548
|
+
Memory Archive
|
|
549
|
+
|
|
550
|
+
Current size: 187 lines (approaching 200 limit)
|
|
551
|
+
|
|
552
|
+
Completed projects: 2
|
|
553
|
+
→ API rewrite
|
|
554
|
+
→ Auth migration
|
|
555
|
+
|
|
556
|
+
Decisions older than 90 days: 3
|
|
557
|
+
→ 2024-09-15: Chose PostgreSQL over MongoDB
|
|
558
|
+
→ 2024-10-01: Adopted trunk-based branching
|
|
559
|
+
→ 2024-11-20: Moved CI to GitHub Actions
|
|
560
|
+
|
|
561
|
+
Archive these entries? [Y/n]: y
|
|
562
|
+
|
|
563
|
+
✓ Archived 12 lines
|
|
564
|
+
✓ memory.md: 187 → 175 lines
|
|
565
|
+
✓ Archive: archive/memory-archive.md
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Accessing Archived Context
|
|
569
|
+
|
|
570
|
+
The AI can read `archive/memory-archive.md` when historical context is needed. Just ask:
|
|
571
|
+
|
|
572
|
+
> *"Check the archive — what database did we decide on last year?"*
|
|
573
|
+
|
|
574
|
+
---
|
|
575
|
+
|
|
576
|
+
## Advanced Features
|
|
577
|
+
|
|
578
|
+
### Time-Aware Behavior
|
|
579
|
+
|
|
580
|
+
The AI adapts its communication style based on the time of day. The current time is automatically injected into `session.md` at the start of each conversation — no configuration needed.
|
|
581
|
+
|
|
582
|
+
| Time | Tone |
|
|
583
|
+
| --- | --- |
|
|
584
|
+
| **Morning** (6–12) | Fresh, energetic, proactive |
|
|
585
|
+
| **Afternoon** (12–18) | Focused, productive, direct |
|
|
586
|
+
| **Evening** (18–22) | Relaxed, reflective, thorough |
|
|
587
|
+
| **Night** (22–6) | Calm, concise, gentle |
|
|
588
|
+
|
|
589
|
+
### Memory Recall
|
|
590
|
+
|
|
591
|
+
Can't remember when you made a decision? The recall system searches across all memory sources:
|
|
592
|
+
|
|
593
|
+
```bash
|
|
594
|
+
./recall.sh PostgreSQL # Search for a keyword
|
|
595
|
+
./recall.sh "API rewrite" # Search for a phrase
|
|
596
|
+
./recall.sh auth migration # Multiple keywords (OR)
|
|
597
|
+
```
|
|
598
|
+
|
|
599
|
+
The AI also does this automatically — if you ask about something not in active memory, it searches diary entries and the archive before responding. It will **never fabricate past events** — it searches for evidence first, and says "I'm not sure" if nothing is found.
|
|
600
|
+
|
|
601
|
+
```text
|
|
602
|
+
Memory Recall — searching for: PostgreSQL
|
|
603
|
+
|
|
604
|
+
Diary entries:
|
|
605
|
+
|
|
606
|
+
2026-03-15
|
|
607
|
+
L5: **Decisions**: Chose PostgreSQL over MongoDB for relational data
|
|
608
|
+
L8: Discussed migration plan from SQLite
|
|
609
|
+
|
|
610
|
+
Archive (memory-archive.md):
|
|
611
|
+
L12: | 2025-12-01 | Chose PostgreSQL over MongoDB | relational data needs |
|
|
612
|
+
|
|
613
|
+
Current memory (memory.md):
|
|
614
|
+
L28: - User prefers PostgreSQL for relational workloads
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
### Work Plans
|
|
618
|
+
|
|
619
|
+
Say **"plan"** to create a tracked work plan:
|
|
620
|
+
|
|
621
|
+
```markdown
|
|
622
|
+
# Plans
|
|
623
|
+
|
|
624
|
+
## API Migration — started 2026-03-19
|
|
625
|
+
|
|
626
|
+
- [x] Design new schema
|
|
627
|
+
- [x] Write migration script
|
|
628
|
+
- [ ] Test with staging data
|
|
629
|
+
- [ ] Deploy to production
|
|
630
|
+
- [ ] Monitor for 48 hours
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
Plans persist in `plans.md` across sessions. Progress is updated when you say "save". Completed plans are moved to the archive.
|
|
634
|
+
|
|
635
|
+
### Smart Project Management (LRU)
|
|
636
|
+
|
|
637
|
+
Active projects are capped at **10** in `memory.md`. The AI manages this automatically during "save":
|
|
638
|
+
|
|
639
|
+
- Projects not mentioned in 30+ days are archived
|
|
640
|
+
- Completed projects are always archived
|
|
641
|
+
- Archived projects are still searchable via recall
|
|
642
|
+
|
|
643
|
+
This prevents `memory.md` from growing unbounded while keeping recent work front and center.
|
|
644
|
+
|
|
645
|
+
### Diary Auto-Archiving
|
|
646
|
+
|
|
647
|
+
Diary entries from previous months are automatically moved to `diary/archive/YYYY-MM/` at the start of each conversation. Current month entries stay in `diary/` for quick access.
|
|
648
|
+
|
|
649
|
+
```text
|
|
650
|
+
diary/
|
|
651
|
+
2026-03-15.md ← current month, stays here
|
|
652
|
+
2026-03-18.md
|
|
653
|
+
archive/
|
|
654
|
+
2026-01/ ← previous months, auto-archived
|
|
655
|
+
2026-01-05.md
|
|
656
|
+
2026-01-12.md
|
|
657
|
+
2026-02/
|
|
658
|
+
2026-02-03.md
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
Archived diary entries are still searchable via `./recall.sh` and by the AI during recall.
|
|
662
|
+
|
|
663
|
+
### Session Size Guard
|
|
664
|
+
|
|
665
|
+
`session.md` is capped at **500 lines**. If Working Notes grow past this, the validation system warns you to save or trim. This prevents session bloat that degrades AI performance.
|
|
666
|
+
|
|
667
|
+
---
|
|
668
|
+
|
|
669
|
+
## FAQ
|
|
670
|
+
|
|
671
|
+
<details>
|
|
672
|
+
<summary><strong>Do I need to know how to code?</strong></summary>
|
|
673
|
+
|
|
674
|
+
<br>
|
|
675
|
+
|
|
676
|
+
No. You don't even need to run the setup wizard — just start a conversation and the AI will ask you a few friendly questions to get set up. After that, you just talk normally. The only "technical" thing is running the install command once to download the files.
|
|
677
|
+
|
|
678
|
+
</details>
|
|
679
|
+
|
|
680
|
+
<details>
|
|
681
|
+
<summary><strong>What if I forget to say "save"?</strong></summary>
|
|
682
|
+
|
|
683
|
+
<br>
|
|
684
|
+
|
|
685
|
+
Your working notes are automatically saved when the conversation ends. But only a manual "save" captures learned patterns and decisions intelligently. For casual conversations, auto-save is fine. For important sessions where you made decisions, say "save" before leaving.
|
|
686
|
+
|
|
687
|
+
</details>
|
|
688
|
+
|
|
689
|
+
<details>
|
|
690
|
+
<summary><strong>Can I use this with ChatGPT, Gemini, or other AIs?</strong></summary>
|
|
691
|
+
|
|
692
|
+
<br>
|
|
693
|
+
|
|
694
|
+
Yes! The automation (auto-save, validation) is Claude Code specific, but the memory files work with any AI. At the start of each conversation, paste:
|
|
695
|
+
|
|
696
|
+
> *"Read memory.md and session.md, then follow the instructions in CLAUDE.md for how to manage memory during our session."*
|
|
697
|
+
|
|
698
|
+
At the end, say: *"Save progress to memory.md and session.md."*
|
|
699
|
+
|
|
700
|
+
</details>
|
|
701
|
+
|
|
702
|
+
<details>
|
|
703
|
+
<summary><strong>What if memory gets too big?</strong></summary>
|
|
704
|
+
|
|
705
|
+
<br>
|
|
706
|
+
|
|
707
|
+
The AI handles this automatically during "save" by archiving old entries. You can also run `./archive.sh` manually. **Archived memories are NOT lost** — they're moved to a separate file that the AI still reads at the start of every conversation.
|
|
708
|
+
|
|
709
|
+
</details>
|
|
710
|
+
|
|
711
|
+
<details>
|
|
712
|
+
<summary><strong>Can multiple people use this on the same project?</strong></summary>
|
|
713
|
+
|
|
714
|
+
<br>
|
|
715
|
+
|
|
716
|
+
Yes! Run `./add-user.sh alice` to add a new profile. Each person gets their own separate memory, diary, and session. Switch between people with `./switch-user.sh`. See the [Multi-User](#multi-user) section for details.
|
|
717
|
+
|
|
718
|
+
</details>
|
|
719
|
+
|
|
720
|
+
<details>
|
|
721
|
+
<summary><strong>Is my data sent anywhere?</strong></summary>
|
|
722
|
+
|
|
723
|
+
<br>
|
|
724
|
+
|
|
725
|
+
No. Everything stays in plain text files on your computer. The AI reads these files during your conversation — they're never uploaded to any external service. You own and control your data completely.
|
|
726
|
+
|
|
727
|
+
</details>
|
|
728
|
+
|
|
729
|
+
<details>
|
|
730
|
+
<summary><strong>Can I edit the memory files manually?</strong></summary>
|
|
731
|
+
|
|
732
|
+
<br>
|
|
733
|
+
|
|
734
|
+
Yes! They're plain text (markdown) files. Open them in any text editor to review, correct, or delete entries. Just keep the section headings (lines starting with `##`) intact.
|
|
735
|
+
|
|
736
|
+
</details>
|
|
737
|
+
|
|
738
|
+
<details>
|
|
739
|
+
<summary><strong>What's the difference between memory, session, and diary?</strong></summary>
|
|
740
|
+
|
|
741
|
+
<br>
|
|
742
|
+
|
|
743
|
+
Think of it like this:
|
|
744
|
+
|
|
745
|
+
- **Memory** (`memory.md`) = your AI's brain — who you are, what you prefer, what you're working on. Persists forever.
|
|
746
|
+
- **Session** (`session.md`) = a sticky note for the current conversation. Thrown away and replaced each time.
|
|
747
|
+
- **Diary** (`diary/`) = a journal. One entry per day, never edited. Good for looking back at what happened.
|
|
748
|
+
|
|
749
|
+
</details>
|
|
750
|
+
|
|
751
|
+
---
|
|
752
|
+
|
|
753
|
+
## Troubleshooting
|
|
754
|
+
|
|
755
|
+
| Problem | Solution |
|
|
756
|
+
| --- | --- |
|
|
757
|
+
| AI doesn't remember me | Make sure you're in the right folder. Open `memory.md` — does it have your name? If not, just start a new conversation and the AI will guide you through setup. |
|
|
758
|
+
| "memory.md not found" error | Make sure you're inside the ai-memory folder. If the file is missing, run `./init.sh` to create it. |
|
|
759
|
+
| AI keeps asking my name | Setup wasn't completed. Start a new conversation — the AI will detect this and walk you through it. Or run `./setup.sh` manually. |
|
|
760
|
+
| Memory feels incomplete | Say **"save"** more often. Auto-save only captures working notes, not learned patterns. |
|
|
761
|
+
| "memory.md is over 200 lines" | Run `./archive.sh` to move old entries to the archive. Nothing is lost. |
|
|
762
|
+
| Session feels slow or repetitive | Session might be too long. Say **"save"**, then start a new conversation. |
|
|
763
|
+
| Wrong user profile active | Run `./switch-user.sh` to see who's active and switch if needed. |
|
|
764
|
+
| AI invents things that didn't happen | Say *"check the archive"* or *"search for X"* — the AI is instructed to search, not fabricate. |
|
|
765
|
+
|
|
766
|
+
---
|
|
767
|
+
|
|
768
|
+
## Known Limitations
|
|
769
|
+
|
|
770
|
+
| Limitation | Impact | Workaround |
|
|
771
|
+
| --- | --- | --- |
|
|
772
|
+
| AI might not update Working Notes | Auto-save has nothing to copy | Say "save" manually for important sessions |
|
|
773
|
+
| No cross-project memory | Each project has its own memory | Share `memory.md` manually if needed |
|
|
774
|
+
| Keyword search only | Recall uses keyword matching, not semantic search | Use specific keywords with `./recall.sh` |
|
|
775
|
+
| Context window cap | Very large archives may exceed AI context | Keep `memory.md` lean via archiving; archive is loaded but prioritized lower |
|
|
776
|
+
|
|
777
|
+
---
|
|
778
|
+
|
|
779
|
+
<div align="center">
|
|
780
|
+
|
|
781
|
+
## Credits
|
|
782
|
+
|
|
783
|
+
Inspired by [Project-AI-MemoryCore](https://github.com/Kiyoraka/Project-AI-MemoryCore) by Kiyoraka Ken & Alice
|
|
784
|
+
|
|
785
|
+
Simplified and enhanced by **Aman**
|
|
786
|
+
|
|
787
|
+
---
|
|
788
|
+
|
|
789
|
+
*Built for humans who want their AI to actually remember them.*
|
|
790
|
+
|
|
791
|
+
</div>
|