apsolut-cortex 0.1.0 → 0.1.2
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 +62 -43
- package/dist/cli.js +16 -794
- package/dist/hooks/post-tool-use.js +3 -5344
- package/dist/hooks/session-end.js +280 -37949
- package/dist/hooks/session-start.js +2 -786
- package/dist/hooks/stop.js +2 -786
- package/dist/mcp/server.js +203 -47737
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,86 +3,105 @@
|
|
|
3
3
|
Persistent memory for Claude Code projects.
|
|
4
4
|
|
|
5
5
|
Stores corrections, decisions, and patterns across sessions so Claude stops
|
|
6
|
-
repeating the same mistakes and forgetting what you
|
|
6
|
+
repeating the same mistakes and forgetting what you decided last week.
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
## Install
|
|
10
|
+
## Install
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
|
|
14
|
-
git clone ... apsolut-cortex
|
|
15
|
-
cd apsolut-cortex
|
|
16
|
-
bun install
|
|
13
|
+
npm install -g apsolut-cortex
|
|
17
14
|
```
|
|
18
15
|
|
|
19
16
|
## Per project
|
|
20
17
|
|
|
21
18
|
```bash
|
|
22
|
-
cd
|
|
23
|
-
|
|
19
|
+
cd your-project
|
|
20
|
+
apsolut-cortex init
|
|
24
21
|
```
|
|
25
22
|
|
|
26
23
|
Restart Claude Code. Done.
|
|
27
24
|
|
|
25
|
+
---
|
|
26
|
+
|
|
28
27
|
## How it works
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
Sessions start clean — no context dumped automatically.
|
|
30
|
+
Memory is on demand. Say `"remember <topic>"` and Claude searches.
|
|
31
|
+
|
|
32
|
+
**During sessions (automatic):**
|
|
33
|
+
- Tool failures captured and stored
|
|
34
|
+
- Config file reads noted as discoveries
|
|
35
|
+
- Transcript scanned for self-corrections when Claude stops
|
|
34
36
|
|
|
35
|
-
**At session end:**
|
|
37
|
+
**At session end (automatic):**
|
|
36
38
|
- Observations compressed into memories via Claude Haiku
|
|
37
|
-
-
|
|
38
|
-
- Session summary stored for
|
|
39
|
-
- Stale memories decay, low-value ones
|
|
39
|
+
- Fallback: Ollama if no API key
|
|
40
|
+
- Session summary stored for continuity
|
|
41
|
+
- Stale memories decay, low-value ones pruned over time
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
Sessions start clean. Claude uses `memory_search` when it needs context,
|
|
43
|
-
not speculatively at the start of every session.
|
|
43
|
+
---
|
|
44
44
|
|
|
45
45
|
## MCP tools Claude can call
|
|
46
46
|
|
|
47
|
-
| Tool | When
|
|
48
|
-
|
|
49
|
-
| `memory_search(query)` |
|
|
50
|
-
| `memory_store(content, category, tier)` | After
|
|
51
|
-
| `memory_rate(id, score)` | After using a retrieved memory (0
|
|
47
|
+
| Tool | When |
|
|
48
|
+
|------|------|
|
|
49
|
+
| `memory_search(query)` | User says "remember X" or Claude is uncertain |
|
|
50
|
+
| `memory_store(content, category, tier)` | After a decision or discovery |
|
|
51
|
+
| `memory_rate(id, score)` | After using a retrieved memory (0–3) |
|
|
52
52
|
| `memory_contradict(id, correction?)` | When a memory is wrong |
|
|
53
53
|
| `memory_status()` | Overview of what's stored |
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
`observed` → `validated` → `proven` → `canonical`
|
|
58
|
-
|
|
59
|
-
Observed: just captured. Validated: rated useful 3+ times. Proven/Canonical: human
|
|
60
|
-
promotion only (future dashboard).
|
|
55
|
+
---
|
|
61
56
|
|
|
62
57
|
## Compression providers
|
|
63
58
|
|
|
64
|
-
|
|
65
|
-
2. Ollama at `localhost:11434` → `qwen2.5-coder:7b` by default
|
|
66
|
-
- Override model: `CORTEX_OLLAMA_MODEL=llama3.1`
|
|
67
|
-
- Override host: `OLLAMA_HOST=http://...`
|
|
68
|
-
3. Neither available → loud error, observations saved for next session
|
|
59
|
+
Set one of these or cortex will fail loudly at session end:
|
|
69
60
|
|
|
70
|
-
|
|
61
|
+
**Option 1 — Anthropic API**
|
|
62
|
+
```bash
|
|
63
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
64
|
+
```
|
|
71
65
|
|
|
66
|
+
**Option 2 — Ollama (free, local, private)**
|
|
72
67
|
```bash
|
|
73
|
-
|
|
68
|
+
ollama pull qwen2.5-coder:7b
|
|
69
|
+
ollama serve
|
|
74
70
|
```
|
|
75
71
|
|
|
76
|
-
|
|
72
|
+
Override model: `CORTEX_OLLAMA_MODEL=llama3.1`
|
|
73
|
+
Override host: `OLLAMA_HOST=http://localhost:11434`
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Commands
|
|
77
78
|
|
|
78
79
|
```bash
|
|
79
|
-
|
|
80
|
+
apsolut-cortex init # set up memory for this project
|
|
81
|
+
apsolut-cortex status # show what's stored
|
|
82
|
+
apsolut-cortex uninstall # remove hooks and MCP config
|
|
80
83
|
```
|
|
81
84
|
|
|
82
|
-
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Storage
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
~/.apsolut/
|
|
91
|
+
├── memory.db ← all memories, all projects, SQLite
|
|
92
|
+
├── registry.json ← project registry
|
|
93
|
+
└── models/ ← embedding model cache (downloads once)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
All projects share one DB, namespaced by project UUID.
|
|
97
|
+
No data leaves your machine except what you send to the Anthropic API
|
|
98
|
+
for session compression.
|
|
83
99
|
|
|
84
100
|
---
|
|
85
101
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
102
|
+
## Memory trust levels
|
|
103
|
+
|
|
104
|
+
`observed` → `validated` → `proven` → `canonical`
|
|
105
|
+
|
|
106
|
+
Starts at observed. Promoted automatically as memories prove useful.
|
|
107
|
+
Canonical memories never decay.
|