brain-memory 0.1.0-beta.23 β 0.1.0-beta.26
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 +25 -6
- package/assets/icon.png +0 -0
- package/assets/icon.svg +1 -27
- package/bin/brain.js +1 -1
- package/bin/cloud-sync.js +4 -3
- package/bin/install.js +1 -1
- package/commands/brain/status.md +1 -1
- package/package.json +2 -2
- package/prompts/claude.md +2 -2
- package/prompts/gemini.md +2 -2
- package/prompts/openai.md +2 -2
- package/prompts/opencode.md +2 -2
- package/src/index-manager.js +15 -1
- package/src/installer.js +5 -1
package/README.md
CHANGED
|
@@ -146,7 +146,7 @@ When a session begins and `~/.brain/` exists, the agent makes a single `brain se
|
|
|
146
146
|
4. **Review queue + low-confidence alerts**, then a brief status line:
|
|
147
147
|
|
|
148
148
|
```
|
|
149
|
-
|
|
149
|
+
β Brain active β 42 memories loaded (8 in current project context)
|
|
150
150
|
π 3 memories due for review β reinforced automatically during /brain:sleep
|
|
151
151
|
```
|
|
152
152
|
|
|
@@ -161,7 +161,7 @@ Throughout the session, the agent maintains a running mental log of notable even
|
|
|
161
161
|
Every ~10 substantive interactions (file edits, architecture decisions, debugging breakthroughs), the agent evaluates whether memorizable content has accumulated. If so, it appends a brief reminder to its next response:
|
|
162
162
|
|
|
163
163
|
```
|
|
164
|
-
|
|
164
|
+
β Notable decisions and learnings this session β /brain:memorize when ready
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
This never interrupts your flow β it's a one-liner appended to an existing response, at most once per ~10 interactions. The counter resets after you run `/brain:memorize`.
|
|
@@ -452,13 +452,21 @@ Brain Memory is **model-agnostic** as well as agent-portable: because memory is
|
|
|
452
452
|
|
|
453
453
|
To share memories across different machines, use `/brain:sync` (see below).
|
|
454
454
|
|
|
455
|
-
### Portable Sync
|
|
455
|
+
### Portable Sync β your memory, no lock-in
|
|
456
456
|
|
|
457
|
-
|
|
457
|
+
**Your brain is plain files in a folder β sync it however you already sync files.** No account or cloud provider is required.
|
|
458
458
|
|
|
459
|
-
**
|
|
459
|
+
**Any synced folder** β Point `BRAIN_DIR` at a folder your existing tools already sync, and you're done:
|
|
460
460
|
|
|
461
|
-
|
|
461
|
+
```bash
|
|
462
|
+
export BRAIN_DIR="$HOME/Google Drive/brain" # or Dropbox, iCloud Drive, OneDrive, Syncthingβ¦
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
**Git remote** β `/brain:sync` push/pull `~/.brain/` to any private Git repository (GitHub, GitLab, Codeberg, or self-hosted), using your existing Git/SSH auth.
|
|
466
|
+
|
|
467
|
+
**Export/Import** β Pack the entire brain into a single encrypted file for manual transfer via USB, email, or any file-sharing service.
|
|
468
|
+
|
|
469
|
+
**Brain Cloud** (optional) β A hosted, zero-config hub if you'd rather not run your own. Entirely optional β everything above works without it.
|
|
462
470
|
|
|
463
471
|
**Key features:**
|
|
464
472
|
- **Manual push/pull** β No background watchers, no auto-sync. You control when data moves.
|
|
@@ -475,6 +483,17 @@ For one-off transfers, use `/brain:sync export` and `/brain:sync import <path>`.
|
|
|
475
483
|
|
|
476
484
|
Sync state is stored locally in `~/.brain/.sync/` and is never pushed to the remote.
|
|
477
485
|
|
|
486
|
+
### Brain in Claude apps (web & mobile) β beta
|
|
487
|
+
|
|
488
|
+
Beyond the CLI, you can use your brain from the **Claude apps** (web, desktop, and your
|
|
489
|
+
**phone**) via the **Brain connector** β a remote MCP server hosted by [Brain Cloud](https://app.brainmemory.ai).
|
|
490
|
+
Add it once on claude.ai (**Settings β Connectors β Add custom connector β `https://mcp.brainmemory.ai/mcp`**),
|
|
491
|
+
sign in with the Google account holding your cloud brain, and it syncs to every Claude client on
|
|
492
|
+
your account. Read **and write**: recall + status, plus memorize / pin / unpin (writes prompt for
|
|
493
|
+
confirmation) β so you can capture a memory on your phone and recall it on your laptop.
|
|
494
|
+
|
|
495
|
+
β Full guide: **[Use Brain in Claude apps](https://brainmemory.ai/docs/getting-started/claude-apps)**
|
|
496
|
+
|
|
478
497
|
## File Structure
|
|
479
498
|
|
|
480
499
|
```
|
package/assets/icon.png
CHANGED
|
Binary file
|
package/assets/icon.svg
CHANGED
|
@@ -1,27 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0
|
|
2
|
-
<defs>
|
|
3
|
-
<radialGradient id="bm-glow" cx="50%" cy="50%" r="50%">
|
|
4
|
-
<stop offset="0%" stop-color="#FFD27A" stop-opacity="0.9"/>
|
|
5
|
-
<stop offset="100%" stop-color="#E8A33D" stop-opacity="0"/>
|
|
6
|
-
</radialGradient>
|
|
7
|
-
</defs>
|
|
8
|
-
<rect x="0" y="0" width="1024" height="1024" rx="224" ry="224" fill="#07090A"/>
|
|
9
|
-
<circle cx="512" cy="512" r="384" fill="url(#bm-glow)" opacity="0.7"/>
|
|
10
|
-
<g stroke="#E8A33D" stroke-width="38" stroke-linecap="round">
|
|
11
|
-
<line x1="512" y1="512" x2="256" y2="256" stroke-opacity="0.4"/>
|
|
12
|
-
<line x1="512" y1="512" x2="800" y2="256" stroke-opacity="0.82"/>
|
|
13
|
-
<line x1="512" y1="512" x2="864" y2="544" stroke-opacity="0.5"/>
|
|
14
|
-
<line x1="512" y1="512" x2="768" y2="800" stroke-opacity="0.75"/>
|
|
15
|
-
<line x1="512" y1="512" x2="256" y2="736" stroke-opacity="0.4"/>
|
|
16
|
-
<line x1="512" y1="512" x2="192" y2="512" stroke-opacity="0.35"/>
|
|
17
|
-
</g>
|
|
18
|
-
<circle cx="256" cy="256" r="51" fill="#9A6E28"/>
|
|
19
|
-
<circle cx="864" cy="544" r="45" fill="#DCA044"/>
|
|
20
|
-
<circle cx="768" cy="800" r="61" fill="#F0B24A"/>
|
|
21
|
-
<circle cx="256" cy="736" r="51" fill="#A9762E"/>
|
|
22
|
-
<circle cx="192" cy="512" r="42" fill="#8A6022"/>
|
|
23
|
-
<circle cx="800" cy="256" r="83" fill="#FFDD8C"/>
|
|
24
|
-
<circle cx="672" cy="368" r="42" fill="#FFF0CC"/>
|
|
25
|
-
<circle cx="512" cy="512" r="118" fill="#FFF2D2"/>
|
|
26
|
-
<circle cx="512" cy="512" r="61" fill="#FFFFFF"/>
|
|
27
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="1024" height="1024" role="img" aria-label="Brain Memory"><defs><filter id="bi0-lg" x="-20%" y="-20%" width="140%" height="140%"><feGaussianBlur stdDeviation="1.6"/></filter><radialGradient id="bi0-g0"><stop offset="0%" stop-color="#adb5c2" stop-opacity="1.00"/><stop offset="100%" stop-color="#5A6B84" stop-opacity="0"/></radialGradient><radialGradient id="bi0-g1"><stop offset="0%" stop-color="#b7d4eb" stop-opacity="0.66"/><stop offset="100%" stop-color="#6FA8D6" stop-opacity="0"/></radialGradient><radialGradient id="bi0-g2"><stop offset="0%" stop-color="#f8d09f" stop-opacity="0.67"/><stop offset="100%" stop-color="#F0A03E" stop-opacity="0"/></radialGradient><radialGradient id="bi0-g3"><stop offset="0%" stop-color="#9fc7c7" stop-opacity="0.80"/><stop offset="100%" stop-color="#3F8E8E" stop-opacity="0"/></radialGradient><radialGradient id="bi0-g4"><stop offset="0%" stop-color="#fae1a5" stop-opacity="0.70"/><stop offset="100%" stop-color="#F5C24B" stop-opacity="0"/></radialGradient></defs><rect x="0" y="0" width="256" height="256" rx="56" ry="56" fill="#07090A"/><g filter="url(#bi0-lg)" opacity="0.9"><line x1="128" y1="128" x2="138.9" y2="230.8" stroke="#658aad" stroke-width="3.71" stroke-opacity="0.40" stroke-linecap="round"/><line x1="128" y1="128" x2="231.4" y2="127.5" stroke="#a89768" stroke-width="3.84" stroke-opacity="0.42" stroke-linecap="round"/><line x1="128" y1="128" x2="24.8" y2="134.6" stroke="#a58661" stroke-width="3.73" stroke-opacity="0.41" stroke-linecap="round"/><line x1="138.9" y1="230.8" x2="231.4" y2="127.5" stroke="#b2b591" stroke-width="2.75" stroke-opacity="0.30" stroke-linecap="round"/><line x1="138.9" y1="230.8" x2="24.8" y2="134.6" stroke="#b0a48a" stroke-width="2.64" stroke-opacity="0.29" stroke-linecap="round"/><line x1="24.8" y1="134.6" x2="122.7" y2="24.7" stroke="#989766" stroke-width="3.10" stroke-opacity="0.34" stroke-linecap="round"/><line x1="128" y1="128" x2="122.7" y2="24.7" stroke="#4d7d89" stroke-width="4.18" stroke-opacity="0.45" stroke-linecap="round"/><line x1="122.7" y1="24.7" x2="231.4" y2="127.5" stroke="#9aa86d" stroke-width="3.22" stroke-opacity="0.35" stroke-linecap="round"/></g><circle cx="128" cy="128" r="62.40" fill="url(#bi0-g0)"/><circle cx="128" cy="128" r="18.72" fill="#dbdee4" fill-opacity="1.00"/><circle cx="138.9" cy="230.8" r="34.66" fill="url(#bi0-g1)"/><circle cx="138.9" cy="230.8" r="10.40" fill="#dfecf6" fill-opacity="0.80"/><circle cx="24.8" cy="134.6" r="35.06" fill="url(#bi0-g2)"/><circle cx="24.8" cy="134.6" r="10.52" fill="#fcead5" fill-opacity="0.80"/><circle cx="122.7" cy="24.7" r="46.49" fill="url(#bi0-g3)"/><circle cx="122.7" cy="24.7" r="13.95" fill="#d5e6e6" fill-opacity="0.88"/><circle cx="231.4" cy="127.5" r="37.92" fill="url(#bi0-g4)"/><circle cx="231.4" cy="127.5" r="11.38" fill="#fdf2d7" fill-opacity="0.82"/></svg>
|
package/bin/brain.js
CHANGED
|
@@ -40,7 +40,7 @@ const DELEGATED = {
|
|
|
40
40
|
// `npx brain-memory` via npm's single-bin fallback.
|
|
41
41
|
const INSTALLER = new Set(['install', 'update', 'uninstall']);
|
|
42
42
|
|
|
43
|
-
const HELP =
|
|
43
|
+
const HELP = `β brain β Brain Memory CLI
|
|
44
44
|
|
|
45
45
|
Usage: brain <command> [options]
|
|
46
46
|
|
package/bin/cloud-sync.js
CHANGED
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
* brain cloud status Show connection and sync status
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
const path = require('path');
|
|
15
|
-
const os = require('os');
|
|
16
14
|
const cloud = require('../src/cloud-sync');
|
|
15
|
+
const { getBrainDir } = require('../src/index-manager');
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
// Resolved via getBrainDir so Cloud sync targets the same brain as the rest of
|
|
18
|
+
// the CLI, including a $BRAIN_DIR override (synced folder, git working copy, β¦).
|
|
19
|
+
const BRAIN_DIR = getBrainDir();
|
|
19
20
|
|
|
20
21
|
async function main() {
|
|
21
22
|
const args = process.argv.slice(2);
|
package/bin/install.js
CHANGED
|
@@ -306,7 +306,7 @@ async function main() {
|
|
|
306
306
|
console.log(`
|
|
307
307
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
308
308
|
β β
|
|
309
|
-
β
|
|
309
|
+
β β Brain Memory β Installer β
|
|
310
310
|
β β
|
|
311
311
|
β Hierarchical memory system for AI coding agents β
|
|
312
312
|
β β
|
package/commands/brain/status.md
CHANGED
|
@@ -41,7 +41,7 @@ Calculate aggregate stats:
|
|
|
41
41
|
|
|
42
42
|
```
|
|
43
43
|
ββββββββββββββββββββββββββββββββββββββββββββ
|
|
44
|
-
β
|
|
44
|
+
β β BRAIN STATUS β
|
|
45
45
|
β βββββββββββββββββββββββββββββββββββββββββββ£
|
|
46
46
|
β Total Memories: <count> β
|
|
47
47
|
β Archived: <count> β
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brain-memory",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.26",
|
|
4
4
|
"description": "A brain-inspired hierarchical memory system for AI coding agents. Deep nested file structure that mimics human memory with time-decay and strength-based recall.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude-code",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"url": "git+https://github.com/omelas-tech/brain.git"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
|
-
"test": "node --test test/index-manager.test.js test/scorer.test.js test/tfidf.test.js test/recall.test.js test/functional.test.js test/
|
|
45
|
+
"test": "node --test test/index-manager.test.js test/scorer.test.js test/tfidf.test.js test/recall.test.js test/functional.test.js test/erasure.test.js test/stress.test.js test/crypto.test.js test/git-sync.test.js test/cloud-sync.test.js test/export-import.test.js test/install.test.js test/prompts.test.js test/session-start.test.js test/memorize.test.js test/pinning.test.js test/skills.test.js test/contradiction.test.js",
|
|
46
46
|
"prerelease": "npm test",
|
|
47
47
|
"release:beta": "npm version prerelease --preid beta && npm publish --tag beta && npm dist-tag add brain-memory@$(node -p \"require('./package.json').version\") latest",
|
|
48
48
|
"release:patch": "npm version patch && npm publish",
|
package/prompts/claude.md
CHANGED
|
@@ -79,7 +79,7 @@ If `~/.brain/index.json` exists:
|
|
|
79
79
|
3. **Output a single status line:**
|
|
80
80
|
|
|
81
81
|
```
|
|
82
|
-
|
|
82
|
+
β Brain active β <N> memories (<M> in project context)
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
Only add extra lines if actionable:
|
|
@@ -108,7 +108,7 @@ Track these categories as they happen:
|
|
|
108
108
|
If notable items have accumulated, append a **brief one-liner** at the end of your next natural response:
|
|
109
109
|
|
|
110
110
|
```
|
|
111
|
-
|
|
111
|
+
β Notable <type(s)> this session β /brain:memorize when ready
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
**Rules:**
|
package/prompts/gemini.md
CHANGED
|
@@ -80,7 +80,7 @@ If `~/.brain/index.json` exists:
|
|
|
80
80
|
3. **Output a single status line:**
|
|
81
81
|
|
|
82
82
|
```
|
|
83
|
-
|
|
83
|
+
β Brain active β <N> memories (<M> in project context)
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
Only add extra lines if actionable:
|
|
@@ -109,7 +109,7 @@ Track these categories as they happen:
|
|
|
109
109
|
If notable items have accumulated, append a **brief one-liner** at the end of your next natural response:
|
|
110
110
|
|
|
111
111
|
```
|
|
112
|
-
|
|
112
|
+
β Notable <type(s)> this session β /brain:memorize when ready
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
**Rules:**
|
package/prompts/openai.md
CHANGED
|
@@ -80,7 +80,7 @@ If `.brain/index.json` exists:
|
|
|
80
80
|
3. **Output a single status line:**
|
|
81
81
|
|
|
82
82
|
```
|
|
83
|
-
|
|
83
|
+
β Brain active β <N> memories (<M> in project context)
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
Only add extra lines if actionable:
|
|
@@ -109,7 +109,7 @@ Track these categories as they happen:
|
|
|
109
109
|
If notable items have accumulated, append a **brief one-liner** at the end of your next natural response:
|
|
110
110
|
|
|
111
111
|
```
|
|
112
|
-
|
|
112
|
+
β Notable <type(s)> this session β /brain-memorize when ready
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
**Rules:**
|
package/prompts/opencode.md
CHANGED
|
@@ -79,7 +79,7 @@ It returns JSON with `memory_count`, `pinned` (always-apply conventions/preferen
|
|
|
79
79
|
3. **Output a single status line:**
|
|
80
80
|
|
|
81
81
|
```
|
|
82
|
-
|
|
82
|
+
β Brain active β <N> memories (<M> in project context)
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
Only add extra lines if actionable:
|
|
@@ -108,7 +108,7 @@ Track these categories as they happen:
|
|
|
108
108
|
If notable items have accumulated, append a **brief one-liner** at the end of your next natural response:
|
|
109
109
|
|
|
110
110
|
```
|
|
111
|
-
|
|
111
|
+
β Notable <type(s)> this session β /brain:memorize when ready
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
**Rules:**
|
package/src/index-manager.js
CHANGED
|
@@ -63,11 +63,25 @@ function validateBrainPath(targetPath, brainDir) {
|
|
|
63
63
|
/**
|
|
64
64
|
* Resolve the brain directory path.
|
|
65
65
|
*
|
|
66
|
+
* Precedence: explicit `overrideBase` arg (tests / project-local brains) >
|
|
67
|
+
* the `BRAIN_DIR` environment variable (point your brain at any synced folder β
|
|
68
|
+
* Google Drive, Dropbox, iCloud, a git working copy, β¦) > the default `~/.brain`.
|
|
69
|
+
*
|
|
70
|
+
* `BRAIN_DIR` is the brain directory itself (the folder holding `index.json`),
|
|
71
|
+
* not a parent. A leading `~/` is expanded since env vars are not shell-expanded.
|
|
72
|
+
*
|
|
66
73
|
* @param {string} [overrideBase] - Override base directory (for testing)
|
|
67
|
-
* @returns {string} Absolute path to
|
|
74
|
+
* @returns {string} Absolute path to the brain directory
|
|
68
75
|
*/
|
|
69
76
|
function getBrainDir(overrideBase) {
|
|
70
77
|
if (overrideBase) return path.join(overrideBase, '.brain');
|
|
78
|
+
const env = process.env.BRAIN_DIR && process.env.BRAIN_DIR.trim();
|
|
79
|
+
if (env) {
|
|
80
|
+
const expanded = env === '~' || env.startsWith('~/')
|
|
81
|
+
? path.join(os.homedir(), env.slice(1))
|
|
82
|
+
: env;
|
|
83
|
+
return path.resolve(expanded);
|
|
84
|
+
}
|
|
71
85
|
return DEFAULT_BRAIN_DIR;
|
|
72
86
|
}
|
|
73
87
|
|
package/src/installer.js
CHANGED
|
@@ -2,6 +2,8 @@ const fs = require('fs');
|
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const os = require('os');
|
|
4
4
|
|
|
5
|
+
const { getBrainDir } = require('./index-manager');
|
|
6
|
+
|
|
5
7
|
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
6
8
|
|
|
7
9
|
const RUNTIMES = {
|
|
@@ -254,7 +256,9 @@ function installForRuntime(runtime, scope) {
|
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
function initializeBrain(overrideBase) {
|
|
257
|
-
|
|
259
|
+
// Honors $BRAIN_DIR (via getBrainDir) so a fresh brain is created wherever the
|
|
260
|
+
// user points it β e.g. inside a Google Drive / Dropbox / iCloud synced folder.
|
|
261
|
+
const brainDir = overrideBase ? path.join(overrideBase, '.brain') : getBrainDir();
|
|
258
262
|
|
|
259
263
|
if (fs.existsSync(brainDir)) {
|
|
260
264
|
return { alreadyExists: true };
|