@shahmilsaari/memory-core 0.1.3 → 0.1.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.
Files changed (3) hide show
  1. package/README.md +187 -197
  2. package/dist/cli.js +14 -15
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,75 +1,46 @@
1
- # @shahmilsaari/memory-core
1
+ # memory-core
2
2
 
3
- Universal AI memory for any project. Install once, and every AI coding agent Copilot, Cursor, Claude Code, Windsurf, Cline, and 13 more — automatically follows your architecture rules, past decisions, and best practices. Backed by PostgreSQL + pgvector and fully local AI via Ollama. No OpenAI key required.
3
+ **Every AI coding agent in your project, following your rules. Automatically.**
4
+
5
+ You decide the architecture. memory-core remembers it. Every AI tool — Copilot, Cursor, Claude Code, Windsurf, and 10 more — reads those rules before writing a single line of code.
4
6
 
5
7
  ```bash
6
8
  npx @shahmilsaari/memory-core init
7
9
  ```
8
10
 
9
- ---
10
-
11
- ## How it works
12
-
13
- ```
14
- memory-core init
15
-
16
- ├── You pick: Backend / Frontend / Fullstack
17
- ├── You pick: Architecture (Clean, MVC, React, Vue, …)
18
-
19
-
20
- PostgreSQL + pgvector
21
- 192 predefined rules — each with a WHY
22
- + your own saved decisions
23
-
24
-
25
- 18 AI agent config files generated
26
-
27
-
28
- Every agent reads its file → follows your rules
29
-
30
- git commit → pre-commit hook → Ollama checks diff
31
- → violations blocked with Rule + Why + Fix
32
- ```
11
+ No OpenAI key. No cloud. Fully local.
33
12
 
34
13
  ---
35
14
 
36
- ## Supported agents
15
+ ## What does it actually do?
37
16
 
38
- | Agent | File generated |
39
- |---|---|
40
- | Claude Code | `CLAUDE.md` |
41
- | GitHub Copilot | `.github/copilot-instructions.md` |
42
- | Cursor | `.cursorrules` + `.cursor/rules/memory-core.mdc` |
43
- | Windsurf | `.windsurfrules` |
44
- | Cline | `.clinerules` |
45
- | Roo Code | `.roo/rules/memory-core.md` |
46
- | Aider | `.aider.conf.yml` |
47
- | Continue.dev | `.continue/config.json` |
48
- | Devin | `DEVIN.md` |
49
- | Amazon Q | `.amazonq/dev/guidelines.md` |
50
- | Gemini Code Assist | `.gemini/styleguide.md` |
51
- | Zed AI | `.zed/settings.json` |
52
- | JetBrains AI | `.idea/ai-instructions.md` |
53
- | OpenHands / AGENTS | `AGENTS.md` |
17
+ Without memory-core, every AI agent starts fresh. It doesn't know you're using Clean Architecture. It doesn't know controllers shouldn't call the database. It doesn't know why you made that decision six months ago.
18
+
19
+ With memory-core:
54
20
 
55
- Plus: `AI_RULES.md`, `ARCHITECTURE.md`, `PROJECT_MEMORY.md`
21
+ 1. You run `init` once and answer a few questions about your project
22
+ 2. memory-core generates config files for every AI agent you use
23
+ 3. Those agents read the files and follow your rules — automatically
24
+ 4. When you commit code, a hook catches violations before they land in the repo
25
+ 5. Watch mode catches violations as you type, not just at commit time
56
26
 
57
27
  ---
58
28
 
59
- ## Prerequisites
29
+ ## Before you start
60
30
 
61
- | Requirement | Purpose |
62
- |---|---|
63
- | PostgreSQL 14+ | Memory storage |
64
- | pgvector | Semantic similarity search |
65
- | Ollama + `nomic-embed-text` | Free local embeddings (no API key) |
66
- | Ollama + `llama3.2` | Pre-commit rule checking |
31
+ You need three things installed:
32
+
33
+ | What | Why | Install |
34
+ |---|---|---|
35
+ | PostgreSQL 14+ | Stores your rules and decisions | See below |
36
+ | pgvector | Makes search smart (finds similar rules, not just exact matches) | See below |
37
+ | Ollama | Runs AI locally — no API key needed | See below |
67
38
 
