toolnet-memory 0.3.7 → 0.3.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 CHANGED
@@ -15,469 +15,592 @@
15
15
 
16
16
  ---
17
17
 
18
- ## What it does
18
+ ## What is ToolNet Memory?
19
19
 
20
- ToolNet Memory is a persistent memory layer for AI coding workflows. It keeps project knowledge outside any single agent session so Agy / Antigravity, OpenCode, Codex, and MCP-compatible tools can continue work without rebuilding context from zero.
20
+ ToolNet Memory is a persistent project-memory and code-intelligence layer for AI coding agents.
21
21
 
22
- It stores durable working context such as:
22
+ It keeps project knowledge outside a single chat/session so supported agents can move between sessions without rebuilding project context from zero.
23
23
 
24
- - project mission and current objective,
25
- - decisions, rules, blockers, warnings, and next actions,
26
- - completed and active work,
27
- - structured session handoff state,
28
- - semantic project/code context,
29
- - source symbols, dependencies, architecture, and impact relationships.
24
+ ToolNet Memory combines four layers:
30
25
 
31
- ToolNet Memory is **not a raw transcript dump**. Session history and durable project memory are treated separately, and only useful project context should be promoted into long-term memory.
26
+ - **Fast project context** local startup context with no deep recovery.
27
+ - **Work continuity** — current goal, task, phase, blockers, decisions, and next actions.
28
+ - **Durable memory** — filtered project knowledge that survives agent/session changes.
29
+ - **Code intelligence** — symbols, dependencies, call relationships, architecture, impact analysis, semantic search, and graph visualization.
30
+
31
+ ToolNet Memory is **not a raw transcript dump**. Session history and durable project memory are kept separate, filtered, bounded, and selectively promoted.
32
+
33
+ ---
32
34
 
33
35
  ## Quick Start
34
36
 
37
+ ### 1. Install once per VPS / user
38
+
35
39
  ```bash
36
- # Install globally (once per VPS/user)
37
40
  curl -fsSL https://memory.toolnet.tech/install | bash
41
+ ```
42
+
43
+ Or:
44
+
45
+ ```bash
46
+ npm install -g toolnet-memory@latest
47
+ ```
48
+
49
+ Requires **Node.js 22+**.
50
+
51
+ Verify:
52
+
53
+ ```bash
54
+ toolnet-memory --version
55
+ toolnet-memory doctor
56
+ ```
57
+
58
+ ### 2. Configure ToolNet once
38
59
 
39
- # Initialize project
60
+ ```bash
61
+ toolnet-memory setup
62
+ ```
63
+
64
+ Global configuration is stored outside project repositories:
65
+
66
+ ```text
67
+ ~/.config/toolnet-memory/.env
68
+ ```
69
+
70
+ ### 3. Initialize a project
71
+
72
+ ```bash
40
73
  cd /path/to/project
41
74
  toolnet-memory init
75
+ ```
42
76
 
43
- # View fast startup context
44
- toolnet-memory
77
+ ### 4. Build project intelligence once
78
+
79
+ ```bash
80
+ toolnet-memory index
45
81
  ```
46
82
 
47
- **Fast Context Output:**
83
+ The full index builds:
48
84
 
49
85
  ```text
50
- # Profile
86
+ Scanning files
87
+
88
+ Parsing code
89
+
90
+ Type Resolution
91
+
92
+ Rich Graph
93
+
94
+ Semantic Code Index
95
+
96
+ Architecture Intelligence
97
+
98
+ Graph Analysis
99
+
100
+ 3D Visualization Dataset
101
+ ```
51
102
 
52
- Your development preferences and coding style.
103
+ After the first full index, use incremental indexing for normal changes:
104
+
105
+ ```bash
106
+ toolnet-memory incremental
107
+ ```
53
108
 
54
109
  ---
55
110
 
56
- # Current Work
111
+ ## Normal Daily Workflow
57
112
 
58
- Mission: Build authentication system
59
- Objective: Implement OAuth2 flow
60
- Phase: Implementation
61
- Task: Add token refresh logic
113
+ In normal use, users should not need to manually load large session histories.
62
114
 
63
- Next Actions:
64
- - [ ] Implement refresh token endpoint
65
- - [ ] Add token expiry validation
115
+ ```text
116
+ Open project
117
+
118
+ Agent detects ToolNet project
119
+
120
+ Fast local context loads
121
+
122
+ Agent continues current work
123
+
124
+ ToolNet captures meaningful continuity
66
125
  ```
67
126
 
