brain-memory 0.1.0-beta.3 → 0.1.0-beta.5
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 +59 -47
- package/bin/install.js +18 -235
- package/commands/brain/init.md +0 -8
- package/commands/brain/remember.md +2 -2
- package/commands/brain/sleep.md +0 -19
- package/commands/brain/status.md +12 -1
- package/commands/brain/sync.md +220 -0
- package/package.json +12 -4
- package/prompts/claude.md +55 -2
- package/prompts/gemini.md +55 -2
- package/prompts/openai.md +55 -2
- package/src/installer.js +231 -0
- package/src/sync/crypto-utils.js +217 -0
- package/src/sync/oauth.js +430 -0
- package/src/sync/provider.js +144 -0
- package/src/sync/providers/dropbox.js +288 -0
- package/src/sync/providers/google-drive.js +496 -0
- package/src/sync/providers/onedrive.js +308 -0
- package/src/sync/sync-engine.js +774 -0
- package/hooks/session-end.md +0 -48
- package/hooks/session-start.md +0 -48
package/hooks/session-end.md
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Brain Memory — Session End Hook
|
|
2
|
-
|
|
3
|
-
This hook is triggered at the end of a coding session. Its purpose is to prompt the agent to consider storing important memories and to save session context.
|
|
4
|
-
|
|
5
|
-
## Behavior
|
|
6
|
-
|
|
7
|
-
### Memory Suggestion
|
|
8
|
-
|
|
9
|
-
When a session ends, evaluate whether the session contained any of the following:
|
|
10
|
-
|
|
11
|
-
1. **Decisions** — Architecture choices, technology selections, trade-off resolutions
|
|
12
|
-
2. **Learnings** — New patterns, debugging insights, API discoveries
|
|
13
|
-
3. **Insights** — Realizations about the codebase, project, or process
|
|
14
|
-
4. **Experiences** — Significant events like incidents, deployments, milestones
|
|
15
|
-
5. **Goals** — New objectives discussed or planned
|
|
16
|
-
|
|
17
|
-
If the session contained meaningful content in any of these categories, suggest to the user:
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
💡 This session contained notable <type(s)>. Would you like to store them as brain memories?
|
|
21
|
-
Run /brain:memorize to capture them before this context is lost.
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Session Context Capture
|
|
25
|
-
|
|
26
|
-
If `.brain/contexts.json` exists, append a session summary:
|
|
27
|
-
|
|
28
|
-
```json
|
|
29
|
-
{
|
|
30
|
-
"session_id": "<timestamp-based-id>",
|
|
31
|
-
"started": "<session start ISO timestamp>",
|
|
32
|
-
"ended": "<session end ISO timestamp>",
|
|
33
|
-
"project": "<current project name>",
|
|
34
|
-
"topics": ["<key topics discussed>"],
|
|
35
|
-
"task_type": "<primary task type: debugging|implementing|designing|reviewing|discussing|learning>",
|
|
36
|
-
"memories_created": ["<IDs of memories stored this session>"],
|
|
37
|
-
"memories_recalled": ["<IDs of memories retrieved this session>"]
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Keep only the last 20 session entries in `contexts.json` to prevent unbounded growth.
|
|
42
|
-
|
|
43
|
-
**Rules:**
|
|
44
|
-
- Do NOT auto-memorize without user consent
|
|
45
|
-
- Do NOT prompt for trivial sessions (quick fixes, typo corrections, simple questions)
|
|
46
|
-
- Only suggest when there is genuinely valuable context worth preserving
|
|
47
|
-
- Keep the suggestion brief and non-intrusive
|
|
48
|
-
- Always save session context to `contexts.json` regardless of whether the user memorizes anything
|
package/hooks/session-start.md
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Brain Memory — Session Start Hook
|
|
2
|
-
|
|
3
|
-
This hook is triggered at the start of a coding session. Its purpose is to load relevant context from the brain memory system and capture session context for context-dependent recall.
|
|
4
|
-
|
|
5
|
-
## Behavior
|
|
6
|
-
|
|
7
|
-
At session start, if `.brain/index.json` exists:
|
|
8
|
-
|
|
9
|
-
1. **Read the index** to understand the current brain state
|
|
10
|
-
2. **Identify high-value memories** — the top 3-5 memories by effective strength that are relevant to the current project
|
|
11
|
-
3. **Silently load context** — internalize these memories so you can reference them naturally during the session
|
|
12
|
-
4. **Do NOT dump memories** — do not print memory contents at session start unless the user asks
|
|
13
|
-
|
|
14
|
-
### Context Capture
|
|
15
|
-
|
|
16
|
-
Capture the current session context for context-dependent recall:
|
|
17
|
-
- **Project name**: from the current working directory or project config
|
|
18
|
-
- **Topics**: inferred from recent files, open issues, or conversation
|
|
19
|
-
- **Task type**: will be determined as the session progresses
|
|
20
|
-
|
|
21
|
-
This context is used by `/brain:remember` to boost memories that were encoded in a similar context.
|
|
22
|
-
|
|
23
|
-
### Review Queue Check
|
|
24
|
-
|
|
25
|
-
Read `.brain/review-queue.json` if it exists. If there are memories due for review:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
🧠 Brain active — <N> memories loaded (<M> in current project context)
|
|
29
|
-
📋 <X> memories due for review — run /brain:review
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Otherwise:
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
🧠 Brain active — <N> memories loaded (<M> in current project context)
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Low-Confidence Alert
|
|
39
|
-
|
|
40
|
-
If any frequently-used memories (access_count >= 3) have confidence < 0.5, briefly note:
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
⚠️ <N> frequently-used memories have low confidence — consider verifying
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
**The goal is ambient awareness** — you should know about important past decisions, learnings, and preferences without explicitly reciting them. If a situation arises where a past memory is relevant, naturally reference it.
|
|
47
|
-
|
|
48
|
-
Keep the status output to 1-3 lines. The user can run `/brain:status` for details.
|