68
39
  ---
69
40
 
70
- ## Setup
41
+ ## Install
71
42
 
72
- ### 1. PostgreSQL
43
+ ### PostgreSQL
73
44
 
74
45
  **macOS**
75
46
  ```bash
@@ -83,13 +54,20 @@ sudo apt install postgresql postgresql-contrib
83
54
  sudo systemctl start postgresql
84
55
  ```
85
56
 
86
- **Windows** — download from [postgresql.org](https://www.postgresql.org/download/windows/)
57
+ **Windows** — [download from postgresql.org](https://www.postgresql.org/download/windows/)
87
58
 
88
59
  ---
89
60
 
90
- ### 2. pgvector
61
+ ### pgvector
91
62
 
92
- **macOS with PostgreSQL@16** (brew pgvector only targets pg17+, build from source):
63
+ pgvector adds AI-powered search to PostgreSQL.
64
+
65
+ **macOS + PostgreSQL 17+** (easiest)
66
+ ```bash
67
+ brew install pgvector
68
+ ```
69
+
70
+ **macOS + PostgreSQL 16** (brew's pgvector targets 17+, so build from source)
93
71
  ```bash
94
72
  xcode-select --install
95
73
  git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git /tmp/pgvector
@@ -98,24 +76,21 @@ make PG_CONFIG=/opt/homebrew/opt/postgresql@16/bin/pg_config
98
76
  make install PG_CONFIG=/opt/homebrew/opt/postgresql@16/bin/pg_config
99
77
  ```
100
78
 
101
- **macOS with PostgreSQL@17+**
102
- ```bash
103
- brew install pgvector
104
- ```
105
-
106
79
  **Linux**
107
80
  ```bash
108
81
  sudo apt install postgresql-16-pgvector # replace 16 with your version
109
82
  ```
110
83
 
111
- Verify:
84
+ Check it worked:
112
85
  ```bash
113
86
  psql -U $(whoami) -c "SELECT * FROM pg_available_extensions WHERE name = 'vector';"
114
87
  ```
115
88
 
116
89
  ---
117
90
 
118
- ### 3. Ollama
91
+ ### Ollama
92
+
93
+ Ollama runs AI models on your machine. Two models are needed — one for search, one for code checking.
119
94
 
120
95
  **macOS**
121
96
  ```bash
@@ -129,28 +104,24 @@ curl -fsSL https://ollama.com/install.sh | sh
129
104
  ollama serve &
130
105
  ```
131
106
 
132
- **Windows** — download from [ollama.com](https://ollama.com/download)
107
+ **Windows** — [download from ollama.com](https://ollama.com/download)
133
108
 
134
- Pull the required models:
109
+ Then pull the two models:
135
110
  ```bash
136
- ollama pull nomic-embed-text # embeddings — used by remember/search/sync
137
- ollama pull llama3.2 # code analysis used by pre-commit hook
111
+ ollama pull nomic-embed-text # used for search
112
+ ollama pull llama3.2 # used to check your code
138
113
  ```
139
114
 
140
115
  ---
141
116
 
142
- ### 4. Create the database
117
+ ### Create the database
143
118
 
144
119
  ```bash
145
120
  createdb memory_core
146
- ```
147
-
148
- Then run the schema (get `setup.sql` from the repo or copy below):
149
- ```bash
150
121
  psql -U $(whoami) -d memory_core -f setup.sql
151
122
  ```
152
123
 
153
- `setup.sql` contents:
124
+ `setup.sql`:
154
125
  ```sql
155
126
  CREATE EXTENSION IF NOT EXISTS vector;
156
127
 
@@ -169,38 +140,31 @@ CREATE TABLE IF NOT EXISTS memories (
169
140
  );
170
141
 
171
142
  CREATE INDEX IF NOT EXISTS memories_embedding_idx
172
- ON memories USING ivfflat (embedding vector_cosine_ops)
173
- WITH (lists = 100);
174
-
143
+ ON memories USING ivfflat (embedding vector_cosine_ops) WITH (lists = 100);
175
144
  CREATE INDEX IF NOT EXISTS memories_architecture_idx ON memories (architecture);
176
145
  CREATE INDEX IF NOT EXISTS memories_scope_idx ON memories (scope);
177
146
  ```
178
147
 
179
148
  ---
180
149
 
181
- ### 5. Configure environment
182
-
183
- Create `.env` in the project where you run memory-core (or `.memory-core.env` per project):
184
-
185
- ```env
186
- DATABASE_URL=postgresql://YOUR_USERNAME@localhost:5432/memory_core
187
- OLLAMA_URL=http://localhost:11434
188
- OLLAMA_MODEL=nomic-embed-text
189
- OLLAMA_CHAT_MODEL=llama3.2
190
- ```
191
-
192
- Find your username: `whoami`
193
-
194
- ---
150
+ ## Quick start
195
151
 
196
- ### 6. Seed the database
152
+ ```bash
153
+ # 1. Go to your project
154
+ cd my-api
197
155
 
198
- Load 192 predefined best-practice rules (each with a reason explaining why it exists):
156
+ # 2. Initialize answers a few questions, generates all config files
157
+ npx @shahmilsaari/memory-core init
199
158
 
200
- ```bash
159
+ # 3. Load 192 predefined best-practice rules
201
160
  npx @shahmilsaari/memory-core seed
161
+
162
+ # 4. Install the pre-commit hook (optional but recommended)
163
+ npx @shahmilsaari/memory-core hook install
202
164
  ```
203
165
 
166
+ That's it. Every AI agent in your project now has your rules.
167
+
204
168
  ---
205
169
 
206
170
  ## Commands
@@ -208,107 +172,108 @@ npx @shahmilsaari/memory-core seed
208
172
  ### `init` — Set up a project
209
173
 
210
174
  ```bash
211
- cd your-project
212
175
  npx @shahmilsaari/memory-core init
213
176
  ```
214
177
 
215
- Interactive prompts:
216
- ```
217
- Project name? → my-api
218
- Project type? → Backend / Frontend / Fullstack
219
- Backend architecture? → Clean Architecture
220
- Frontend framework? → (skipped for backend-only)
221
- Language? → TypeScript
222
- Install caveman? → no
223
- ```
178
+ Asks you:
179
+ - Project name
180
+ - Project type (Backend / Frontend / Fullstack)
181
+ - Architecture (Clean Architecture, MVC, React, Vue, etc.)
182
+ - Language
183
+ - Whether to enable caveman mode (optional token saver)
224
184
 
225
- Generates all 18 agent config files and saves `.memory-core.json`.
226
-
227
- ---
228
-
229
- ### `sync` — Regenerate all agent files
230
-
231
- ```bash
232
- npx @shahmilsaari/memory-core sync
233
- ```
234
-
235
- Re-pulls memories from the DB and rewrites all 18 files. Run after `remember` or `seed`.
185
+ Generates config files for every supported AI agent and saves your choices to `.memory-core.json`.
236
186
 
237
187
  ---
238
188
 
239
189
  ### `remember` — Save a decision
240
190
 
191
+ Made a decision your team should never forget? Save it.
192
+
241
193
  ```bash
242
194
  npx @shahmilsaari/memory-core remember "Controllers must never call the database directly"
243
195
  ```
244
196
 
245
- Prompts: _"Why does this rule exist?"_ the reason is stored and shown to agents and developers when a violation is caught.
197
+ It will ask you *why*that reason gets stored alongside the rule and shown to AI agents and developers when a violation is caught.
246
198
 
247
- With flags:
199
+ With flags (skip the prompts):
248
200
  ```bash
249
201
  npx @shahmilsaari/memory-core remember "Use DTOs for all API responses" \
250
202
  --type rule \
251
203
  --scope global \
252
- --reason "Raw DB entities leak internal schema and expose sensitive fields to clients" \
253
- --tags "api,dto,response"
204
+ --reason "Raw DB entities expose internal schema and sensitive fields" \
205
+ --tags "api,dto"
254
206
  ```
255
207
 
256
- | Flag | Values | Default |
208
+ | Flag | Options | Default |
257
209
  |---|---|---|
258
210
  | `--type` | `decision` `rule` `pattern` `note` | `decision` |
259
211
  | `--scope` | `global` `project` | `project` |
260
- | `--reason` | free text | prompted interactively |
212
+ | `--reason` | any text | asked interactively |
261
213
  | `--tags` | comma-separated | none |
262
214
 
263
215
  ---
264
216
 
265
- ### `search` — Semantic search
217
+ ### `sync` — Refresh all agent files
218
+
219
+ After saving new memories, regenerate every agent file to include them.
220
+
221
+ ```bash
222
+ npx @shahmilsaari/memory-core sync
223
+ ```
224
+
225
+ ---
226
+
227
+ ### `search` — Find a rule or decision
266
228
 
267
229
  ```bash
268
230
  npx @shahmilsaari/memory-core search "error handling"
269
231
  npx @shahmilsaari/memory-core search "auth strategy" --limit 10
270
232
  ```
271
233
 
234
+ Uses AI search — finds related rules even if you don't use the exact words.
235
+
272
236
  ---
273
237
 
274
238
  ### `seed` — Load predefined rules
275
239
 
240
+ 192 best-practice rules across all supported architectures, each with a plain-English reason explaining why the rule exists.
241
+
276
242
  ```bash
277
- npx @shahmilsaari/memory-core seed
278
- npx @shahmilsaari/memory-core seed --arch clean-architecture # one architecture only
279
- npx @shahmilsaari/memory-core seed --force # re-seed existing entries
243
+ npx @shahmilsaari/memory-core seed # all architectures
244
+ npx @shahmilsaari/memory-core seed --arch clean-architecture # one only
245
+ npx @shahmilsaari/memory-core seed --force # re-seed existing
280
246
  ```
281
247
 
282
- 192 rules across all architectures. Every rule includes a `reason` explaining why it exists.
283
-
284
248
  ---
285
249
 
286
- ### `hook install` — Pre-commit enforcement
250
+ ### `hook install` — Block bad commits
287
251
 
288
252
  ```bash
289
253
  npx @shahmilsaari/memory-core hook install
290
254
  ```
291
255
 
292
- Installs a git pre-commit hook. Every `git commit` automatically checks staged source files against your architecture rules using Ollama (llama3.2). Violations are blocked with full context:
256
+ Installs a git pre-commit hook. Every time you run `git commit`, your staged files are checked against your architecture rules before the commit goes through.
257
+
258
+ When a violation is found, the commit is blocked and you see exactly what's wrong and how to fix it:
293
259
 
294
260
  ```
295
261
  ✗ 2 rule violations found — commit blocked
296
262
 
297
263
  [1] src/controllers/user.ts:32
298
264
  Rule: Thin controllers — business logic belongs in services
299
- Why: Logic in controllers cannot be reused from CLI, queues, or other
300
- entry points — it gets siloed and duplicated across handlers
265
+ Why: Logic in controllers cannot be reused from other entry points
266
+ — it gets siloed and duplicated across handlers
301
267
  Issue: Password validation logic inside route handler
302
268
  Fix: Move to UserService.validateCredentials()
303
269
 
304
270
  [2] src/domain/user.entity.ts:5
305
271
  Rule: Domain has zero external imports
306
- Why: Framework imports in the domain layer tie business logic to
307
- infrastructure — you can't swap the DB or test without spinning up the stack
272
+ Why: Framework imports tie business logic to infrastructure
308
273
  Issue: Imports 'typeorm' directly
309
- Fix: Define IUserRepository interface in domain, implement in infrastructure/
274
+ Fix: Define IUserRepository interface in domain/
310
275
 
311
- To bypass (not recommended): git commit --no-verify
276
+ To bypass: git commit --no-verify
312
277
  To save as memory: memory-core remember "<lesson>"
313
278
  ```
314
279
 
@@ -318,13 +283,13 @@ npx @shahmilsaari/memory-core hook uninstall # remove the hook
318
283
 
319
284
  ---
320
285
 
321
- ### `watch` — Real-time rule checking
286
+ ### `watch` — Catch violations as you type
322
287
 
323
288
  ```bash
324
289
  npx @shahmilsaari/memory-core watch
325
290
  ```
326
291
 
327
- Runs in your terminal and checks every source file as you save it. Violations print immediately — no commit needed.
292
+ Runs in the background and checks each file the moment you save it. You see violations immediately — before you even think about committing.
328
293
 
329
294
  ```
330
295
  archmind watch — real-time rule enforcement
@@ -340,44 +305,41 @@ Runs in your terminal and checks every source file as you save it. Violations pr
340
305
 
341
306
  [1] src/controllers/user.ts:34
342
307
  Rule: Thin controllers — business logic belongs in services
343
- Why: Logic in controllers cannot be reused from CLI, queues, or other
344
- entry points — it gets siloed and duplicated across handlers
308
+ Why: Logic in controllers cannot be reused from other entry points
345
309
  Issue: Password hashing inside the route handler
346
310
  Fix: Move to UserService.hashPassword()
347
-
348
- Fix violations or run: memory-core remember "<lesson>"
349
311
  ```
350
312
 
351
313
  Options:
352
314
  ```bash
353
- npx @shahmilsaari/memory-core watch --path src/ # watch a specific directory
354
- npx @shahmilsaari/memory-core watch --verbose # show diff size and model details
315
+ npx @shahmilsaari/memory-core watch --path src/ # watch a specific folder only
316
+ npx @shahmilsaari/memory-core watch --verbose # show extra details
355
317
  ```
356
318
 
357
- Ignores: `node_modules`, `dist`, `build`, `.git`, config files only checks source code.
319
+ Only checks source files — ignores `node_modules`, `dist`, config files, JSON, etc.
358
320
 
359
321
  ---
360
322
 
361
- ### `check` — Manual rule check
323
+ ### `check` — Manual check (for CI)
362
324
 
363
325
  ```bash
364
326
  npx @shahmilsaari/memory-core check --staged # check staged files
365
- npx @shahmilsaari/memory-core check --staged --verbose # show model + diff details
327
+ npx @shahmilsaari/memory-core check --staged --verbose # with extra detail
366
328
  ```
367
329
 
368
- Same as the pre-commit hook useful in CI/CD pipelines.
330
+ Same as the pre-commit hook. Use this in CI/CD pipelines.
369
331
 
370
332
  ---
371
333
 
372
- ### `global` — Sync to all agents globally
373
-
374
- Writes your rules to the global config of every installed agent — so they follow your rules in every project without running `init`:
334
+ ### `global` — Apply rules to every project
375
335
 
376
336
  ```bash
377
337
  npx @shahmilsaari/memory-core global
378
338
  ```
379
339
 
380
- | Agent | Global file |
340
+ Writes your rules to the global config of each AI agent — so they follow your rules in every project on your machine, not just the current one.
341
+
342
+ | Agent | Where it writes |
381
343
  |---|---|
382
344
  | Claude Code | `~/.claude/CLAUDE.md` |
383
345
  | GitHub Copilot | VS Code `settings.json` |
@@ -390,63 +352,89 @@ npx @shahmilsaari/memory-core global
390
352
 
391
353
  ---
392
354
 
355
+ ## Supported agents
356
+
357
+ | Agent | File generated |
358
+ |---|---|
359
+ | Claude Code | `CLAUDE.md` |
360
+ | GitHub Copilot | `.github/copilot-instructions.md` |
361
+ | Cursor | `.cursorrules` + `.cursor/rules/memory-core.mdc` |
362
+ | Windsurf | `.windsurfrules` |
363
+ | Cline | `.clinerules` |
364
+ | Roo Code | `.roo/rules/memory-core.md` |
365
+ | Aider | `.aider.conf.yml` |
366
+ | Continue.dev | `.continue/config.json` |
367
+ | Devin | `DEVIN.md` |
368
+ | Amazon Q | `.amazonq/dev/guidelines.md` |
369
+ | Gemini Code Assist | `.gemini/styleguide.md` |
370
+ | Zed AI | `.zed/settings.json` |
371
+ | JetBrains AI | `.idea/ai-instructions.md` |
372
+ | OpenHands | `AGENTS.md` |
373
+
374
+ Plus shared files: `AI_RULES.md`, `ARCHITECTURE.md`, `PROJECT_MEMORY.md`
375
+
376
+ ---
377
+
393
378
  ## Architecture profiles
394
379
 
395
- ### Backend
396
- | Profile | Best for |
380
+ Pick the one that matches how your project is structured.
381
+
382
+ **Backend**
383
+ | Profile | Use when… |
397
384
  |---|---|
398
- | **Clean Architecture** | Domain-driven APIs, strict layer separation |
399
- | **Modular Monolith** | Feature modules that could become microservices |
400
- | **MVC** | Standard web apps, controllers + services |
401
- | **Hexagonal** | Port/adapter isolation, highly testable cores |
402
- | **Next.js** | Next.js 13+ fullstack (server components + actions) |
403
- | **Laravel** | Laravel APIs with service-repository pattern |
404
-
405
- ### Frontend
406
- | Profile | Best for |
385
+ | Clean Architecture | You want strict separation between domain, application, and infrastructure |
386
+ | Modular Monolith | You're building feature modules that might become microservices later |
387
+ | MVC | Standard web app with controllers and services |
388
+ | Hexagonal | You want ports and adapters for maximum testability |
389
+ | Next.js | Next.js 13+ with server components and server actions |
390
+ | Laravel | Laravel with service-repository pattern |
391
+
392
+ **Frontend**
393
+ | Profile | Use when… |
407
394
  |---|---|
408
- | **React** | Functional components, hooks, React Query, Zustand |
409
- | **Vue 3** | Composition API, Pinia, composables |
410
- | **Angular** | Standalone components, signals, OnPush |
411
- | **Svelte** | Svelte 5 runes, SvelteKit load functions |
412
- | **Nuxt 3** | Fullstack Vue with SSR, server routes |
413
- | **React Native** | Mobile apps, FlatList, secure storage |
395
+ | React | Functional components, hooks, React Query, Zustand |
396
+ | Vue 3 | Composition API, Pinia, composables |
397
+ | Angular | Standalone components, signals, OnPush strategy |
398
+ | Svelte | Svelte 5 runes, SvelteKit load functions |
399
+ | Nuxt 3 | Fullstack Vue with SSR |
400
+ | React Native | Mobile apps |
414
401
 
415
- Fullstack projects get dual sections — one for backend, one for frontend — in every generated agent file.
402
+ Fullstack projects get both sections in every generated file.
416
403
 
417
404
  ---
418
405
 
419
- ## Caveman token saver (optional)
406
+ ## Caveman mode (optional)
420
407
 
421
- Compresses AI responses 65–75% by stripping filler words. Enabled optionally during `init`. Injected into every agent file automatically.
408
+ Cuts AI response length by 65–75% by removing filler words. Opt in during `init`.
422
409
 
423
- | Level | Style |
410
+ | Level | What it does |
424
411
  |---|---|
425
- | `lite` | Professional terseness |
426
- | `full` | Caveman mode |
427
- | `ultra` | Telegraphic, minimum words |
412
+ | `lite` | Professional and concise |
413
+ | `full` | Caveman-style short answers |
414
+ | `ultra` | Absolute minimum words |
428
415
 
429
416
  ---
430
417
 
431
- ## Typical workflow
418
+ ## Day-to-day workflow
432
419
 
433
420
  ```bash
434
- # New project
421
+ # Starting a new project
435
422
  cd my-api
436
423
  npx @shahmilsaari/memory-core init
424
+ npx @shahmilsaari/memory-core seed
437
425
  npx @shahmilsaari/memory-core hook install
438
426
 
439
- # Save a decision mid-project
440
- npx @shahmilsaari/memory-core remember "All auth goes through middleware, never duplicated in controllers" \
427
+ # Made an architectural decision? Save it.
428
+ npx @shahmilsaari/memory-core remember "All auth goes through middleware, never in controllers" \
441
429
  --type decision --scope global
442
430
 
443
- # Sync agent files after new decisions
431
+ # Refresh agent files after saving new memories
444
432
  npx @shahmilsaari/memory-core sync
445
433
 
446
- # Search before making an architectural decision
434
+ # Not sure how something was decided? Search.
447
435
  npx @shahmilsaari/memory-core search "caching strategy"
448
436
 
449
- # Try to commit code that breaks rules → hook blocks it with explanation
437
+ # Commit code → hook checks it automatically
450
438
  git commit -m "add user endpoint"
451
439
  ```
452
440
 
@@ -454,49 +442,51 @@ git commit -m "add user endpoint"
454
442
 
455
443
  ## Environment variables
456
444
 
457
- | Variable | Required | Default | Description |
445
+ memory-core creates `.memory-core.env` automatically during `init`. You can also set these manually:
446
+
447
+ | Variable | Required | Default | What it does |
458
448
  |---|---|---|---|
459
449
  | `DATABASE_URL` | Yes | — | PostgreSQL connection string |
460
- | `OLLAMA_URL` | No | `http://localhost:11434` | Ollama server URL |
461
- | `OLLAMA_MODEL` | No | `nomic-embed-text` | Embedding model |
462
- | `OLLAMA_CHAT_MODEL` | No | `llama3.2` | Chat model for pre-commit checks |
450
+ | `OLLAMA_URL` | No | `http://localhost:11434` | Where Ollama is running |
451
+ | `OLLAMA_MODEL` | No | `nomic-embed-text` | Model used for search |
452
+ | `OLLAMA_CHAT_MODEL` | No | `llama3.2` | Model used for code checking |
463
453
 
464
454
  ---
465
455
 
466
456
  ## Troubleshooting
467
457
 
468
458
  **`extension "vector" is not available`**
469
- pgvector not installed for your PostgreSQL version. See [pgvector setup](#2-pgvector-setup).
459
+ pgvector isn't installed for your PostgreSQL version. Follow the [pgvector install steps](#pgvector) above.
470
460
 
471
461
  **`Ollama not running — skipping rule check`**
472
462
  Start Ollama: `brew services start ollama` (macOS) or `ollama serve` (Linux).
473
463
 
474
464
  **`Chat model "llama3.2" not found`**
475
- Pull the model: `ollama pull llama3.2`. Or set `OLLAMA_CHAT_MODEL=mistral` in `.env`.
465
+ Run `ollama pull llama3.2`. Or switch to another model: add `OLLAMA_CHAT_MODEL=mistral` to `.memory-core.env`.
476
466
 
477
467
  **`DATABASE_URL is not set`**
478
- Create `.env` in your project root. See [Configure environment](#5-configure-environment).
468
+ Run `npx @shahmilsaari/memory-core init` it will create the `.memory-core.env` file for you.
479
469
 
480
470
  **`createdb: role does not exist`**
481
471
  ```bash
482
472
  createuser -s $(whoami)
483
473
  ```
484
474
 
485
- **Pre-commit hook flagging config/JSON files**
486
- The hook only checks source files (`.ts .tsx .js .jsx .py .php .rb .go .java .cs .swift .kt .rs .vue .svelte`). Config and env files are automatically skipped.
475
+ **Hook is flagging JSON or config files**
476
+ It won't — the hook only checks source code files: `.ts .tsx .js .jsx .py .php .rb .go .java .cs .swift .kt .rs .vue .svelte`. Everything else is skipped automatically.
487
477
 
488
478
  ---
489
479
 
490
480
  ## Roadmap
491
481
 
492
- | Feature | Description |
482
+ | | Feature |
493
483
  |---|---|
494
- | CI/CD check | GitHub Actions workflow fails PRs that violate rules |
495
- | ✓ Watch mode | `memory-core watch` checks files on save in real-time |
496
- | Violation memory | Auto-save caught violations as "never do X, do Y" memories |
497
- | Rule analytics | Track which rules break most, which files are worst offenders |
498
- | Team sync | `memory-core push/pull` shared memory pool across the whole team |
499
- | Memory review | `memory-core approve` team sign-off before rules propagate |
484
+ | | Watch modereal-time violation alerts on save |
485
+ | | CI/CDfail PRs that violate your rules |
486
+ | | Violation memory auto-save what went wrong as a new rule |
487
+ | | Rule analytics see which rules get broken most |
488
+ | | Team sync — share memory across your whole team |
489
+ | | Memory review approve rules before they propagate |
500
490
 
501
491
  ---
502
492
 
package/dist/cli.js CHANGED
@@ -789,14 +789,6 @@ import { existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
789
789
  import { join as join5, relative } from "path";
790
790
  import chalk2 from "chalk";
791
791
  var SOURCE_EXTENSIONS = /\.(ts|tsx|js|jsx|py|php|rb|go|java|cs|swift|kt|rs|vue|svelte)$/;
792
- var IGNORE_PATTERNS = [
793
- /node_modules/,
794
- /\.git/,
795
- /dist\//,
796
- /build\//,
797
- /coverage\//,
798
- /\.memory-core/
799
- ];
800
792
  var reasonMap2 = new Map(
801
793
  seeds.filter((s) => s.reason).map((s) => [s.content, s.reason])
802
794
  );
@@ -966,17 +958,22 @@ function startWatch(options = {}) {
966
958
  const pending = /* @__PURE__ */ new Map();
967
959
  let ollamaWarned = false;
968
960
  const watcher = watch(watchPath, {
969
- ignored: (filePath) => {
970
- if (IGNORE_PATTERNS.some((p) => p.test(filePath))) return true;
971
- const isFile = !filePath.endsWith("/");
972
- if (isFile && !SOURCE_EXTENSIONS.test(filePath)) return true;
973
- return false;
974
- },
961
+ ignored: [
962
+ "**/node_modules/**",
963
+ "**/.git/**",
964
+ "**/dist/**",
965
+ "**/build/**",
966
+ "**/coverage/**",
967
+ "**/.memory-core*"
968
+ ],
975
969
  ignoreInitial: true,
976
970
  persistent: true,
977
971
  awaitWriteFinish: { stabilityThreshold: 150, pollInterval: 50 }
978
972
  });
973
+ const keepAlive = setInterval(() => {
974
+ }, 1 << 30);
979
975
  const handle = (filePath) => {
976
+ if (!SOURCE_EXTENSIONS.test(filePath)) return;
980
977
  if (pending.has(filePath)) clearTimeout(pending.get(filePath));
981
978
  const timer = setTimeout(async () => {
982
979
  pending.delete(filePath);
@@ -1005,6 +1002,7 @@ function startWatch(options = {}) {
1005
1002
  });
1006
1003
  process.on("SIGINT", () => {
1007
1004
  console.log(chalk2.dim("\n\n archmind watch stopped.\n"));
1005
+ clearInterval(keepAlive);
1008
1006
  watcher.close();
1009
1007
  process.exit(0);
1010
1008
  });
@@ -1039,6 +1037,7 @@ function printBanner(projectName, agentCount) {
1039
1037
  ];
1040
1038
  lines.forEach((l) => console.log(l));
1041
1039
  }
1040
+ var { version } = JSON.parse(readFileSync5(new URL("../package.json", import.meta.url), "utf-8"));
1042
1041
  var CONFIG_FILE = ".memory-core.json";
1043
1042
  function readProjectConfig() {
1044
1043
  const path = join6(process.cwd(), CONFIG_FILE);
@@ -1053,7 +1052,7 @@ function writeProjectConfig(config2) {
1053
1052
  writeFileSync3(join6(process.cwd(), CONFIG_FILE), JSON.stringify(config2, null, 2));
1054
1053
  }
1055
1054
  var program = new Command();
1056
- program.name("memory-core").description("Universal AI memory core \u2014 generate AI context files for all coding agents").version("0.1.0");
1055
+ program.name("memory-core").description("Universal AI memory core \u2014 generate AI context files for all coding agents").version(version);
1057
1056
  program.command("init").description("Initialize memory-core in the current project").action(async () => {
1058
1057
  console.log(chalk3.bold.cyan("\n memory-core init\n"));
1059
1058
  const detected = detectProject();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shahmilsaari/memory-core",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Universal AI memory core — generate AI context files from architecture profiles with RAG support",
5
5
  "type": "module",
6
6
  "bin": {