68
- The default command (`toolnet-memory` with no arguments) prints fast startup context from local files only (~150ms, no network/storage access). This provides AI agents with immediate project context at session start.
127
+ Fast context can be viewed manually with:
69
128
 
70
- ## Installation
71
-
72
- ToolNet Memory is installed **once per VPS/user account**, not once per project.
129
+ ```bash
130
+ toolnet-memory
131
+ ```
73
132
 
74
- Recommended installer:
133
+ or:
75
134
 
76
135
  ```bash
77
- curl -fsSL https://memory.toolnet.tech/install | bash
136
+ toolnet-memory context
78
137
  ```
79
138
 
80
- Alternative installer:
139
+ The default startup context is intentionally small and local. Deep recovery is reserved for cases where fast context is insufficient.
81
140
 
82
- ```bash
83
- npx toolnet-memory-install
141
+ ---
142
+
143
+ ## Switching Between Coding Agents
144
+
145
+ ToolNet Memory is designed for workflows such as:
146
+
147
+ ```text
148
+ OpenCode → Agy / Antigravity → Codex → Claude Code → Kiro CLI
84
149
  ```
85
150
 
86
- Or install directly from npm:
151
+ The next agent should receive the same project continuity instead of starting from zero.
87
152
 
88
- ```bash
89
- npm install -g toolnet-memory@latest
153
+ Typical continuity includes:
154
+
155
+ ```text
156
+ Last agent
157
+ Last session
158
+ Current request
159
+ Current activity
160
+ Goal
161
+ Plan
162
+ Current phase
163
+ Blockers
164
+ Decisions
165
+ Next actions
90
166
  ```
91
167
 
92
- Requires **Node.js 22+**.
168
+ Supported integrations currently include:
93
169
 
94
- Verify:
170
+ ```bash
171
+ toolnet-memory integrate:auto
172
+ toolnet-memory integrate:agy
173
+ toolnet-memory integrate:opencode
174
+ toolnet-memory integrate:codex
175
+ toolnet-memory integrate:claude
176
+ toolnet-memory integrate:kiro
177
+ ```
178
+
179
+ Detect integrations without modifying configuration:
95
180
 
96
181
  ```bash
97
- toolnet-memory --version
98
- toolnet-memory doctor
182
+ toolnet-memory integrate:detect
99
183
  ```
100
184
 
101
- ## Storage Configuration
102
185
 
103
- ToolNet Memory supports multiple storage backends.
104
- **Cloudflare R2 is the default and recommended provider**, but ToolNet Memory does not require Cloudflare or Hugging Face. You can also use any supported S3-compatible backend or run fully local without any cloud storage.
186
+ ### Kiro CLI
187
+ ToolNet Memory integrates with Kiro through MCP and lifecycle hooks.
188
+ ```bash
189
+ toolnet-memory integrate:kiro
190
+ toolnet-memory integrate:kiro --status
105
191
 
106
- ### Cloudflare R2 default
192
+ Kiro receives compact ToolNet startup context, cross-agent continuity through memory_agent_ask, local WAL capture, final Stop flush, and raw-session-history protection through PreToolUse.
107
193
 
108
- ````bash
109
- # ~/.config/toolnet-memory/.env
110
- MEMORY_STORAGE_PROVIDER=r2
111
- R2_ACCOUNT_ID=your-account-id
112
- R2_BUCKET=toolnet-memory
113
- R2_ACCESS_KEY_ID=your-access-key
114
- R2_SECRET_ACCESS_KEY=your-secret-key
194
+ Kiro uses the shared ToolNet continuity core and does not maintain a separate memory database.
115
195
 
116
- Generic S3 / S3-compatible
196
+ ToolNet Memory also exposes an MCP server:
117
197
 
118
- Works with AWS S3 and compatible services such as MinIO, Backblaze B2 S3, Wasabi, and similar providers.
198
+ ```bash
199
+ toolnet-memory mcp
200
+ ```
119
201
 
120
- MEMORY_STORAGE_PROVIDER=s3
121
- # Leave empty for AWS S3.
122
- S3_ENDPOINT=
123
- S3_REGION=us-east-1
124
- S3_BUCKET=toolnet-memory
125
- S3_ACCESS_KEY_ID=your-access-key
126
- S3_SECRET_ACCESS_KEY=your-secret-key
127
- S3_FORCE_PATH_STYLE=false
202
+ ---
128
203
 
129
- Local storage no cloud required
204
+ ## Project Operating Manual
130
205
 
131
- ToolNet Memory can run completely locally.
206
+ Every project can define persistent mandatory rules in:
132
207
 
133
- MEMORY_STORAGE_PROVIDER=local
134
- MEMORY_LOCAL_STORAGE_PATH=/path/to/toolnet-memory-storage
135
- MEMORY_LOCAL_CACHE_MB=200
208
+ ```text
209
+ .toolnet/PROJECT.md
210
+ ```
136
211
 
137
- Local mode is useful for:
212
+ Create it with:
138
213
 
139
- * offline development,
140
- * private projects that must not use remote storage,
141
- * testing,
142
- * single-machine workflows.
214
+ ```bash
215
+ toolnet-memory project:manual-init
216
+ ```
143
217
 
144
- No R2, S3, or Hugging Face account is required.
218
+ Example:
145
219
 
146
- Hugging Face S3 — legacy compatibility
220
+ ```md
221
+ # ToolNet Project Operating Manual
147
222
 
