@rbalchii/anchor-engine 4.7.0 → 4.8.1

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 (141) hide show
  1. package/LICENSE +608 -608
  2. package/README.md +513 -317
  3. package/anchor.bat +5 -5
  4. package/docs/AGENT_CONTROLLED_ENGINE.md +581 -0
  5. package/docs/API.md +314 -314
  6. package/docs/DEPLOYMENT.md +448 -448
  7. package/docs/INDEX.md +226 -226
  8. package/docs/MD_FILES_INVENTORY.md +166 -0
  9. package/docs/STAR_Whitepaper_Executive.md +216 -216
  10. package/docs/TROUBLESHOOTING.md +535 -535
  11. package/docs/arxiv/BIBLIOGRAPHY.bib +145 -145
  12. package/docs/arxiv/RELATED_WORK.tex +38 -38
  13. package/docs/arxiv/compile.bat +48 -48
  14. package/docs/arxiv/joss_response.md +32 -32
  15. package/docs/arxiv/prepare-submission.bat +46 -46
  16. package/docs/arxiv/review.md +127 -127
  17. package/docs/arxiv/star-whitepaper.tex +656 -656
  18. package/docs/code-patterns.md +289 -289
  19. package/docs/daily/TODAY_SUMMARY.md +245 -0
  20. package/docs/guides/BUILDING.md +64 -0
  21. package/docs/guides/INSTALL_NPM.md +160 -0
  22. package/docs/guides/NPM_PUBLISH_SUMMARY.md +231 -0
  23. package/docs/paper.md +124 -0
  24. package/docs/project/PROJECT_STATE_ASSESSMENT.md +312 -0
  25. package/docs/reviews/code-review-v4.8.1-decision-record.md +165 -0
  26. package/docs/testing/TESTING.md +213 -0
  27. package/docs/testing/TESTING_FRAMEWORK_COMPLETE.md +271 -0
  28. package/docs/testing/search-test-report.md +76 -0
  29. package/docs/whitepaper.md +445 -445
  30. package/engine/dist/commands/distill.js +21 -21
  31. package/engine/dist/config/index.d.ts +7 -0
  32. package/engine/dist/config/index.d.ts.map +1 -1
  33. package/engine/dist/config/index.js +22 -0
  34. package/engine/dist/config/index.js.map +1 -1
  35. package/engine/dist/config/paths.d.ts +1 -1
  36. package/engine/dist/config/paths.js +3 -3
  37. package/engine/dist/config/paths.js.map +1 -1
  38. package/engine/dist/core/db.js +131 -131
  39. package/engine/dist/mcp/server.d.ts +44 -0
  40. package/engine/dist/mcp/server.d.ts.map +1 -0
  41. package/engine/dist/mcp/server.js +427 -0
  42. package/engine/dist/mcp/server.js.map +1 -0
  43. package/engine/dist/native/index.d.ts +20 -21
  44. package/engine/dist/native/index.d.ts.map +1 -1
  45. package/engine/dist/profiling/atomization-profiling.js +3 -3
  46. package/engine/dist/profiling/bottleneck-identification.js +35 -35
  47. package/engine/dist/profiling/content-sanitization-profiling.js +86 -86
  48. package/engine/dist/routes/monitoring.js +8 -8
  49. package/engine/dist/routes/v1/admin.js +8 -8
  50. package/engine/dist/routes/v1/atoms.js +15 -15
  51. package/engine/dist/routes/v1/ingest.d.ts.map +1 -1
  52. package/engine/dist/routes/v1/ingest.js +39 -0
  53. package/engine/dist/routes/v1/ingest.js.map +1 -1
  54. package/engine/dist/routes/v1/system.d.ts.map +1 -1
  55. package/engine/dist/routes/v1/system.js +305 -6
  56. package/engine/dist/routes/v1/system.js.map +1 -1
  57. package/engine/dist/routes/v1/tags.js +2 -2
  58. package/engine/dist/services/backup/backup-restore.js +23 -23
  59. package/engine/dist/services/backup/backup.js +14 -14
  60. package/engine/dist/services/distillation/radial-distiller.d.ts +1 -0
  61. package/engine/dist/services/distillation/radial-distiller.d.ts.map +1 -1
  62. package/engine/dist/services/distillation/radial-distiller.js +23 -16
  63. package/engine/dist/services/distillation/radial-distiller.js.map +1 -1
  64. package/engine/dist/services/ingest/github-ingest-service.js +18 -18
  65. package/engine/dist/services/ingest/ingest-atomic.js +79 -79
  66. package/engine/dist/services/ingest/ingest.d.ts.map +1 -1
  67. package/engine/dist/services/ingest/ingest.js +28 -25
  68. package/engine/dist/services/ingest/ingest.js.map +1 -1
  69. package/engine/dist/services/ingest/watchdog.d.ts.map +1 -1
  70. package/engine/dist/services/ingest/watchdog.js +14 -24
  71. package/engine/dist/services/ingest/watchdog.js.map +1 -1
  72. package/engine/dist/services/llm/reader.js +9 -9
  73. package/engine/dist/services/mirror/mirror.js +5 -5
  74. package/engine/dist/services/mirror/mirror.js.map +1 -1
  75. package/engine/dist/services/research/researcher.js +8 -8
  76. package/engine/dist/services/scribe/scribe.js +27 -27
  77. package/engine/dist/services/search/context-inflator.js +34 -34
  78. package/engine/dist/services/search/explore.js +20 -20
  79. package/engine/dist/services/search/physics-tag-walker.js +208 -208
  80. package/engine/dist/services/search/query-parser.js +5 -5
  81. package/engine/dist/services/search/search-utils.js +3 -3
  82. package/engine/dist/services/search/search.js +36 -36
  83. package/engine/dist/services/search/sovereign-system-prompt.js +22 -22
  84. package/engine/dist/services/semantic/semantic-ingestion-service.js +47 -47
  85. package/engine/dist/services/semantic/semantic-search.js +21 -21
  86. package/engine/dist/services/synonyms/auto-synonym-generator.js +35 -35
  87. package/engine/dist/services/system-status.d.ts +34 -0
  88. package/engine/dist/services/system-status.d.ts.map +1 -1
  89. package/engine/dist/services/system-status.js +57 -1
  90. package/engine/dist/services/system-status.js.map +1 -1
  91. package/engine/dist/services/tags/discovery.js +5 -5
  92. package/engine/dist/services/tags/infector.js +6 -6
  93. package/engine/dist/services/tags/tag-auditor.js +51 -51
  94. package/engine/dist/services/taxonomy/taxonomy-manager.js +6 -6
  95. package/engine/dist/utils/tag-cleanup.js +5 -5
  96. package/engine/dist/utils/tag-modulation.js +1 -1
  97. package/engine/dist/utils/tag-modulation.js.map +1 -1
  98. package/engine/package.json +104 -105
  99. package/mcp-server/README.md +404 -0
  100. package/mcp-server/dist/index.d.ts +16 -0
  101. package/mcp-server/dist/index.d.ts.map +1 -0
  102. package/mcp-server/dist/index.js +709 -0
  103. package/mcp-server/dist/index.js.map +1 -0
  104. package/mcp-server/package.json +34 -0
  105. package/package.json +10 -2
  106. package/docs/archive/GIT_BACKUP_VERIFICATION.md +0 -297
  107. package/docs/archive/adoption-guide.md +0 -264
  108. package/docs/archive/adoption-preparation.md +0 -179
  109. package/docs/archive/agent-harness-integration.md +0 -227
  110. package/docs/archive/api-reference.md +0 -106
  111. package/docs/archive/api_flows_diagram.md +0 -118
  112. package/docs/archive/architecture.md +0 -410
  113. package/docs/archive/architecture_diagram.md +0 -174
  114. package/docs/archive/broader-adoption-preparation.md +0 -175
  115. package/docs/archive/browser-paradigm-architecture.md +0 -163
  116. package/docs/archive/chat-integration.md +0 -124
  117. package/docs/archive/community-adoption-materials.md +0 -103
  118. package/docs/archive/community-adoption.md +0 -147
  119. package/docs/archive/comparison-with-siloed-solutions.md +0 -192
  120. package/docs/archive/comprehensive-docs.md +0 -156
  121. package/docs/archive/data_flow_diagram.md +0 -251
  122. package/docs/archive/enhancement-implementation-summary.md +0 -146
  123. package/docs/archive/evolution-summary.md +0 -141
  124. package/docs/archive/ingestion_pipeline_diagram.md +0 -198
  125. package/docs/archive/native-module-profiling-results.md +0 -135
  126. package/docs/archive/positioning-document.md +0 -158
  127. package/docs/archive/positioning.md +0 -175
  128. package/docs/archive/query-builder-documentation.md +0 -218
  129. package/docs/archive/quick-reference.md +0 -40
  130. package/docs/archive/quickstart.md +0 -63
  131. package/docs/archive/relationship-narrative-discovery.md +0 -141
  132. package/docs/archive/search-logic-improvement-plan.md +0 -336
  133. package/docs/archive/search_architecture_diagram.md +0 -212
  134. package/docs/archive/semantic-architecture-guide.md +0 -97
  135. package/docs/archive/sequence-diagrams.md +0 -128
  136. package/docs/archive/system_components_diagram.md +0 -296
  137. package/docs/archive/test-framework-integration.md +0 -109
  138. package/docs/archive/testing-framework-documentation.md +0 -397
  139. package/docs/archive/testing-framework-summary.md +0 -121
  140. package/docs/archive/testing-framework.md +0 -377
  141. package/docs/archive/ui-architecture.md +0 -75
