mindlore 0.6.7 → 0.6.8
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 +259 -259
- package/SCHEMA.md +292 -292
- package/dist/scripts/cc-memory-bulk-sync.d.ts.map +1 -1
- package/dist/scripts/cc-memory-bulk-sync.js +47 -42
- package/dist/scripts/cc-memory-bulk-sync.js.map +1 -1
- package/dist/scripts/cc-session-sync.d.ts.map +1 -1
- package/dist/scripts/cc-session-sync.js +58 -48
- package/dist/scripts/cc-session-sync.js.map +1 -1
- package/dist/scripts/init.js +8 -8
- package/dist/scripts/init.js.map +1 -1
- package/dist/scripts/lib/all-migrations.d.ts.map +1 -1
- package/dist/scripts/lib/all-migrations.js +4 -1
- package/dist/scripts/lib/all-migrations.js.map +1 -1
- package/dist/scripts/lib/consolidation.d.ts +4 -3
- package/dist/scripts/lib/consolidation.d.ts.map +1 -1
- package/dist/scripts/lib/consolidation.js +10 -10
- package/dist/scripts/lib/consolidation.js.map +1 -1
- package/dist/scripts/lib/constants.d.ts +1 -7
- package/dist/scripts/lib/constants.d.ts.map +1 -1
- package/dist/scripts/lib/constants.js +2 -9
- package/dist/scripts/lib/constants.js.map +1 -1
- package/dist/scripts/lib/db-helpers.d.ts +0 -15
- package/dist/scripts/lib/db-helpers.d.ts.map +1 -1
- package/dist/scripts/lib/db-helpers.js +1 -51
- package/dist/scripts/lib/db-helpers.js.map +1 -1
- package/dist/scripts/lib/decay.d.ts.map +1 -1
- package/dist/scripts/lib/decay.js +9 -9
- package/dist/scripts/lib/decay.js.map +1 -1
- package/dist/scripts/lib/episodes.js +23 -23
- package/dist/scripts/lib/migrations-v061.js +21 -21
- package/dist/scripts/lib/migrations-v062.js +11 -11
- package/dist/scripts/lib/migrations-v063.js +14 -14
- package/dist/scripts/lib/migrations-v067.js +11 -11
- package/dist/scripts/lib/migrations-v068.d.ts +3 -0
- package/dist/scripts/lib/migrations-v068.d.ts.map +1 -0
- package/dist/scripts/lib/migrations-v068.js +37 -0
- package/dist/scripts/lib/migrations-v068.js.map +1 -0
- package/dist/scripts/lib/migrations.d.ts.map +1 -1
- package/dist/scripts/lib/migrations.js +0 -15
- package/dist/scripts/lib/migrations.js.map +1 -1
- package/dist/scripts/lib/schema-version.js +6 -6
- package/dist/scripts/lib/search-cache.js +11 -11
- package/dist/scripts/lib/session-payload.d.ts.map +1 -1
- package/dist/scripts/lib/session-payload.js +7 -7
- package/dist/scripts/lib/session-payload.js.map +1 -1
- package/dist/scripts/lib/triage.js +3 -3
- package/dist/scripts/mindlore-backup.js +9 -9
- package/dist/scripts/mindlore-fts5-index.d.ts +1 -2
- package/dist/scripts/mindlore-fts5-index.d.ts.map +1 -1
- package/dist/scripts/mindlore-fts5-index.js +12 -64
- package/dist/scripts/mindlore-fts5-index.js.map +1 -1
- package/dist/scripts/mindlore-health-check.d.ts.map +1 -1
- package/dist/scripts/mindlore-health-check.js +0 -11
- package/dist/scripts/mindlore-health-check.js.map +1 -1
- package/dist/tests/cc-memory-bulk-sync.test.js +23 -0
- package/dist/tests/cc-memory-bulk-sync.test.js.map +1 -1
- package/dist/tests/cc-session-sync.test.js +25 -0
- package/dist/tests/cc-session-sync.test.js.map +1 -1
- package/dist/tests/compaction-snapshot.test.js +2 -2
- package/dist/tests/consolidation.test.js +5 -5
- package/dist/tests/consolidation.test.js.map +1 -1
- package/dist/tests/decay.test.js +9 -9
- package/dist/tests/diary.test.js +4 -4
- package/dist/tests/episode-kind-constant.test.d.ts +2 -0
- package/dist/tests/episode-kind-constant.test.d.ts.map +1 -0
- package/dist/tests/episode-kind-constant.test.js +28 -0
- package/dist/tests/episode-kind-constant.test.js.map +1 -0
- package/dist/tests/episodes-inject.test.js +9 -9
- package/dist/tests/fts5.test.js +66 -125
- package/dist/tests/fts5.test.js.map +1 -1
- package/dist/tests/globalSetup.d.ts +2 -0
- package/dist/tests/globalSetup.d.ts.map +1 -0
- package/dist/tests/globalSetup.js +36 -0
- package/dist/tests/globalSetup.js.map +1 -0
- package/dist/tests/helpers/db.d.ts +13 -5
- package/dist/tests/helpers/db.d.ts.map +1 -1
- package/dist/tests/helpers/db.js +60 -33
- package/dist/tests/helpers/db.js.map +1 -1
- package/dist/tests/lesson-graduation.test.js +11 -11
- package/dist/tests/lesson-graduation.test.js.map +1 -1
- package/dist/tests/migrations-v053.test.js +16 -16
- package/dist/tests/migrations-v061.test.js +10 -10
- package/dist/tests/migrations-v063.test.js +2 -2
- package/dist/tests/migrations-v068.test.d.ts +2 -0
- package/dist/tests/migrations-v068.test.d.ts.map +1 -0
- package/dist/tests/migrations-v068.test.js +53 -0
- package/dist/tests/migrations-v068.test.js.map +1 -0
- package/dist/tests/nomination-counts.test.d.ts +2 -0
- package/dist/tests/nomination-counts.test.d.ts.map +1 -0
- package/dist/tests/nomination-counts.test.js +51 -0
- package/dist/tests/nomination-counts.test.js.map +1 -0
- package/dist/tests/recall-telemetry.test.js +8 -8
- package/dist/tests/schema-version.test.js +3 -7
- package/dist/tests/schema-version.test.js.map +1 -1
- package/dist/tests/search-hook.test.js +2 -2
- package/dist/tests/sec-regression.test.js +0 -50
- package/dist/tests/sec-regression.test.js.map +1 -1
- package/dist/tests/session-end-cleanup.test.js +3 -20
- package/dist/tests/session-end-cleanup.test.js.map +1 -1
- package/dist/tests/session-focus.test.js +7 -30
- package/dist/tests/session-focus.test.js.map +1 -1
- package/dist/tests/session-payload.test.js +1 -1
- package/dist/tests/session-summary.test.js +1 -1
- package/hooks/lib/constants.cjs +15 -0
- package/hooks/lib/mindlore-common.cjs +974 -1042
- package/hooks/mindlore-cwd-changed.cjs +57 -57
- package/hooks/mindlore-decision-detector.cjs +54 -54
- package/hooks/mindlore-dont-repeat.cjs +222 -222
- package/hooks/mindlore-fts5-sync.cjs +97 -88
- package/hooks/mindlore-index.cjs +229 -229
- package/hooks/mindlore-model-router.cjs +54 -54
- package/hooks/mindlore-post-compact.cjs +69 -69
- package/hooks/mindlore-post-read.cjs +106 -106
- package/hooks/mindlore-pre-compact.cjs +154 -154
- package/hooks/mindlore-read-guard.cjs +105 -105
- package/hooks/mindlore-research-guard.cjs +176 -176
- package/hooks/mindlore-search.cjs +200 -200
- package/hooks/mindlore-session-end.cjs +509 -526
- package/hooks/mindlore-session-focus.cjs +256 -259
- package/package.json +75 -78
- package/plugin.json +1 -1
- package/skills/mindlore-diary/SKILL.md +85 -85
- package/skills/mindlore-evolve/SKILL.md +126 -126
- package/skills/mindlore-explore/SKILL.md +109 -109
- package/skills/mindlore-ingest/SKILL.md +195 -195
- package/skills/mindlore-maintain/SKILL.md +125 -125
- package/skills/mindlore-query/SKILL.md +151 -151
- package/skills/mindlore-reflect/SKILL.md +141 -141
- package/skills/mindlore-stats/SKILL.md +106 -106
- package/templates/INDEX.md +14 -14
- package/templates/SCHEMA.md +292 -292
- package/templates/config.json +1 -1
- package/templates/extraction/article.md +15 -15
- package/templates/extraction/changelog.md +15 -15
- package/templates/extraction/default.md +15 -15
- package/templates/extraction/docs.md +15 -15
- package/templates/extraction/github-repo.md +17 -17
- package/dist/scripts/lib/daemon.d.ts +0 -16
- package/dist/scripts/lib/daemon.d.ts.map +0 -1
- package/dist/scripts/lib/daemon.js +0 -133
- package/dist/scripts/lib/daemon.js.map +0 -1
- package/dist/scripts/lib/embedding.d.ts +0 -5
- package/dist/scripts/lib/embedding.d.ts.map +0 -1
- package/dist/scripts/lib/embedding.js +0 -44
- package/dist/scripts/lib/embedding.js.map +0 -1
- package/dist/scripts/mindlore-daemon.d.ts +0 -2
- package/dist/scripts/mindlore-daemon.d.ts.map +0 -1
- package/dist/scripts/mindlore-daemon.js +0 -117
- package/dist/scripts/mindlore-daemon.js.map +0 -1
- package/dist/tests/daemon-integration.test.d.ts +0 -2
- package/dist/tests/daemon-integration.test.d.ts.map +0 -1
- package/dist/tests/daemon-integration.test.js +0 -37
- package/dist/tests/daemon-integration.test.js.map +0 -1
- package/dist/tests/daemon.test.d.ts +0 -2
- package/dist/tests/daemon.test.d.ts.map +0 -1
- package/dist/tests/daemon.test.js +0 -187
- package/dist/tests/daemon.test.js.map +0 -1
- package/dist/tests/embedding-hf-integration.test.d.ts +0 -2
- package/dist/tests/embedding-hf-integration.test.d.ts.map +0 -1
- package/dist/tests/embedding-hf-integration.test.js +0 -52
- package/dist/tests/embedding-hf-integration.test.js.map +0 -1
- package/dist/tests/embedding.test.d.ts +0 -6
- package/dist/tests/embedding.test.d.ts.map +0 -1
- package/dist/tests/embedding.test.js +0 -71
- package/dist/tests/embedding.test.js.map +0 -1
- package/dist/tests/sqlite-vec-v12.test.d.ts +0 -2
- package/dist/tests/sqlite-vec-v12.test.d.ts.map +0 -1
- package/dist/tests/sqlite-vec-v12.test.js +0 -72
- package/dist/tests/sqlite-vec-v12.test.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,259 +1,259 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="assets/mindlore-logo.png" alt="Mindlore" width="320">
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-