148
- Existing installations can continue using the Hugging Face S3-compatible backend.
223
+ ## Critical Rules
149
224
 
150
- MEMORY_STORAGE_PROVIDER=huggingface
151
- HF_NAMESPACE=your-namespace
152
- HF_BUCKET=toolnet-memory
153
- HF_S3_ACCESS_KEY_ID=your-access-key
154
- HF_S3_SECRET_ACCESS_KEY=your-secret-key
225
+ - [enforce] Only edit source code inside /root/project/source.
226
+ - [enforce] Never modify production files directly.
227
+ - [enforce] Deploy only with /root/project/deploy.sh --apply.
228
+ - [advisory] Prefer small focused changes.
229
+ ```
155
230
 
156
- Hugging Face remains supported for compatibility, but new installations should normally prefer R2, generic S3, or local storage.
231
+ ToolNet recognizes:
157
232
 
158
- Embedding provider
233
+ - `[enforce]` — mandatory project rule.
234
+ - `[advisory]` — project recommendation.
159
235
 
160
- The current Hugging Face embedding configuration is independent from the storage provider.
236
+ Show or sync the manual:
161
237
 
162
- For example, you can use:
238
+ ```bash
239
+ toolnet-memory project:manual-show
240
+ toolnet-memory project:manual-sync
241
+ ```
163
242
 
164
- Cloudflare R2 storage + Hugging Face embeddings
165
- Local storage + Hugging Face embeddings
166
- Generic S3 storage + Hugging Face embeddings
243
+ This is the correct place for rules such as:
167
244
 
168
- Embedding configuration:
245
+ - allowed source path,
246
+ - development vs production environment,
247
+ - deployment commands,
248
+ - files that must not be edited,
249
+ - verification requirements,
250
+ - architecture constraints.
169
251
 
170
- HF_TOKEN=
171
- HF_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
252
+ Secrets and credentials should remain in `.env` or another secret store, not in `PROJECT.md`.
172
253
 
173
- See docs/STORAGE.md⁠ for detailed provider setup.
254
+ ---
174
255
 
256
+ ## Code Intelligence
175
257
 
176
- ## One-time VPS setup
258
+ ToolNet Memory builds a persistent structural model of the project so coding agents can understand relationships before changing code.
177
259
 
178
- Global configuration is stored at:
260
+ Capabilities include:
179
261
 
180
- ```text
181
- ~/.config/toolnet-memory/.env
182
- ````
262
+ - source symbol indexing,
263
+ - imports and dependencies,
264
+ - callers and callees,
265
+ - type relationships,
266
+ - architecture layers,
267
+ - subsystem clustering,
268
+ - hotspots,
269
+ - dead-code candidates,
270
+ - semantic code search,
271
+ - dependency paths,
272
+ - change-impact analysis,
273
+ - visualization datasets.
183
274
 
184
- Run setup once on a new VPS/user account:
275
+ Useful commands:
185
276
 
186
277
  ```bash
187
- toolnet-memory setup
278
+ # Full index
279
+ toolnet-memory index
280
+
281
+ # Incremental update
282
+ toolnet-memory incremental
283
+
284
+ # Semantic search
285
+ toolnet-memory semantic "authentication flow"
286
+
287
+ # Change impact
288
+ toolnet-memory impact src/auth.ts
188
289
  ```
189
290
 
190
- The setup flow can configure storage backend and detect supported coding agents. Credentials stay outside project repositories and must never be committed.
291
+ The goal is not only to find code, but to help an agent understand **what may break if a file, symbol, or dependency changes**.
191
292
 
192
- ## Per-project setup
293
+ ---
193
294
 
194
- Each source project gets a stable identity and isolated remote namespace.
295
+ ## Code Graph UI
195
296
 