@@ -1,535 +1,535 @@
1
- # Anchor Engine - Troubleshooting Guide
2
-
3
- **Version:** 4.8.0 | **Last Updated:** March 18, 2026
4
-
5
- ---
6
-
7
- ## Quick Fixes
8
-
9
- ### Engine Won't Start
10
- ```bash
11
- # Check if port 3160 is in use
12
- lsof -i :3160
13
-
14
- # Kill existing process
15
- kill -9 <PID>
16
-
17
- # Restart
18
- pnpm start
19
- ```
20
-
21
- ### Out of Memory
22
- Edit `user_settings.json`:
23
- ```json
24
- {
25
- "adaptive_concurrency": {
26
- "environment": "low_memory"
27
- }
28
- }
29
- ```
30
-
31
- ### Can't Find My Data
32
- 1. Check ingestion logs: `engine/logs/server.log`
33
- 2. Verify paths in "Manage Paths" (Web UI)
34
- 3. Try manual ingest via "Paste & Ingest"
35
-
36
- ---
37
-
38
- ## Installation Issues
39
-
40
- ### PNPM Not Found
41
- ```bash
42
- # Install globally
43
- npm install -g pnpm
44
-
45
- # Or use corepack (Node.js 16+)
46
- corepack enable pnpm
47
- ```
48
-
49
- ### Build Fails
50
- ```bash
51
- # Clean and rebuild
52
- rm -rf node_modules pnpm-lock.yaml
53
- pnpm install
54
- pnpm build
55
- ```
56
-
57
- ### Port Already in Use
58
- ```bash
59
- # Find what's using port 3160
60
- lsof -i :3160
61
- netstat -tulpn | grep 3160
62
-
63
- # Kill the process
64
- kill -9 <PID>
65
-
66
- # Or change port in user_settings.json
67
- {
68
- "server": {
69
- "port": 3161
70
- }
71
- }
72
- ```
73
-
74
- ---
75
-
76
- ## Ingestion Issues
77
-
78
- ### Files Not Ingesting
79
-
80
- **Symptoms:** Files added to watched paths don't appear in search
81
-
82
- **Causes:**
83
- 1. Watchdog not running
84
- 2. File in exclude pattern
85
- 3. File too large
86
-
87
- **Solutions:**
88
-
89
- 1. **Check Watchdog Status:**
90
- ```bash
91
- curl http://localhost:3160/v1/watchdog/status
92
- ```
93
-
94
- 2. **Check Exclude Patterns:**
95
- ```json
96
- {
97
- "watcher": {
98
- "exclude_patterns": [
99
- "**/*.log",
100
- "**/node_modules/**",
101
- "**/.git/**"
102
- ]
103
- }
104
- }
105
- ```
106
-
107
- 3. **Manual Ingest:**
108
- - Use Web UI → "Paste & Ingest"
109
- - Or API: `POST /v1/ingest`
110
-
111
- ### Large Files Fail
112
-
113
- **Symptoms:** Timeout or OOM on large file ingestion
114
-
115
- **Solutions:**
116
-
117
- 1. **Use Streaming Ingest:**
118
- ```bash
119
- curl -X POST http://localhost:3160/v1/ingest/streaming \
120
- -F "file=@large-file.txt"
121
- ```
122
-
123
- 2. **Split Files:**
124
- ```bash
125
- # Split into 1MB chunks
126
- split -b 1M large-file.txt chunk-
127
- ```
128
-
129
- 3. **Increase Memory:**
130
- ```bash
131
- NODE_OPTIONS="--max-old-space-size=4096" pnpm start
132
- ```
133
-
134
- ---
135
-
136
- ## Search Issues
137
-
138
- ### No Results Found
139
-
140
- **Symptoms:** Query returns empty results
141
-
142
- **Causes:**
143
- 1. No data ingested
144
- 2. Wrong bucket selected
145
- 3. Token budget too low
146
-
147
- **Solutions:**
148
-
149
- 1. **Verify Data Exists:**
150
- ```bash
151
- curl http://localhost:3160/v1/stats
152
- ```
153
-
154
- 2. **Check Bucket Filters:**
155
- - Web UI: Ensure correct buckets selected
156
- - API: Remove `buckets` filter or add correct ones
157
-
158
- 3. **Increase Token Budget:**
159
- ```json
160
- {
161
- "token_budget": 8192
162
- }
163
- ```
164
-
165
- ### Slow Search
166
-
167
- **Symptoms:** Search takes >5 seconds
168
-
169
- **Causes:**
170
- 1. Max-recall mode enabled
171
- 2. Too many results
172
- 3. Low memory
173
-
174
- **Solutions:**
175
-
176
- 1. **Use Standard Mode:**
177
- ```json
178
- {
179
- "strategy": "standard"
180
- }
181
- ```
182
-
183
- 2. **Limit Results:**
184
- ```json
185
- {
186
- "max_chars": 4096
187
- }
188
- ```
189
-
190
- 3. **Increase Memory:**
191
- ```json
192
- {
193
- "adaptive_concurrency": {
194
- "environment": "high_memory"
195
- }
196
- }
197
- ```
198
-
199
- ---
200
-
201
- ## MCP Issues
202
-
203
- ### MCP Server Not Connecting
204
-
205
- **Symptoms:** Claude/Cursor/Qwen Code can't connect
206
-
207
- **Solutions:**
208
-
209
- 1. **Check MCP Server:**
210
- ```bash
211
- cd mcp-server
212
- npm run build
213
- npm start
214
- ```
215
-
216
- 2. **Verify Config:**
217
- ```json
218
- {
219
- "mcpServers": {
220
- "anchor": {
221
- "command": "node",
222
- "args": ["/path/to/mcp-server/dist/index.js"],
223
- "env": {
224
- "ANCHOR_API_URL": "http://localhost:3160"
225
- }
226
- }
227
- }
228
- }
229
- ```
230
-
231
- 3. **Check Engine is Running:**
232
- ```bash
233
- curl http://localhost:3160/health
234
- ```
235
-
236
- ### Write Operations Disabled
237
-
238
- **Symptoms:** `anchor_ingest_text` returns "Write operations disabled"
239
-
240
- **Solution:**
241
-
242
- Edit `user_settings.json`:
243
- ```json
244
- {
245
- "mcp": {
246
- "allow_write_operations": true,
247
- "default_bucket_for_writes": "external-inbox"
248
- }
249
- }
250
- ```
251
-
252
- ---
253
-
254
- ## Database Issues
255
-
256
- ### Database Corruption
257
-
258
- **Symptoms:** "Database not initialized" or SQL errors
259
-
260
- **Solution:**
261
-
262
- 1. **Stop Engine:**
263
- ```bash
264
- pnpm stop
265
- ```
266
-
267
- 2. **Backup Data:**
268
- ```bash
269
- cp -r engine/context_data engine/context_data.backup
270
- ```
271
-
272
- 3. **Delete Database:**
273
- ```bash
274
- rm -rf engine/context_data
275
- ```
276
-
277
- 4. **Restart (Auto-Rebuild):**
278
- ```bash
279
- pnpm start
280
- ```
281
-
282
- **Note:** Data is preserved in `mirrored_brain/` - database rebuilds from it.
283
-
284
- ### Slow Database
285
-
286
- **Symptoms:** All operations slow
287
-
288
- **Solutions:**
289
-
290
- 1. **Enable WAL Mode:**
291
- ```sql
292
- PRAGMA journal_mode=WAL;
293
- ```
294
-
295
- 2. **Increase Cache:**
296
- ```sql
297
- PRAGMA cache_size=-20000; -- 20MB cache
298
- ```
299
-
300
- 3. **Vacuum:**
301
- ```bash
302
- curl -X POST http://localhost:3160/v1/system/vacuum
303
- ```
304
-
305
- ---
306
-
307
- ## Memory Issues
308
-
309
- ### Out of Memory (OOM)
310
-
311
- **Symptoms:** Process killed, "JavaScript heap out of memory"
312
-
313
- **Solutions:**
314
-
315
- 1. **Low Memory Mode:**
316
- ```json
317
- {
318
- "adaptive_concurrency": {
319
- "environment": "low_memory"
320
- }
321
- }
322
- ```
323
-
324
- 2. **Increase Node Memory:**
325
- ```bash
326
- NODE_OPTIONS="--max-old-space-size=4096" pnpm start
327
- ```
328
-
329
- 3. **Reduce Concurrent Operations:**
330
- ```json
331
- {
332
- "adaptive_concurrency": {
333
- "max_concurrency": 2
334
- }
335
- }
336
- ```
337
-
338
- ### Memory Leak
339
-
340
- **Symptoms:** Memory usage grows continuously
341
-
342
- **Solutions:**
343
-
344
- 1. **Enable GC Logging:**
345
- ```bash
346
- node --expose-gc --trace-gc engine/dist/index.js
347
- ```
348
-
349
- 2. **Manual GC:**
350
- ```bash
351
- curl -X POST http://localhost:3160/v1/system/gc
352
- ```
353
-
354
- 3. **Restart Periodically:**
355
- ```bash
356
- # Cron job to restart daily
357
- 0 3 * * * cd /path/to/anchor-engine-node && pnpm restart
358
- ```
359
-
360
- ---
361
-
362
- ## Web UI Issues
363
-
364
- ### Blank Page
365
-
366
- **Symptoms:** Web UI shows blank page
367
-
368
- **Solutions:**
369
-
370
- 1. **Check Build:**
371
- ```bash
372
- cd packages/anchor-ui
373
- npm run build
374
- ```
375
-
376
- 2. **Clear Cache:**
377
- - Hard refresh: Ctrl+Shift+R (or Cmd+Shift+R on Mac)
378
- - Clear browser cache
379
-
380
- 3. **Check Console:**
381
- - Open DevTools (F12)
382
- - Check Console tab for errors
383
-
384
- ### Can't Add Paths
385
-
386
- **Symptoms:** "Add Path" button doesn't work
387
-
388
- **Solutions:**
389
-
390
- 1. **Check Permissions:**
391
- ```bash
392
- ls -la /path/you/want/to/add
393
- ```
394
-
395
- 2. **Use Absolute Paths:**
396
- - ✅ `/home/user/documents`
397
- - ❌ `~/documents`
398
-
399
- 3. **Check Engine Logs:**
400
- ```bash
401
- tail -f engine/logs/server.log
402
- ```
403
-
404
- ---
405
-
406
- ## Docker Issues
407
-
408
- ### Container Won't Start
409
-
410
- **Symptoms:** `docker-compose up` fails
411
-
412
- **Solutions:**
413
-
414
- 1. **Check Logs:**
415
- ```bash
416
- docker-compose logs
417
- ```
418
-
419
- 2. **Rebuild:**
420
- ```bash
421
- docker-compose down
422
- docker-compose build --no-cache
423
- docker-compose up -d
424
- ```
425
-
426
- 3. **Check Resources:**
427
- ```bash
428
- docker stats
429
- ```
430
-
431
- ### Data Lost After Restart
432
-
433
- **Symptoms:** Data disappears after container restart
434
-
435
- **Cause:** Volumes not mounted correctly
436
-
437
- **Solution:**
438
-
439
- Check `docker-compose.yml`:
440
- ```yaml
441
- volumes:
442
- - ./mirrored_brain:/app/mirrored_brain
443
- - ./backups:/app/backups
444
- - anchor-data:/app/engine/context_data
445
- ```
446
-
447
- ---
448
-
449
- ## Performance Issues
450
-
451
- ### Slow Ingestion
452
-
453
- **Symptoms:** Ingestion takes >1 minute per file
454
-
455
- **Solutions:**
456
-
457
- 1. **Enable Parallel Processing:**
458
- ```json
459
- {
460
- "adaptive_concurrency": {
461
- "environment": "high_memory",
462
- "max_concurrency": 5
463
- }
464
- }
465
- ```
466
-
467
- 2. **Disable Synonyms (Temporarily):**
468
- ```json
469
- {
470
- "tagging": {
471
- "modulation_level": 0
472
- }
473
- }
474
- ```
475
-
476
- 3. **Use Streaming Ingest:**
477
- ```bash
478
- curl -X POST http://localhost:3160/v1/ingest/streaming \
479
- -F "file=@large-file.txt"
480
- ```
481
-
482
- ### High CPU Usage
483
-
484
- **Symptoms:** CPU at 100% continuously
485
-
486
- **Solutions:**
487
-
488
- 1. **Check Watchdog:**
489
- ```bash
490
- curl http://localhost:3160/v1/watchdog/status
491
- ```
492
-
493
- 2. **Reduce Concurrency:**
494
- ```json
495
- {
496
- "adaptive_concurrency": {
497
- "max_concurrency": 2
498
- }
499
- }
500
- ```
501
-
502
- 3. **Profile:**
503
- ```bash
504
- node --prof engine/dist/index.js
505
- node --prof-process isolate-*.log
506
- ```
507
-
508
- ---
509
-
510
- ## Getting Help
511
-
512
- ### Logs Location
513
-
514
- | Log Type | Location |
515
- |----------|----------|
516
- | Server | `engine/logs/server.log` |
517
- | MCP | `mcp-server/logs/` |
518
- | UI | Browser DevTools Console |
519
-
520
- ### Debug Mode
521
-
522
- Enable verbose logging:
523
- ```json
524
- {
525
- "logging": {
526
- "level": "debug"
527
- }
528
- }
529
- ```
530
-
531
- ### Support Channels
532
-
533
- - **GitHub Issues:** https://github.com/RSBalchII/anchor-engine-node/issues
534
- - **Discussions:** https://github.com/RSBalchII/anchor-engine-node/discussions
535
- - **Documentation:** [`docs/`](./)
1
+ # Anchor Engine - Troubleshooting Guide
2
+
3
+ **Version:** 4.8.0 | **Last Updated:** March 18, 2026
4
+
5
+ ---
6
+
7
+ ## Quick Fixes
8
+
9
+ ### Engine Won't Start
10
+ ```bash
11
+ # Check if port 3160 is in use
12
+ lsof -i :3160
13
+
14
+ # Kill existing process
15
+ kill -9 <PID>
16
+
17
+ # Restart
18
+ pnpm start
19
+ ```
20
+
21
+ ### Out of Memory
22
+ Edit `user_settings.json`:
23
+ ```json
24
+ {
25
+ "adaptive_concurrency": {
26
+ "environment": "low_memory"
27
+ }
28
+ }
29
+ ```
30
+
31
+ ### Can't Find My Data
32
+ 1. Check ingestion logs: `engine/logs/server.log`
33
+ 2. Verify paths in "Manage Paths" (Web UI)
34
+ 3. Try manual ingest via "Paste & Ingest"
35
+
36
+ ---
37
+
38
+ ## Installation Issues
39
+
40
+ ### PNPM Not Found
41
+ ```bash
42
+ # Install globally
43
+ npm install -g pnpm
44
+
45
+ # Or use corepack (Node.js 16+)
46
+ corepack enable pnpm
47
+ ```
48
+
49
+ ### Build Fails
50
+ ```bash
51
+ # Clean and rebuild
52
+ rm -rf node_modules pnpm-lock.yaml
53
+ pnpm install
54
+ pnpm build
55
+ ```
56
+
57
+ ### Port Already in Use
58
+ ```bash
59
+ # Find what's using port 3160
60
+ lsof -i :3160
61
+ netstat -tulpn | grep 3160
62
+
63
+ # Kill the process
64
+ kill -9 <PID>
65
+
66
+ # Or change port in user_settings.json
67
+ {
68
+ "server": {
69
+ "port": 3161
70
+ }
71
+ }
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Ingestion Issues
77
+
78
+ ### Files Not Ingesting
79
+
80
+ **Symptoms:** Files added to watched paths don't appear in search
81
+
82
+ **Causes:**
83
+ 1. Watchdog not running
84
+ 2. File in exclude pattern
85
+ 3. File too large
86
+
87
+ **Solutions:**
88
+
89
+ 1. **Check Watchdog Status:**
90
+ ```bash
91
+ curl http://localhost:3160/v1/watchdog/status
92
+ ```
93
+
94
+ 2. **Check Exclude Patterns:**
95
+ ```json
96
+ {
97
+ "watcher": {
98
+ "exclude_patterns": [
99
+ "**/*.log",
100
+ "**/node_modules/**",
101
+ "**/.git/**"
102
+ ]
103
+ }
104
+ }
105
+ ```
106
+
107
+ 3. **Manual Ingest:**
108
+ - Use Web UI → "Paste & Ingest"
109
+ - Or API: `POST /v1/ingest`
110
+
111
+ ### Large Files Fail
112
+
113
+ **Symptoms:** Timeout or OOM on large file ingestion
114
+
115
+ **Solutions:**
116
+
117
+ 1. **Use Streaming Ingest:**
118
+ ```bash
119
+ curl -X POST http://localhost:3160/v1/ingest/streaming \
120
+ -F "file=@large-file.txt"
121
+ ```
122
+
123
+ 2. **Split Files:**
124
+ ```bash
125
+ # Split into 1MB chunks
126
+ split -b 1M large-file.txt chunk-
127
+ ```
128
+
129
+ 3. **Increase Memory:**
130
+ ```bash
131
+ NODE_OPTIONS="--max-old-space-size=4096" pnpm start
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Search Issues
137
+
138
+ ### No Results Found
139
+
140
+ **Symptoms:** Query returns empty results
141
+
142
+ **Causes:**
143
+ 1. No data ingested
144
+ 2. Wrong bucket selected
145
+ 3. Token budget too low
146
+
147
+ **Solutions:**
148
+
149
+ 1. **Verify Data Exists:**
150
+ ```bash
151
+ curl http://localhost:3160/v1/stats
152
+ ```
153
+
154
+ 2. **Check Bucket Filters:**
155
+ - Web UI: Ensure correct buckets selected
156
+ - API: Remove `buckets` filter or add correct ones
157
+
158
+ 3. **Increase Token Budget:**
159
+ ```json
160
+ {
161
+ "token_budget": 8192
162
+ }
163
+ ```
164
+
165
+ ### Slow Search
166
+
167
+ **Symptoms:** Search takes >5 seconds
168
+
169
+ **Causes:**
170
+ 1. Max-recall mode enabled
171
+ 2. Too many results
172
+ 3. Low memory
173
+
174
+ **Solutions:**
175
+
176
+ 1. **Use Standard Mode:**
177
+ ```json
178
+ {
179
+ "strategy": "standard"
180
+ }
181
+ ```
182
+
183
+ 2. **Limit Results:**
184
+ ```json
185
+ {
186
+ "max_chars": 4096
187
+ }
188
+ ```
189
+
190
+ 3. **Increase Memory:**
191
+ ```json
192
+ {
193
+ "adaptive_concurrency": {
194
+ "environment": "high_memory"
195
+ }
196
+ }
197
+ ```
198
+
199
+ ---
200
+
201
+ ## MCP Issues
202
+
203
+ ### MCP Server Not Connecting
204
+
205
+ **Symptoms:** Claude/Cursor/Qwen Code can't connect
206
+
207
+ **Solutions:**
208
+
209
+ 1. **Check MCP Server:**
210
+ ```bash
211
+ cd mcp-server
212
+ npm run build
213
+ npm start
214
+ ```
215
+
216
+ 2. **Verify Config:**
217
+ ```json
218
+ {
219
+ "mcpServers": {
220
+ "anchor": {
221
+ "command": "node",
222
+ "args": ["/path/to/mcp-server/dist/index.js"],
223
+ "env": {
224
+ "ANCHOR_API_URL": "http://localhost:3160"
225
+ }
226
+ }
227
+ }
228
+ }
229
+ ```
230
+
231
+ 3. **Check Engine is Running:**
232
+ ```bash
233
+ curl http://localhost:3160/health
234
+ ```
235
+
236
+ ### Write Operations Disabled
237
+
238
+ **Symptoms:** `anchor_ingest_text` returns "Write operations disabled"
239
+
240
+ **Solution:**
241
+
242
+ Edit `user_settings.json`:
243
+ ```json
244
+ {
245
+ "mcp": {
246
+ "allow_write_operations": true,
247
+ "default_bucket_for_writes": "external-inbox"
248
+ }
249
+ }
250
+ ```
251
+
252
+ ---
253
+
254
+ ## Database Issues
255
+
256
+ ### Database Corruption
257
+
258
+ **Symptoms:** "Database not initialized" or SQL errors
259
+
260
+ **Solution:**
261
+
262
+ 1. **Stop Engine:**
263
+ ```bash
264
+ pnpm stop
265
+ ```
266
+
267
+ 2. **Backup Data:**
268
+ ```bash
269
+ cp -r engine/context_data engine/context_data.backup
270
+ ```
271
+
272
+ 3. **Delete Database:**
273
+ ```bash
274
+ rm -rf engine/context_data
275
+ ```
276
+
277
+ 4. **Restart (Auto-Rebuild):**
278
+ ```bash
279
+ pnpm start
280
+ ```
281
+
282
+ **Note:** Data is preserved in `mirrored_brain/` - database rebuilds from it.
283
+
284
+ ### Slow Database
285
+
286
+ **Symptoms:** All operations slow
287
+
288
+ **Solutions:**
289
+
290
+ 1. **Enable WAL Mode:**
291
+ ```sql
292
+ PRAGMA journal_mode=WAL;
293
+ ```
294
+
295
+ 2. **Increase Cache:**
296
+ ```sql
297
+ PRAGMA cache_size=-20000; -- 20MB cache
298
+ ```
299
+
300
+ 3. **Vacuum:**
301
+ ```bash
302
+ curl -X POST http://localhost:3160/v1/system/vacuum
303
+ ```
304
+
305
+ ---
306
+
307
+ ## Memory Issues
308
+
309
+ ### Out of Memory (OOM)
310
+
311
+ **Symptoms:** Process killed, "JavaScript heap out of memory"
312
+
313
+ **Solutions:**
314
+
315
+ 1. **Low Memory Mode:**
316
+ ```json
317
+ {
318
+ "adaptive_concurrency": {
319
+ "environment": "low_memory"
320
+ }
321
+ }
322
+ ```
323
+
324
+ 2. **Increase Node Memory:**
325
+ ```bash
326
+ NODE_OPTIONS="--max-old-space-size=4096" pnpm start
327
+ ```
328
+
329
+ 3. **Reduce Concurrent Operations:**
330
+ ```json
331
+ {
332
+ "adaptive_concurrency": {
333
+ "max_concurrency": 2
334
+ }
335
+ }
336
+ ```
337
+
338
+ ### Memory Leak
339
+
340
+ **Symptoms:** Memory usage grows continuously
341
+
342
+ **Solutions:**
343
+
344
+ 1. **Enable GC Logging:**
345
+ ```bash
346
+ node --expose-gc --trace-gc engine/dist/index.js
347
+ ```
348
+
349
+ 2. **Manual GC:**
350
+ ```bash
351
+ curl -X POST http://localhost:3160/v1/system/gc
352
+ ```
353
+
354
+ 3. **Restart Periodically:**
355
+ ```bash
356
+ # Cron job to restart daily
357
+ 0 3 * * * cd /path/to/anchor-engine-node && pnpm restart
358
+ ```
359
+
360
+ ---
361
+
362
+ ## Web UI Issues
363
+
364
+ ### Blank Page
365
+
366
+ **Symptoms:** Web UI shows blank page
367
+
368
+ **Solutions:**
369
+
370
+ 1. **Check Build:**
371
+ ```bash
372
+ cd packages/anchor-ui
373
+ npm run build
374
+ ```
375
+
376
+ 2. **Clear Cache:**
377
+ - Hard refresh: Ctrl+Shift+R (or Cmd+Shift+R on Mac)
378
+ - Clear browser cache
379
+
380
+ 3. **Check Console:**
381
+ - Open DevTools (F12)
382
+ - Check Console tab for errors
383
+
384
+ ### Can't Add Paths
385
+
386
+ **Symptoms:** "Add Path" button doesn't work
387
+
388
+ **Solutions:**
389
+
390
+ 1. **Check Permissions:**
391
+ ```bash
392
+ ls -la /path/you/want/to/add
393
+ ```
394
+
395
+ 2. **Use Absolute Paths:**
396
+ - ✅ `/home/user/documents`
397
+ - ❌ `~/documents`
398
+
399
+ 3. **Check Engine Logs:**
400
+ ```bash
401
+ tail -f engine/logs/server.log
402
+ ```
403
+
404
+ ---
405
+
406
+ ## Docker Issues
407
+
408
+ ### Container Won't Start
409
+
410
+ **Symptoms:** `docker-compose up` fails
411
+
412
+ **Solutions:**
413
+
414
+ 1. **Check Logs:**
415
+ ```bash
416
+ docker-compose logs
417
+ ```
418
+
419
+ 2. **Rebuild:**
420
+ ```bash
421
+ docker-compose down
422
+ docker-compose build --no-cache
423
+ docker-compose up -d
424
+ ```
425
+
426
+ 3. **Check Resources:**
427
+ ```bash
428
+ docker stats
429
+ ```
430
+
431
+ ### Data Lost After Restart
432
+
433
+ **Symptoms:** Data disappears after container restart
434
+
435
+ **Cause:** Volumes not mounted correctly
436
+
437
+ **Solution:**
438
+
439
+ Check `docker-compose.yml`:
440
+ ```yaml
441
+ volumes:
442
+ - ./mirrored_brain:/app/mirrored_brain
443
+ - ./backups:/app/backups
444
+ - anchor-data:/app/engine/context_data
445
+ ```
446
+
447
+ ---
448
+
449
+ ## Performance Issues
450
+
451
+ ### Slow Ingestion
452
+
453
+ **Symptoms:** Ingestion takes >1 minute per file
454
+
455
+ **Solutions:**
456
+
457
+ 1. **Enable Parallel Processing:**
458
+ ```json
459
+ {
460
+ "adaptive_concurrency": {
461
+ "environment": "high_memory",
462
+ "max_concurrency": 5
463
+ }
464
+ }
465
+ ```
466
+
467
+ 2. **Disable Synonyms (Temporarily):**
468
+ ```json
469
+ {
470
+ "tagging": {
471
+ "modulation_level": 0
472
+ }
473
+ }
474
+ ```
475
+
476
+ 3. **Use Streaming Ingest:**
477
+ ```bash
478
+ curl -X POST http://localhost:3160/v1/ingest/streaming \
479
+ -F "file=@large-file.txt"
480
+ ```
481
+
482
+ ### High CPU Usage
483
+
484
+ **Symptoms:** CPU at 100% continuously
485
+
486
+ **Solutions:**
487
+
488
+ 1. **Check Watchdog:**
489
+ ```bash
490
+ curl http://localhost:3160/v1/watchdog/status
491
+ ```
492
+
493
+ 2. **Reduce Concurrency:**
494
+ ```json
495
+ {
496
+ "adaptive_concurrency": {
497
+ "max_concurrency": 2
498
+ }
499
+ }
500
+ ```
501
+
502
+ 3. **Profile:**
503
+ ```bash
504
+ node --prof engine/dist/index.js
505
+ node --prof-process isolate-*.log
506
+ ```
507
+
508
+ ---
509
+
510
+ ## Getting Help
511
+
512
+ ### Logs Location
513
+
514
+ | Log Type | Location |
515
+ |----------|----------|
516
+ | Server | `engine/logs/server.log` |
517
+ | MCP | `mcp-server/logs/` |
518
+ | UI | Browser DevTools Console |
519
+
520
+ ### Debug Mode
521
+
522
+ Enable verbose logging:
523
+ ```json
524
+ {
525
+ "logging": {
526
+ "level": "debug"
527
+ }
528
+ }
529
+ ```
530
+
531
+ ### Support Channels
532
+
533
+ - **GitHub Issues:** https://github.com/RSBalchII/anchor-engine-node/issues
534
+ - **Discussions:** https://github.com/RSBalchII/anchor-engine-node/discussions
535
+ - **Documentation:** [`docs/`](./)