|
|
6
|
-
[](https://www.npmjs.com/package/mindlore)
|
|
7
|
-

|
|
8
|
-

|
|
9
|
-

|
|
10
|
-
|
|
11
|
-
> AI-native knowledge system for [Claude Code](https://claude.ai/claude-code)
|
|
12
|
-
|
|
13
|
-
Persistent, searchable, evolving knowledge base that compounds across sessions.
|
|
14
|
-
|
|
15
|
-
## Why Mindlore?
|
|
16
|
-
|
|
17
|
-
Claude Code forgets everything between sessions. Your corrections, discoveries, and decisions vanish. Mindlore gives Claude a persistent memory:
|
|
18
|
-
|
|
19
|
-
- **Knowledge persists** across sessions via FTS5-indexed Markdown files
|
|
20
|
-
- **Search happens automatically** — hooks inject relevant context as you work
|
|
21
|
-
- **Knowledge compounds** — query answers become searchable for future sessions
|
|
22
|
-
|
|
23
|
-
| Feature | Mindlore | Typical KB CLI | Wiki Compilers | Multi-Agent Memory |
|
|
24
|
-
|---------|----------|---------------|----------------|-------------------|
|
|
25
|
-
| Zero workflow change | Hook-based, invisible | Manual commands | Manual compile | Agent orchestration |
|
|
26
|
-
| Persistent search | FTS5 auto-indexed | Manual index | No search | Vector DB overhead |
|
|
27
|
-
| Knowledge compounding | Writeback loop | No | No | Partial |
|
|
28
|
-
| Token efficient | Progressive disclosure | Full dump | Full dump | Varies |
|
|
29
|
-
| Setup time | `npx mindlore` | Config + setup | Complex | Complex |
|
|
30
|
-
|
|
31
|
-
## Quick Start
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npx mindlore
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
That's it. Mindlore creates a `~/.mindlore/` directory, sets up hooks, and starts working.
|
|
38
|
-
|
|
39
|
-
To add your first source:
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
/mindlore-ingest https://example.com/article
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### CLI Commands
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npx mindlore # Install / upgrade
|
|
49
|
-
npx mindlore --upgrade # Upgrade only (skip dir creation)
|
|
50
|
-
npx mindlore health # 16-point structural health check
|
|
51
|
-
npx mindlore doctor # 7-point runtime validation (Node, DB, hooks, skills)
|
|
52
|
-
npx mindlore perf # Hook latency report (p50/p95/p99)
|
|
53
|
-
npx mindlore perf --top 10 # Top 10 slowest hook calls
|
|
54
|
-
npx mindlore perf --savings # Context token savings report
|
|
55
|
-
npx mindlore search "query" # FTS5 keyword search (knowledge)
|
|
56
|
-
npx mindlore search "query" --sessions # Search session data (cc-subagent, cc-session)
|
|
57
|
-
npx mindlore index # Full FTS5 re-index
|
|
58
|
-
npx mindlore quality # Bulk quality assignment for sources
|
|
59
|
-
npx mindlore backup init # Git-based backup for ~/.mindlore/
|
|
60
|
-
npx mindlore backup status # Show backup status + last commit
|
|
61
|
-
npx mindlore obsidian export --vault /path # Export to Obsidian vault
|
|
62
|
-
npx mindlore obsidian import --vault /path # Import from Obsidian vault
|
|
63
|
-
npx mindlore episodes list # List recent episodes
|
|
64
|
-
npx mindlore episodes search "query" # Search episodic memory
|
|
65
|
-
npx mindlore episodes count # Episode count per project
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Features
|
|
69
|
-
|
|
70
|
-
| Skill | Description |
|
|
71
|
-
|-------|-------------|
|
|
72
|
-
| `/mindlore-ingest` | Add knowledge sources (URL, text, file, PDF) + 6-point quality gate |
|
|
73
|
-
| `/mindlore-health` | 16-point structural health check |
|
|
74
|
-
| `/mindlore-query` | Search, ask, stats, brief — compounding knowledge pipeline |
|
|
75
|
-
| `/mindlore-log` | Session logging and status |
|
|
76
|
-
| `/mindlore-diary` | Session diary — decisions, challenges, solutions |
|
|
77
|
-
| `/mindlore-reflect` | Pattern extraction from accumulated diaries |
|
|
78
|
-
| `/mindlore-decide` | Decision records with supersedes chain |
|
|
79
|
-
| `/mindlore-evolve` | Schema co-evolution and structural updates |
|
|
80
|
-
| `/mindlore-explore` | Cross-reference discovery between sources |
|
|
81
|
-
| `/mindlore-maintain` | KB maintenance: decay reports, consolidation, contradiction detection |
|
|
82
|
-
|
|
83
|
-
## Agents
|
|
84
|
-
|
|
85
|
-
3 delegatable agents for subagent workflows:
|
|
86
|
-
|
|
87
|
-
| Agent | Model | Description |
|
|
88
|
-
|-------|-------|-------------|
|
|
89
|
-
| `mindlore-assistant` | sonnet | Knowledge base Q&A — hybrid FTS5 search, top-3 result synthesis, cited answers |
|
|
90
|
-
| `mindlore-researcher` | sonnet | Independent web research — checks existing KB first, fetches new sources, writes structured analyses with contradiction flagging |
|
|
91
|
-
| `mindlore-librarian` | haiku | Periodic maintenance — health checks, stale content detection, FTS5 consistency, cleanup recommendations |
|
|
92
|
-
|
|
93
|
-
Agents are spawned via Claude Code's Agent tool with `team_name` or directly. The `model-router` hook reads `config.json` and routes `[mindlore:SKILL]` markers to cost-optimized models automatically.
|
|
94
|
-
|
|
95
|
-
## Architecture
|
|
96
|
-
|
|
97
|
-
Knowledge flows through a compiler-like pipeline:
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
raw/ Immutable source captures (URL dumps, pasted text)
|
|
101
|
-
|
|
|
102
|
-
sources/ Processed summaries (one per ingested source)
|
|
103
|
-
|
|
|
104
|
-
domains/ Topic wiki pages (accumulated knowledge by subject)
|
|
105
|
-
|
|
|
106
|
-
insights/ Query writebacks (answers that become searchable)
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Nine directories, each mapping to a frontmatter `type`:
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
.mindlore/
|
|
113
|
-
├── raw/ # Immutable captures
|
|
114
|
-
├── sources/ # Processed summaries
|
|
115
|
-
├── domains/ # Topic wikis
|
|
116
|
-
├── analyses/ # Large syntheses (3+ sources)
|
|
117
|
-
├── insights/ # Short Q&A writebacks
|
|
118
|
-
├── connections/ # Cross-cutting links
|
|
119
|
-
├── learnings/ # Persistent rules from reflect
|
|
120
|
-
├── diary/ # Session deltas
|
|
121
|
-
├── decisions/ # Decision records
|
|
122
|
-
├── INDEX.md # Navigation map (~15 lines)
|
|
123
|
-
├── SCHEMA.md # LLM specification
|
|
124
|
-
└── mindlore.db # FTS5 search database (mindlore_fts + mindlore_fts_sessions)
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Installation
|
|
128
|
-
|
|
129
|
-
### Minimal (default)
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
npx mindlore
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Requires: Node.js 20+ (22, 24 supported), `better-sqlite3` ^12 (installed automatically).
|
|
136
|
-
|
|
137
|
-
### Recommended
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
npx mindlore --recommended
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Also suggests installing:
|
|
144
|
-
- **markitdown** — better web/document extraction (URL, DOCX, YouTube)
|
|
145
|
-
- **context-mode** — token savings for large sessions
|
|
146
|
-
|
|
147
|
-
## How It Works
|
|
148
|
-
|
|
149
|
-
Mindlore operates through Claude Code lifecycle hooks — invisible background scripts
|
|
150
|
-
that fire automatically as you work. No commands to run, no workflow changes.
|
|
151
|
-
|
|
152
|
-
```
|
|
153
|
-
┌─────────────────────────────┐
|
|
154
|
-
│ Claude Code Session │
|
|
155
|
-
└──────────────┬──────────────┘
|
|
156
|
-
│
|
|
157
|
-
┌──────────────────────────────────────┼──────────────────────────────────────┐
|
|
158
|
-
│ │ │
|
|
159
|
-
▼ ▼ ▼
|
|
160
|
-
SESSION START DURING SESSION SESSION END
|
|
161
|
-
│ │ │
|
|
162
|
-
├─ session-focus hook ├─ search hook ├─ session-end hook
|
|
163
|
-
│ reads INDEX.md + last delta │ 10-col FTS5 + porter stemmer │ writes delta to diary/
|
|
164
|
-
│ injects into context │ per-keyword scoring, top 3 injected │
|
|
165
|
-
│ │ │
|
|
166
|
-
│ ├─ index + fts5-sync hooks │
|
|
167
|
-
│ │ file changes → FTS5 update │
|
|
168
|
-
│ │ │
|
|
169
|
-
│ ├─ /mindlore-ingest skill │
|
|
170
|
-
│ │ URL → raw/ → sources/ → FTS5 │
|
|
171
|
-
│ │ │
|
|
172
|
-
└────────────────────────────────┴──────────────────────────────────────┘
|
|
173
|
-
│
|
|
174
|
-
┌──────────────┴──────────────┐
|
|
175
|
-
│ NEXT SESSION │
|
|
176
|
-
│ session-focus injects delta │
|
|
177
|
-
│ → knowledge compounds │
|
|
178
|
-
└─────────────────────────────┘
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
**Key design decisions:**
|
|
182
|
-
|
|
183
|
-
- **Hooks are global** — registered in `~/.claude/settings.json`, active in all projects
|
|
184
|
-
- **Single global store** — `~/.mindlore/` shared across projects; `project` FTS5 column namespaces per `path.basename(cwd)`
|
|
185
|
-
- **Project-scoped search** — results filtered by current project, falls back to all projects if none found
|
|
186
|
-
- **No `.mindlore/`?** — hooks silently skip, zero overhead
|
|
187
|
-
- **FTS5 search** — SQLite full-text search with BM25 ranking, no external services. Knowledge and session data in separate tables for better IDF quality
|
|
188
|
-
- **Hybrid search** — RRF fusion combining FTS5 keyword + sqlite-vec vector results with synonym expansion + category boost
|
|
189
|
-
- **Content-hash dedup** — SHA256 prevents re-indexing unchanged files
|
|
190
|
-
|
|
191
|
-
## Daily Usage
|
|
192
|
-
|
|
193
|
-
Mindlore is invisible by design — hooks handle everything automatically:
|
|
194
|
-
|
|
195
|
-
1. **Just work** — hooks inject relevant context as you type
|
|
196
|
-
2. **Add knowledge** — `/mindlore-ingest` when you find something worth keeping
|
|
197
|
-
3. **Search** — `npm run search "query"` or `/mindlore-query search "query"`
|
|
198
|
-
4. **Record decisions** — `/mindlore-decide` when making architectural choices
|
|
199
|
-
5. **Health check** — `npm run health` periodically to verify integrity
|
|
200
|
-
6. **Explore connections** — `/mindlore-explore` to discover links between sources
|
|
201
|
-
|
|
202
|
-
## Configuration
|
|
203
|
-
|
|
204
|
-
Mindlore creates `.mindlore/config.json` with model defaults for cost-optimized agent delegation:
|
|
205
|
-
|
|
206
|
-
```json
|
|
207
|
-
{
|
|
208
|
-
"models": {
|
|
209
|
-
"ingest": "haiku",
|
|
210
|
-
"evolve": "sonnet",
|
|
211
|
-
"explore": "sonnet",
|
|
212
|
-
"default": "haiku"
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
Skills spawn subagents with `[mindlore:SKILL]` markers — the model-router hook reads `config.json` and overrides the model automatically. Override any value to change routing.
|
|
218
|
-
|
|
219
|
-
## Hooks
|
|
220
|
-
|
|
221
|
-
14 Claude Code lifecycle hooks (v0.6.7):
|
|
222
|
-
|
|
223
|
-
| Event | Hook | What it does |
|
|
224
|
-
|-------|------|-------------|
|
|
225
|
-
| SessionStart | session-focus | Injects last delta + INDEX + episodes + corrupt DB auto-recovery |
|
|
226
|
-
| UserPromptSubmit | search | FTS5 search + episodes recall, project-scoped + version tokenization |
|
|
227
|
-
| UserPromptSubmit | decision-detector | TR+EN decision signal detection |
|
|
228
|
-
| FileChanged | index | Sync changed files to FTS5 |
|
|
229
|
-
| FileChanged | fts5-sync | Incremental batch re-index |
|
|
230
|
-
| SessionEnd | session-end | Structured delta + bare episode + FTS5 mirror + detached git sync |
|
|
231
|
-
| PreCompact | pre-compact | FTS5 flush before compaction |
|
|
232
|
-
| PostCompact | post-compact | Re-inject context |
|
|
233
|
-
| PreToolUse (Read) | read-guard | Repeated-read warning, blocks 3+ repeats |
|
|
234
|
-
| PostToolUse (Read) | post-read | Token estimation per file read |
|
|
235
|
-
| PreToolUse (Write\|Edit) | dont-repeat | LESSONS/learnings rule enforcement |
|
|
236
|
-
| CwdChanged | cwd-changed | Scope detection + _scope.json write |
|
|
237
|
-
| PreToolUse (Agent) | model-router | Cost-optimized model routing via markers |
|
|
238
|
-
| PreToolUse (Agent) | research-guard | FTS5 check before research — blocks if recent+high quality exists |
|
|
239
|
-
|
|
240
|
-
## Uninstall
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
npx mindlore uninstall # Remove hooks + skills (keep data)
|
|
244
|
-
npx mindlore uninstall --all # Also remove ~/.mindlore/ global data
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
## Changelog
|
|
248
|
-
|
|
249
|
-
See [CHANGELOG.md](CHANGELOG.md) for version history and release notes.
|
|
250
|
-
|
|
251
|
-
## Inspired By
|
|
252
|
-
|
|
253
|
-
- [Andrej Karpathy](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) — LLM Knowledge Bases concept
|
|
254
|
-
- [Spisak](https://github.com/nickspisak) — Practical second brain implementations
|
|
255
|
-
- [Letta](https://github.com/letta-ai/letta-code) — Context repository pattern validation
|
|
256
|
-
|
|
257
|
-
## License
|
|
258
|
-
|
|
259
|
-
[AGPL-3.0](LICENSE)
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/mindlore-logo.png" alt="Mindlore" width="320">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
[](https://www.npmjs.com/package/mindlore)
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
> AI-native knowledge system for [Claude Code](https://claude.ai/claude-code)
|
|
12
|
+
|
|
13
|
+
Persistent, searchable, evolving knowledge base that compounds across sessions.
|
|
14
|
+
|
|
15
|
+
## Why Mindlore?
|
|
16
|
+
|
|
17
|
+
Claude Code forgets everything between sessions. Your corrections, discoveries, and decisions vanish. Mindlore gives Claude a persistent memory:
|
|
18
|
+
|
|
19
|
+
- **Knowledge persists** across sessions via FTS5-indexed Markdown files
|
|
20
|
+
- **Search happens automatically** — hooks inject relevant context as you work
|
|
21
|
+
- **Knowledge compounds** — query answers become searchable for future sessions
|
|
22
|
+
|
|
23
|
+
| Feature | Mindlore | Typical KB CLI | Wiki Compilers | Multi-Agent Memory |
|
|
24
|
+
|---------|----------|---------------|----------------|-------------------|
|
|
25
|
+
| Zero workflow change | Hook-based, invisible | Manual commands | Manual compile | Agent orchestration |
|
|
26
|
+
| Persistent search | FTS5 auto-indexed | Manual index | No search | Vector DB overhead |
|
|
27
|
+
| Knowledge compounding | Writeback loop | No | No | Partial |
|
|
28
|
+
| Token efficient | Progressive disclosure | Full dump | Full dump | Varies |
|
|
29
|
+
| Setup time | `npx mindlore` | Config + setup | Complex | Complex |
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx mindlore
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
That's it. Mindlore creates a `~/.mindlore/` directory, sets up hooks, and starts working.
|
|
38
|
+
|
|
39
|
+
To add your first source:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
/mindlore-ingest https://example.com/article
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### CLI Commands
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx mindlore # Install / upgrade
|
|
49
|
+
npx mindlore --upgrade # Upgrade only (skip dir creation)
|
|
50
|
+
npx mindlore health # 16-point structural health check
|
|
51
|
+
npx mindlore doctor # 7-point runtime validation (Node, DB, hooks, skills)
|
|
52
|
+
npx mindlore perf # Hook latency report (p50/p95/p99)
|
|
53
|
+
npx mindlore perf --top 10 # Top 10 slowest hook calls
|
|
54
|
+
npx mindlore perf --savings # Context token savings report
|
|
55
|
+
npx mindlore search "query" # FTS5 keyword search (knowledge)
|
|
56
|
+
npx mindlore search "query" --sessions # Search session data (cc-subagent, cc-session)
|
|
57
|
+
npx mindlore index # Full FTS5 re-index
|
|
58
|
+
npx mindlore quality # Bulk quality assignment for sources
|
|
59
|
+
npx mindlore backup init # Git-based backup for ~/.mindlore/
|
|
60
|
+
npx mindlore backup status # Show backup status + last commit
|
|
61
|
+
npx mindlore obsidian export --vault /path # Export to Obsidian vault
|
|
62
|
+
npx mindlore obsidian import --vault /path # Import from Obsidian vault
|
|
63
|
+
npx mindlore episodes list # List recent episodes
|
|
64
|
+
npx mindlore episodes search "query" # Search episodic memory
|
|
65
|
+
npx mindlore episodes count # Episode count per project
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Features
|
|
69
|
+
|
|
70
|
+
| Skill | Description |
|
|
71
|
+
|-------|-------------|
|
|
72
|
+
| `/mindlore-ingest` | Add knowledge sources (URL, text, file, PDF) + 6-point quality gate |
|
|
73
|
+
| `/mindlore-health` | 16-point structural health check |
|
|
74
|
+
| `/mindlore-query` | Search, ask, stats, brief — compounding knowledge pipeline |
|
|
75
|
+
| `/mindlore-log` | Session logging and status |
|
|
76
|
+
| `/mindlore-diary` | Session diary — decisions, challenges, solutions |
|
|
77
|
+
| `/mindlore-reflect` | Pattern extraction from accumulated diaries |
|
|
78
|
+
| `/mindlore-decide` | Decision records with supersedes chain |
|
|
79
|
+
| `/mindlore-evolve` | Schema co-evolution and structural updates |
|
|
80
|
+
| `/mindlore-explore` | Cross-reference discovery between sources |
|
|
81
|
+
| `/mindlore-maintain` | KB maintenance: decay reports, consolidation, contradiction detection |
|
|
82
|
+
|
|
83
|
+
## Agents
|
|
84
|
+
|
|
85
|
+
3 delegatable agents for subagent workflows:
|
|
86
|
+
|
|
87
|
+
| Agent | Model | Description |
|
|
88
|
+
|-------|-------|-------------|
|
|
89
|
+
| `mindlore-assistant` | sonnet | Knowledge base Q&A — hybrid FTS5 search, top-3 result synthesis, cited answers |
|
|
90
|
+
| `mindlore-researcher` | sonnet | Independent web research — checks existing KB first, fetches new sources, writes structured analyses with contradiction flagging |
|
|
91
|
+
| `mindlore-librarian` | haiku | Periodic maintenance — health checks, stale content detection, FTS5 consistency, cleanup recommendations |
|
|
92
|
+
|
|
93
|
+
Agents are spawned via Claude Code's Agent tool with `team_name` or directly. The `model-router` hook reads `config.json` and routes `[mindlore:SKILL]` markers to cost-optimized models automatically.
|
|
94
|
+
|
|
95
|
+
## Architecture
|
|
96
|
+
|
|
97
|
+
Knowledge flows through a compiler-like pipeline:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
raw/ Immutable source captures (URL dumps, pasted text)
|
|
101
|
+
|
|
|
102
|
+
sources/ Processed summaries (one per ingested source)
|
|
103
|
+
|
|
|
104
|
+
domains/ Topic wiki pages (accumulated knowledge by subject)
|
|
105
|
+
|
|
|
106
|
+
insights/ Query writebacks (answers that become searchable)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Nine directories, each mapping to a frontmatter `type`:
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
.mindlore/
|
|
113
|
+
├── raw/ # Immutable captures
|
|
114
|
+
├── sources/ # Processed summaries
|
|
115
|
+
├── domains/ # Topic wikis
|
|
116
|
+
├── analyses/ # Large syntheses (3+ sources)
|
|
117
|
+
├── insights/ # Short Q&A writebacks
|
|
118
|
+
├── connections/ # Cross-cutting links
|
|
119
|
+
├── learnings/ # Persistent rules from reflect
|
|
120
|
+
├── diary/ # Session deltas
|
|
121
|
+
├── decisions/ # Decision records
|
|
122
|
+
├── INDEX.md # Navigation map (~15 lines)
|
|
123
|
+
├── SCHEMA.md # LLM specification
|
|
124
|
+
└── mindlore.db # FTS5 search database (mindlore_fts + mindlore_fts_sessions)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Installation
|
|
128
|
+
|
|
129
|
+
### Minimal (default)
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npx mindlore
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Requires: Node.js 20+ (22, 24 supported), `better-sqlite3` ^12 (installed automatically).
|
|
136
|
+
|
|
137
|
+
### Recommended
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
npx mindlore --recommended
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Also suggests installing:
|
|
144
|
+
- **markitdown** — better web/document extraction (URL, DOCX, YouTube)
|
|
145
|
+
- **context-mode** — token savings for large sessions
|
|
146
|
+
|
|
147
|
+
## How It Works
|
|
148
|
+
|
|
149
|
+
Mindlore operates through Claude Code lifecycle hooks — invisible background scripts
|
|
150
|
+
that fire automatically as you work. No commands to run, no workflow changes.
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
┌─────────────────────────────┐
|
|
154
|
+
│ Claude Code Session │
|
|
155
|
+
└──────────────┬──────────────┘
|
|
156
|
+
│
|
|
157
|
+
┌──────────────────────────────────────┼──────────────────────────────────────┐
|
|
158
|
+
│ │ │
|
|
159
|
+
▼ ▼ ▼
|
|
160
|
+
SESSION START DURING SESSION SESSION END
|
|
161
|
+
│ │ │
|
|
162
|
+
├─ session-focus hook ├─ search hook ├─ session-end hook
|
|
163
|
+
│ reads INDEX.md + last delta │ 10-col FTS5 + porter stemmer │ writes delta to diary/
|
|
164
|
+
│ injects into context │ per-keyword scoring, top 3 injected │
|
|
165
|
+
│ │ │
|
|
166
|
+
│ ├─ index + fts5-sync hooks │
|
|
167
|
+
│ │ file changes → FTS5 update │
|
|
168
|
+
│ │ │
|
|
169
|
+
│ ├─ /mindlore-ingest skill │
|
|
170
|
+
│ │ URL → raw/ → sources/ → FTS5 │
|
|
171
|
+
│ │ │
|
|
172
|
+
└────────────────────────────────┴──────────────────────────────────────┘
|
|
173
|
+
│
|
|
174
|
+
┌──────────────┴──────────────┐
|
|
175
|
+
│ NEXT SESSION │
|
|
176
|
+
│ session-focus injects delta │
|
|
177
|
+
│ → knowledge compounds │
|
|
178
|
+
└─────────────────────────────┘
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Key design decisions:**
|
|
182
|
+
|
|
183
|
+
- **Hooks are global** — registered in `~/.claude/settings.json`, active in all projects
|
|
184
|
+
- **Single global store** — `~/.mindlore/` shared across projects; `project` FTS5 column namespaces per `path.basename(cwd)`
|
|
185
|
+
- **Project-scoped search** — results filtered by current project, falls back to all projects if none found
|
|
186
|
+
- **No `.mindlore/`?** — hooks silently skip, zero overhead
|
|
187
|
+
- **FTS5 search** — SQLite full-text search with BM25 ranking, no external services. Knowledge and session data in separate tables for better IDF quality
|
|
188
|
+
- **Hybrid search** — RRF fusion combining FTS5 keyword + sqlite-vec vector results with synonym expansion + category boost
|
|
189
|
+
- **Content-hash dedup** — SHA256 prevents re-indexing unchanged files
|
|
190
|
+
|
|
191
|
+
## Daily Usage
|
|
192
|
+
|
|
193
|
+
Mindlore is invisible by design — hooks handle everything automatically:
|
|
194
|
+
|
|
195
|
+
1. **Just work** — hooks inject relevant context as you type
|
|
196
|
+
2. **Add knowledge** — `/mindlore-ingest` when you find something worth keeping
|
|
197
|
+
3. **Search** — `npm run search "query"` or `/mindlore-query search "query"`
|
|
198
|
+
4. **Record decisions** — `/mindlore-decide` when making architectural choices
|
|
199
|
+
5. **Health check** — `npm run health` periodically to verify integrity
|
|
200
|
+
6. **Explore connections** — `/mindlore-explore` to discover links between sources
|
|
201
|
+
|
|
202
|
+
## Configuration
|
|
203
|
+
|
|
204
|
+
Mindlore creates `.mindlore/config.json` with model defaults for cost-optimized agent delegation:
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"models": {
|
|
209
|
+
"ingest": "haiku",
|
|
210
|
+
"evolve": "sonnet",
|
|
211
|
+
"explore": "sonnet",
|
|
212
|
+
"default": "haiku"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Skills spawn subagents with `[mindlore:SKILL]` markers — the model-router hook reads `config.json` and overrides the model automatically. Override any value to change routing.
|
|
218
|
+
|
|
219
|
+
## Hooks
|
|
220
|
+
|
|
221
|
+
14 Claude Code lifecycle hooks (v0.6.7):
|
|
222
|
+
|
|
223
|
+
| Event | Hook | What it does |
|
|
224
|
+
|-------|------|-------------|
|
|
225
|
+
| SessionStart | session-focus | Injects last delta + INDEX + episodes + corrupt DB auto-recovery |
|
|
226
|
+
| UserPromptSubmit | search | FTS5 search + episodes recall, project-scoped + version tokenization |
|
|
227
|
+
| UserPromptSubmit | decision-detector | TR+EN decision signal detection |
|
|
228
|
+
| FileChanged | index | Sync changed files to FTS5 |
|
|
229
|
+
| FileChanged | fts5-sync | Incremental batch re-index |
|
|
230
|
+
| SessionEnd | session-end | Structured delta + bare episode + FTS5 mirror + detached git sync |
|
|
231
|
+
| PreCompact | pre-compact | FTS5 flush before compaction |
|
|
232
|
+
| PostCompact | post-compact | Re-inject context |
|
|
233
|
+
| PreToolUse (Read) | read-guard | Repeated-read warning, blocks 3+ repeats |
|
|
234
|
+
| PostToolUse (Read) | post-read | Token estimation per file read |
|
|
235
|
+
| PreToolUse (Write\|Edit) | dont-repeat | LESSONS/learnings rule enforcement |
|
|
236
|
+
| CwdChanged | cwd-changed | Scope detection + _scope.json write |
|
|
237
|
+
| PreToolUse (Agent) | model-router | Cost-optimized model routing via markers |
|
|
238
|
+
| PreToolUse (Agent) | research-guard | FTS5 check before research — blocks if recent+high quality exists |
|
|
239
|
+
|
|
240
|
+
## Uninstall
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
npx mindlore uninstall # Remove hooks + skills (keep data)
|
|
244
|
+
npx mindlore uninstall --all # Also remove ~/.mindlore/ global data
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Changelog
|
|
248
|
+
|
|
249
|
+
See [CHANGELOG.md](CHANGELOG.md) for version history and release notes.
|
|
250
|
+
|
|
251
|
+
## Inspired By
|
|
252
|
+
|
|
253
|
+
- [Andrej Karpathy](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) — LLM Knowledge Bases concept
|
|
254
|
+
- [Spisak](https://github.com/nickspisak) — Practical second brain implementations
|
|
255
|
+
- [Letta](https://github.com/letta-ai/letta-code) — Context repository pattern validation
|
|
256
|
+
|
|
257
|
+
## License
|
|
258
|
+
|
|
259
|
+
[AGPL-3.0](LICENSE)
|