196
- ```bash
197
- cd /path/to/project
297
+ ToolNet Memory includes a project graph visualization UI.
198
298
 
199
- # Initialize project and create agent instruction files
200
- toolnet-memory init
299
+ Start it with:
201
300
 
202
- # Or manually:
203
- toolnet-memory project:manual-init --project "$PWD"
204
- toolnet-memory profile:sync
205
- toolnet-memory index
301
+ ```bash
302
+ toolnet-memory graph
206
303
  ```
207
304
 
208
- ToolNet creates project metadata under:
305
+ The graph uses real indexed ToolNet project data.
306
+
307
+ For large projects, the UI uses a lightweight drill-down flow instead of rendering the complete symbol graph at once:
209
308
 
210
309
  ```text
211
- .toolnet/
212
- ├── profile.md # Your development preferences
213
- └── current.md # Current work state
310
+ Overview
311
+
312
+ Subsystems
313
+
314
+ Files
315
+
316
+ Symbols + relationships
214
317
  ```
215
318
 
216
- And agent instruction files in the project root:
319
+ This keeps the graph usable on large projects and mobile browsers while preserving access to detailed relationships when needed.
320
+
321
+ The graph server defaults to:
217
322
 
218
323
  ```text
219
- GEMINI.md # Instructions for Gemini/Agy
220
- AGENTS.md # Standard agent instructions
221
- CLAUDE.md # Instructions for Claude/Codex
324
+ 127.0.0.1:9749
222
325
  ```
223
326
 
224
- These files provide fast startup context to AI agents without requiring network access or deep memory recovery.
327
+ To expose it temporarily on a VPS network interface:
225
328
 
226
- A stable project identity prevents memory from being mixed merely because folders are renamed or moved.
329
+ ```bash
330
+ TOOLNET_GRAPH_HOST=0.0.0.0 \
331
+ TOOLNET_GRAPH_PORT=9749 \
332
+ toolnet-memory graph
333
+ ```
227
334
 
228
- Remote storage is scoped by project:
335
+ ---
229
336
 
230
- ```text
231
- projects/<project-remote>/
232
- ├── memory/ # Persistent project memory
233
- ├── code/ # Code intelligence index
234
- ├── sessions/ # Session transcripts (filtered)
235
- ├── work/ # Work continuity state
236
- └── snapshots/ # Project snapshots
237
- ```
337
+ ## Memory and Work Continuity
238
338
 
239
- ## Agent integration
339
+ View the current work state:
240
340
 
241
- Automatic integration can detect supported agents installed for the current user:
341
+ ```bash
342
+ toolnet-memory work
343
+ ```
344
+
345
+ or:
242
346
 
243
347
  ```bash
244
- toolnet-memory integrate:auto
348
+ toolnet-memory work:status
245
349
  ```
246
350
 
247
- Or integrate individually:
351
+ Ask project memory directly:
248
352
 
249
353
  ```bash
250
- toolnet-memory integrate:agy
251
- toolnet-memory integrate:opencode
252
- toolnet-memory integrate:codex
354
+ toolnet-memory ask "What was changed in the authentication flow?"
253
355
  ```
254
356
 
255
- Integration is normally a **one-time user/VPS operation**. Project selection remains automatic through the project's ToolNet identity.
357
+ Review or reconcile durable memory:
256
358
 
257
- After setup, use your coding agent normally:
359
+ ```bash
360
+ toolnet-memory memory:review
361
+ toolnet-memory memory:reconcile
362
+ ```
363
+
364
+ ToolNet tracks structured continuity such as:
258
365
 
259
366
  ```text
260
- Agy / Antigravity ─┐
261
- OpenCode ├──> ToolNet Memory ──> Project-scoped context
262
- Codex ┘
367
+ Mission
368
+ Objective
369
+ Phase
370
+ Task
371
+ Deliverable
372
+ Definition of Done
373
+ Dependencies
374
+ Decisions
375
+ Blockers
376
+ Warnings
377
+ Next Actions
263
378
  ```
264
379
 
265
- The intended normal workflow does not require users to manually say "save memory" or "load memory". Agent/session hooks capture meaningful activity and restore relevant project context at the next session.
380
+ ---
266
381
 
267
382
  ## Fast Context vs Deep Recovery
268
383
 
269
- ToolNet Memory provides two levels of context:
384
+ ### Fast Context default
270
385
 
271
- ### Fast Context (Default)
272
-
273
- Fast context reads only local files (`.toolnet/profile.md`, `.toolnet/current.md`) and completes in ~150ms without network or storage access. This is the default behavior and provides immediate startup context.
386
+ Fast context is local, bounded, and intended for normal agent startup.
274
387
 
275
388
  ```bash
