create-ai-memory 0.5.0 → 0.6.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/README.md +38 -0
- package/package.json +1 -1
- package/shell/ai-mem.zsh +11 -2
package/README.md
CHANGED
|
@@ -97,6 +97,44 @@ already have, every launch.
|
|
|
97
97
|
One environment variable, `AI_MEM_ROOT`, points at the vault, so the whole system
|
|
98
98
|
moves between machines by pointing at the same folder.
|
|
99
99
|
|
|
100
|
+
## The full loop
|
|
101
|
+
|
|
102
|
+
Agents read the vault through `ai-mem.zsh` at launch and write to it through a Stop
|
|
103
|
+
hook at close. You read the same files in Obsidian, or through `ai-mem-search` and
|
|
104
|
+
`ai-mem-lint`. Neither side gets a privileged interface — it's the same folder either way.
|
|
105
|
+
|
|
106
|
+
```mermaid
|
|
107
|
+
sequenceDiagram
|
|
108
|
+
autonumber
|
|
109
|
+
actor You
|
|
110
|
+
participant Shell as claude-start
|
|
111
|
+
participant Agent as Claude Code
|
|
112
|
+
participant Vault as _Ai_Memory
|
|
113
|
+
participant Backup as git backup (optional)
|
|
114
|
+
|
|
115
|
+
You->>Shell: claude-start
|
|
116
|
+
Shell->>Vault: read _Global_Profile.md + _Standards.md
|
|
117
|
+
Vault-->>Shell: full text
|
|
118
|
+
Shell->>Vault: read prior session's Session Outcome
|
|
119
|
+
Vault-->>Shell: Summary / Decisions / Blockers / Next
|
|
120
|
+
Shell->>Vault: create session log (project + previous wikilinks)
|
|
121
|
+
Shell->>Agent: launch, all of it as the first message
|
|
122
|
+
Note over You,Agent: the session's work happens here
|
|
123
|
+
You->>Agent: ai-note "..." (optional, mid-session)
|
|
124
|
+
Agent->>Vault: append to Live Notes
|
|
125
|
+
Note over Agent: session ends -- Stop hook fires
|
|
126
|
+
Agent->>Vault: rewrite Auto Session Log (branch, commits, changes)
|
|
127
|
+
Agent->>Backup: commit + push, if the vault is git-backed
|
|
128
|
+
Note over Vault: nothing overwritten -- a fresh file every session
|
|
129
|
+
You->>Shell: claude-start (next time)
|
|
130
|
+
Shell->>Vault: read prior session again
|
|
131
|
+
Note over Shell,Vault: now includes what just happened
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Everything through step 10 touches only files on your machine. Step 11 is the
|
|
135
|
+
only network call in the whole loop, and only exists if you set up a git-backed
|
|
136
|
+
vault yourself; skip that and everything stays local, always.
|
|
137
|
+
|
|
100
138
|
## See a full session
|
|
101
139
|
|
|
102
140
|
```console
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ai-memory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Persistent, agent-agnostic session memory for AI coding CLIs (Claude Code, Codex, Gemini, Cursor, opencode). One Markdown vault, any agent.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"create-ai-memory": "bin/create-ai-memory.js"
|
package/shell/ai-mem.zsh
CHANGED
|
@@ -591,7 +591,6 @@ ai-mem-lint() {
|
|
|
591
591
|
print -r -- "$issues issue(s) found"
|
|
592
592
|
fi
|
|
593
593
|
return $(( issues > 0 ? 1 : 0 ))
|
|
594
|
-
return $(( issues > 0 ? 1 : 0 ))
|
|
595
594
|
}
|
|
596
595
|
|
|
597
596
|
# Full-text search across the vault. Plain grep -- no new dependency, and at
|
|
@@ -622,7 +621,17 @@ ai-mem-search() {
|
|
|
622
621
|
return 1
|
|
623
622
|
fi
|
|
624
623
|
|
|
625
|
-
|
|
624
|
+
# Newest-first: for a time-series log the most recent match is usually the
|
|
625
|
+
# relevant one, so a large result set stays usable at a glance even without
|
|
626
|
+
# ranking. Sort key is the YYYY-MM-DD_HH-MM-SS embedded in the filename;
|
|
627
|
+
# lines with no such timestamp (e.g. _Global_Profile.md) sort last.
|
|
628
|
+
local sorted ts
|
|
629
|
+
sorted="$(print -r -- "$raw" | while IFS= read -r line; do
|
|
630
|
+
ts="$(print -r -- "$line" | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{2}-[0-9]{2}-[0-9]{2}' | head -1)"
|
|
631
|
+
print -r -- "${ts:-0000-00-00_00-00-00}|${line}"
|
|
632
|
+
done | sort -r | cut -d'|' -f2-)"
|
|
633
|
+
|
|
634
|
+
print -r -- "$sorted"
|
|
626
635
|
print -r -- "--"
|
|
627
636
|
print -r -- "$(print -r -- "$raw" | wc -l | tr -d ' ') match(es) for '$term'"
|
|
628
637
|
}
|