toolnet-memory 0.3.7 → 0.3.9

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