276
- # Fast context (default command)
277
389
  toolnet-memory
278
390
  toolnet-memory context:print
279
-
280
- # Sync profile and current work to local files
281
- toolnet-memory profile:sync
282
391
  ```
283
392
 
284
- ### Deep Recovery (Manual Only)
393
+ It uses project-local ToolNet files and does not automatically dump remote history into the prompt.
285
394
 
286
- Deep memory recovery fetches full session history and project memory from remote storage. This is **manual only** and not run automatically at agent startup to avoid noise and latency.
395
+ ### Deep Recovery manual only
396
+
397
+ Use deep recovery only when the normal fast context is not enough.
287
398
 
288
399
  ```bash
289
- # Recover last 10 sessions (default limit)
400
+ toolnet-memory brief
401
+ toolnet-memory handoff:latest
290
402
  toolnet-memory session:agy-recover
403
+ toolnet-memory session:codex-recover
404
+ toolnet-memory session:opencode-recover
405
+ ```
291
406
 
292
- # Get latest handoff brief
293
- toolnet-memory handoff:latest
407
+ These commands are intentionally **not** meant to run automatically on every agent startup.
294
408
 
295
- # Full brief with memory
296
- toolnet-memory brief
297
- ```
409
+ ---
298
410
 
299
- Session transcripts are filtered to remove:
411
+ ## AI Providers and Models
300
412
 
301
- - System messages and tool logs
302
- - npm install/build noise
303
- - Sensitive data patterns
304
- - Redundant context
413
+ ToolNet separates the reasoning model from the embedding model.
305
414
 
306
- ## Memory retrieval and automation
415
+ Run interactive setup:
307
416
 
308
- ToolNet Memory exposes retrieval and automation controls through the global environment configuration.
417
+ ```bash
418
+ toolnet-memory setup
419
+ ```
309
420
 
310
- These settings are optional. The defaults are designed to work without manual tuning.
421
+ View provider state:
311
422
 
312
- Automatic memory behavior
423
+ ```bash
424
+ toolnet-memory provider
425
+ toolnet-memory provider:list
426
+ toolnet-memory provider:status
427
+ toolnet-memory provider:test llm
428
+ toolnet-memory provider:test embedding
429
+ ```
313
430
 
314
- MEMORY_AUTO_CAPTURE=true
315
- MEMORY_AUTO_RETRIEVE=true
316
- MEMORY_AUTO_SUMMARIZE=true
317
- MEMORY_AUTO_SYNC=true
431
+ View or change the active model:
318
432
 
319
- - MEMORY_AUTO_CAPTURE — capture meaningful project activity.
320
- - MEMORY_AUTO_RETRIEVE — allow relevant memory retrieval.
321
- - MEMORY_AUTO_SUMMARIZE — generate compact summaries instead of persisting raw conversational noise.
322
- - MEMORY_AUTO_SYNC — sync eligible project state to the configured storage backend.
433
+ ```bash
434
+ toolnet-memory model
435
+ toolnet-memory model status
436
+ toolnet-memory model list
437
+ toolnet-memory model set <model>
438
+ ```
323
439
 
324
- Retrieval limits
440
+ Canonical configuration uses:
325
441
 
326
- MEMORY_MAX_CANDIDATES=50
327
- MEMORY_RERANK_TOP=10
328
- MEMORY_FINAL_CONTEXT=5
329
- MEMORY_TOKEN_BUDGET=2000
442
+ ```text
443
+ TOOLNET_LLM_PROVIDER
444
+ TOOLNET_LLM_API_KEY
445
+ TOOLNET_LLM_BASE_URL
446
+ TOOLNET_LLM_MODEL
447
+
448
+ TOOLNET_EMBEDDING_PROVIDER
449
+ TOOLNET_EMBEDDING_API_KEY
450
+ TOOLNET_EMBEDDING_BASE_URL
451
+ TOOLNET_EMBEDDING_MODEL
452
+ ```
330
453
 
331
- The retrieval pipeline is intentionally bounded:
454
+ Optional LLM fallbacks are supported for transient failures such as timeouts, HTTP 408, 429, and 5xx responses.
332
455
 
333
- candidate search
334
-
335
- max 50 candidates
336
-
337
- rerank top 10
338
-
339
- select up to 5 final context items
340
-
341
- enforce token budget
456
+ ---
342
457
 
343
- Remote storage can contain a large project history, but ToolNet Memory should never dump the entire history into an agent prompt.
458
+ ## Storage
344
459
 
345
- Session continuity
460
+ Supported storage modes include:
346
461
 
347
- TOOLNET_SESSION_LEARNING=1
348
- TOOLNET_WORK_CONTINUITY=1
349
- TOOLNET_SEMANTIC_CONTINUITY=1
350
- TOOLNET_SMART_HANDOFF=1
462
+ - Cloudflare R2,
463
+ - generic S3 / S3-compatible storage,
464
+ - local storage,
465
+ - Hugging Face S3 compatibility mode.
351
466
 
352
- These flags control automatic session learning, work-state continuity, semantic continuity, and compact handoff generation.
467
+ Projects remain isolated by stable ToolNet project identity.
353
468
 
354
- Session history is filtered and selectively promoted. Raw transcript content is not intended to be injected into normal startup context.
469
+ A typical remote layout is:
355
470
 
356
- Context modes
471
+ ```text
472
+ projects/<project>/
473
+ ├── memory/
474
+ ├── code/
475
+ ├── sessions/
476
+ ├── work/
477
+ └── snapshots/
478
+ ```
357
479
 
358
- Normal agent startup uses a small local context budget.
480
+ Project identity is stored locally under:
359
481
 
360
- minimal → project rules + current task
361
- focused → minimal + a small number of relevant memories
362
- deep → manual recovery only
482
+ ```text
483
+ .toolnet/project.json
484
+ ```
363
485
 
364
- Use deep recovery only when older session history is genuinely required.
486
+ Renaming or moving a project directory should not cause unrelated projects to share memory.
365
487
 
366
- ## Example Workflow
488
+ ---
367
489
 
368
- ```bash
369
- # 1. Initialize project
370
- cd /path/to/project
371
- toolnet-memory init
490
+ ## Snapshots and Recovery
372
491
 
373
- # 2. Start coding with your agent
374
- agy "implement user authentication"
492
+ Create and restore project-scoped snapshots:
375
493
 
376
- # 3. Fast context is automatically injected at session start
377
- # Agent sees profile.md + current.md (~150ms)
494
+ ```bash
495
+ toolnet-memory snapshot:list
496
+ toolnet-memory snapshot:create "before refactor"
497
+ toolnet-memory snapshot:restore <id>
498
+ toolnet-memory recover
499
+ ```
378
500
 
379
- # 4. Work continues across sessions
380
- codex "add password reset flow"
501
+ ---
381
502
 
382
- # 5. Query semantic code context
383
- toolnet-memory semantic "auth flow"
503
+ ## Architecture Guard
384
504
 
385
- # 6. Check change impact
386
- toolnet-memory impact src/auth.ts
505
+ ToolNet can evaluate project rules and potentially dangerous changes.
387
506
 
388
- # 7. Manual deep recovery if needed
389
- toolnet-memory session:agy-recover --limit 5
507
+ ```bash
508
+ toolnet-memory guard:check
509
+ toolnet-memory guard:check --file src/path.ts
510
+ toolnet-memory guard:check --command "rm -rf ..."
511
+ toolnet-memory guard:explain
390
512
  ```
391
513
 
392
- ## Core capabilities
393
-
394
- ### Persistent project memory
514
+ The project manual and guard system are intended to reduce accidental violations of important project constraints.
395
515
 
396
- Durable memory can preserve decisions, rules, todos, fixes, blockers, warnings, architecture changes, and next actions while avoiding unnecessary transcript noise.
516
+ ---
397
517
 
398
- ### Work continuity
518
+ ## Background Service
399
519
 
400
- Structured continuity can track:
520
+ ToolNet can optionally run a background daemon:
401
521
 
402
- ```text
403
- Mission
404
- Objective
405
- Phase
406
- Task
407
- Deliverable
408
- Definition of Done
409
- Dependencies
410
- Decisions
411
- Blockers
412
- Warnings
413
- Next Actions
522
+ ```bash
523
+ toolnet-memory service:install
524
+ toolnet-memory service:start
525
+ toolnet-memory service:status
526
+ toolnet-memory service:restart
527
+ toolnet-memory service:stop
528
+ toolnet-memory service:remove
414
529
  ```
415
530
 
416
- Useful commands:
531
+ The background service is optional; the core CLI does not require a permanent daemon for every workflow.
417
532
 
418
- ```bash
419
- toolnet-memory work:status
420
- toolnet-memory brief
421
- toolnet-memory handoff:latest
422
- ```
533
+ ---
423
534
 
424
- ### Code intelligence
535
+ ## CLI Help
425
536
 
426
- A full index can build:
537
+ The default help is intentionally compact:
427
538
 
428
- ```text
429
- Source Index
430
-
431
- Type Resolution
432
-
433
- Rich Graph
434
-
435
- Semantic Code Index
436
-
437
- Architecture Intelligence
438
-
439
- Graph Analysis
440
-
441
- Visualization Dataset
539
+ ```bash
540
+ toolnet-memory help
442
541
  ```
443
542
 
444
- Capabilities include symbol indexing, callers/callees, imports, type resolution, architecture layers, subsystem clusters, hotspots, dead-code candidates, semantic search, dependency analysis, and change-impact analysis.
445
-
446
- Examples:
543
+ Show every command:
447
544
 
448
545
  ```bash
449
- toolnet-memory semantic "authentication flow"
450
- toolnet-memory impact src/path/to/file.ts
451
- toolnet-memory incremental
546
+ toolnet-memory help --all
452
547
  ```
453
548
 
454
- ### MCP
455
-
456
- Expose memory and code intelligence through MCP:
549
+ Show help for one command:
457
550
 
458
551
  ```bash
459
- toolnet-memory mcp
552
+ toolnet-memory help index
553
+ toolnet-memory help model
554
+ toolnet-memory help graph
555
+ ```
556
+
557
+ Main user-facing commands:
558
+
559
+ ```text
560
+ GET STARTED
561
+ setup
562
+ init
563
+ doctor
564
+
565
+ MEMORY
566
+ ask
567
+ context
568
+ work
569
+
570
+ CODE
571
+ index
572
+ semantic
573
+ impact
574
+ graph
575
+
576
+ AI
577
+ model
578
+ provider
579
+
580
+ SYSTEM
581
+ status
582
+ update
460
583
  ```
461
584
 
462
- ### Snapshots and recovery
585
+ Advanced, recovery, service, session, and production commands remain available through `help --all`.
463
586
 
464
- ToolNet supports project-scoped snapshots and recovery workflows without merging state across projects.
587
+ ---
465
588
 
466
- ## Health and configuration
589
+ ## Health and Status
467
590
 
468
- Human-readable health check:
591
+ Quick status:
469
592
 
470
593
  ```bash
471
- toolnet-memory doctor
594
+ toolnet-memory status
472
595
  ```
473
596
 
474
- Machine-readable health check:
597
+ Deeper diagnostics:
475
598
 
476
599
  ```bash
477
- toolnet-memory doctor --json
600
+ toolnet-memory doctor
478
601
  ```
479
602
 
480
- Read or update global configuration:
603
+ Configuration:
481
604
 
482
605
  ```bash
483
606
  toolnet-memory config get KEY
@@ -487,33 +610,47 @@ toolnet-memory config open
487
610
 
488
611
  Secret values are masked in normal CLI output.
489
612
 
613
+ ---
614
+
490
615
  ## Updating
491
616
 
492
617
  ```bash
493
618
  toolnet-memory update
494
619
  ```
495
620
 
496
- The updater checks the latest npm release and updates the global installation.
621
+ Or reinstall the latest npm release:
497
622
 
498
- ## Security model
623
+ ```bash
624
+ npm install -g toolnet-memory@latest
625
+ ```
499
626
 
500
- ToolNet Memory processes source-code metadata, coding-agent activity, and project memory, so project isolation and secret handling are core requirements.
627
+ ---
628
+
629
+ ## Security Model
630
+
631
+ ToolNet Memory processes source-code metadata, project instructions, agent activity, and durable memory.
632
+
633
+ Important rules:
501
634
 
502
635
  - Never commit `.env` files or credentials.
636
+ - Keep VPS passwords, API keys, and tokens out of `PROJECT.md`.
503
637
  - Sanitize secrets before durable persistence.
504
- - Never silently inject memory from another project.
505
- - Avoid placing full authentication tokens in logs or diagnostics.
506
- - Treat raw agent transcripts as potentially sensitive.
507
- - Storage credentials are stored in `~/.config/toolnet-memory/.env` (never in project repos).
638
+ - Never inject memory from another project.
639
+ - Treat raw coding-agent transcripts as sensitive.
640
+ - Keep deep recovery manual and bounded.
641
+ - Store global ToolNet credentials outside project repositories.
508
642
 
509
643
  See [SECURITY.md](SECURITY.md) for vulnerability reporting.
510
644
 
645
+ ---
646
+
511
647
  ## Development
512
648
 
513
649
  ```bash
514
650
  git clone https://github.com/LBT-AI/toolnet-memory.git
515
651
  cd toolnet-memory
516
652
  npm ci
653
+
517
654
  npm run lint
518
655
  npm run format:check
519
656
  npm run typecheck
@@ -522,101 +659,38 @@ npm run build:release
522
659
  npm pack --dry-run
523
660
  ```
524
661
 
525
- Installer validation:
662
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution rules.
526
663
 
527
- ```bash
528
- bash -n scripts/install.sh
529
- ```
530
-
531
- See [CONTRIBUTING.md](CONTRIBUTING.md) for repository rules and pull-request requirements.
664
+ ---
532
665
 
533
666
  ## Releases
534
667
 
535
- CI validates pushes and pull requests. Version tags trigger the release workflow, which validates the package, publishes through npm Trusted Publishing (OIDC), creates the GitHub Release, and attaches the npm tarball.
668
+ ToolNet Memory uses GitHub Actions for CI and npm releases.
536
669
 
537
- The release tag must match `package.json` exactly:
670
+ Before a release, the repository validates:
538
671
 
539
672
  ```text
540
- package.json: 0.2.10
541
- Git tag: v0.2.10
673
+ lint
674
+ format
675
+ TypeScript
676
+ unit/integration tests
677
+ production build
678
+ npm package contents
542
679
  ```
543
680
 
544
- See [CHANGELOG.md](CHANGELOG.md) for release history.
545
-
546
- ## License
547
-
548
- MIT © 2026 LBT-AI. See [LICENSE](LICENSE).
549
-
550
- ## Multi-provider AI setup
551
-
552
- Run:
553
-
554
- ```bash
555
- toolnet-memory setup
556
-
557
- ToolNet Memory separates AI configuration into independent roles:
558
-
559
- * LLM — reasoning, summarization, classification, and memory intelligence.
560
- * Embedding — semantic indexing and retrieval.
561
- * LLM Fallbacks — optional secondary providers for transient failures.
562
-
563
- Supported LLM providers include:
564
-
565
- * OpenAI-compatible
566
- * Alibaba / DashScope
567
- * OpenRouter
568
- * Groq
569
- * DeepSeek
570
- * NVIDIA NIM
571
- * Gemini
572
- * Hugging Face
573
- * Ollama / Local
574
- * Cloudflare Workers AI
575
- * Custom endpoints
576
-
577
- Canonical configuration:
681
+ Version tags trigger the release workflow and npm Trusted Publishing.
578
682
 
579
- TOOLNET_LLM_PROVIDER=
580
- TOOLNET_LLM_API_KEY=
581
- TOOLNET_LLM_BASE_URL=
582
- TOOLNET_LLM_MODEL=
583
- TOOLNET_EMBEDDING_PROVIDER=
584
- TOOLNET_EMBEDDING_API_KEY=
585
- TOOLNET_EMBEDDING_BASE_URL=
586
- TOOLNET_EMBEDDING_MODEL=
683
+ The tag must match `package.json`:
587
684
 
588
- Optional resilient LLM chain:
589
-
590
- TOOLNET_LLM_FALLBACK_1_PROVIDER=
591
- TOOLNET_LLM_FALLBACK_1_API_KEY=
592
- TOOLNET_LLM_FALLBACK_1_BASE_URL=
593
- TOOLNET_LLM_FALLBACK_1_MODEL=
594
- TOOLNET_LLM_FALLBACK_2_PROVIDER=
595
- TOOLNET_LLM_FALLBACK_2_API_KEY=
596
- TOOLNET_LLM_FALLBACK_2_BASE_URL=
597
- TOOLNET_LLM_FALLBACK_2_MODEL=
598
- TOOLNET_LLM_FALLBACK_COOLDOWN_MS=60000
599
- TOOLNET_LLM_MAX_RETRIES=1
600
-
601
- Fallback is used only for transient failures such as:
602
-
603
- * timeout / network failure
604
- * HTTP 408
605
- * HTTP 429
606
- * HTTP 5xx
607
-
608
- HTTP 400, 401, and 403 are surfaced instead of silently switching providers.
685
+ ```text
686
+ package.json: 0.3.x
687
+ Git tag: v0.3.x
688
+ ```
609
689
 
610
- Legacy provider environment variables remain readable for backward compatibility. The setup wizard can migrate recognized legacy values into canonical TOOLNET_* configuration without deleting the original variables.
690
+ See [CHANGELOG.md](CHANGELOG.md) for release history.
611
691
 
612
- Diagnostics:
692
+ ---
613
693
 
614
- toolnet-memory provider:list
615
- toolnet-memory provider:status
616
- toolnet-memory provider:test
617
- toolnet-memory provider:test llm
618
- toolnet-memory provider:test embedding
619
- toolnet-memory doctor
694
+ ## License
620
695
 
621
- Provider status masks API keys and secrets.
622
- ```
696
+ MIT © 2026 LBT-AI. See [LICENSE](LICENSE).