agentic-flow 2.0.1-alpha.2 → 2.0.1-alpha.20

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 (218) hide show
  1. package/CHANGELOG.md +352 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/agentdb/controllers/EmbeddingService.d.ts +37 -0
  4. package/dist/agentdb/controllers/EmbeddingService.d.ts.map +1 -0
  5. package/dist/agentdb/controllers/EmbeddingService.js +1 -0
  6. package/dist/agentdb/controllers/EmbeddingService.js.map +1 -0
  7. package/dist/billing/mcp/tools.d.ts.map +1 -1
  8. package/dist/billing/mcp/tools.js +2 -0
  9. package/dist/billing/mcp/tools.js.map +1 -1
  10. package/dist/cli/commands/hooks.d.ts +18 -0
  11. package/dist/cli/commands/hooks.d.ts.map +1 -0
  12. package/dist/cli/commands/hooks.js +755 -0
  13. package/dist/cli/commands/hooks.js.map +1 -0
  14. package/dist/cli-proxy.d.ts +1 -1
  15. package/dist/cli-proxy.d.ts.map +1 -1
  16. package/dist/cli-proxy.js +28 -1
  17. package/dist/cli-proxy.js.map +1 -1
  18. package/dist/core/agentdb-fast.js +3 -3
  19. package/dist/core/agentdb-fast.js.map +1 -1
  20. package/dist/core/agentdb-wrapper-enhanced.d.ts.map +1 -1
  21. package/dist/core/agentdb-wrapper-enhanced.js +32 -17
  22. package/dist/core/agentdb-wrapper-enhanced.js.map +1 -1
  23. package/dist/core/attention-native.d.ts +1 -0
  24. package/dist/core/attention-native.d.ts.map +1 -1
  25. package/dist/core/attention-native.js +6 -1
  26. package/dist/core/attention-native.js.map +1 -1
  27. package/dist/federation/integrations/supabase-adapter-debug.js +3 -3
  28. package/dist/federation/integrations/supabase-adapter-debug.js.map +1 -1
  29. package/dist/intelligence/EmbeddingCache.d.ts +112 -0
  30. package/dist/intelligence/EmbeddingCache.d.ts.map +1 -0
  31. package/dist/intelligence/EmbeddingCache.js +624 -0
  32. package/dist/intelligence/EmbeddingCache.js.map +1 -0
  33. package/dist/intelligence/EmbeddingService.d.ts +380 -0
  34. package/dist/intelligence/EmbeddingService.d.ts.map +1 -0
  35. package/dist/intelligence/EmbeddingService.js +1484 -0
  36. package/dist/intelligence/EmbeddingService.js.map +1 -0
  37. package/dist/intelligence/IntelligenceStore.d.ts +168 -0
  38. package/dist/intelligence/IntelligenceStore.d.ts.map +1 -0
  39. package/dist/intelligence/IntelligenceStore.js +364 -0
  40. package/dist/intelligence/IntelligenceStore.js.map +1 -0
  41. package/dist/intelligence/RuVectorIntelligence.d.ts +362 -0
  42. package/dist/intelligence/RuVectorIntelligence.d.ts.map +1 -0
  43. package/dist/intelligence/RuVectorIntelligence.js +853 -0
  44. package/dist/intelligence/RuVectorIntelligence.js.map +1 -0
  45. package/dist/intelligence/embedding-benchmark.d.ts +7 -0
  46. package/dist/intelligence/embedding-benchmark.d.ts.map +1 -0
  47. package/dist/intelligence/embedding-benchmark.js +155 -0
  48. package/dist/intelligence/embedding-benchmark.js.map +1 -0
  49. package/dist/intelligence/index.d.ts +14 -0
  50. package/dist/intelligence/index.d.ts.map +1 -0
  51. package/dist/intelligence/index.js +14 -0
  52. package/dist/intelligence/index.js.map +1 -0
  53. package/dist/llm/RuvLLMOrchestrator.d.ts +184 -0
  54. package/dist/llm/RuvLLMOrchestrator.d.ts.map +1 -0
  55. package/dist/llm/RuvLLMOrchestrator.js +442 -0
  56. package/dist/llm/RuvLLMOrchestrator.js.map +1 -0
  57. package/dist/llm/index.d.ts +9 -0
  58. package/dist/llm/index.d.ts.map +1 -0
  59. package/dist/llm/index.js +8 -0
  60. package/dist/llm/index.js.map +1 -0
  61. package/dist/mcp/claudeFlowSdkServer.d.ts.map +1 -1
  62. package/dist/mcp/claudeFlowSdkServer.js +86 -21
  63. package/dist/mcp/claudeFlowSdkServer.js.map +1 -1
  64. package/dist/mcp/fastmcp/servers/hooks-server.d.ts +15 -0
  65. package/dist/mcp/fastmcp/servers/hooks-server.d.ts.map +1 -0
  66. package/dist/mcp/fastmcp/servers/hooks-server.js +63 -0
  67. package/dist/mcp/fastmcp/servers/hooks-server.js.map +1 -0
  68. package/dist/mcp/fastmcp/tools/hooks/benchmark.d.ts +20 -0
  69. package/dist/mcp/fastmcp/tools/hooks/benchmark.d.ts.map +1 -0
  70. package/dist/mcp/fastmcp/tools/hooks/benchmark.js +110 -0
  71. package/dist/mcp/fastmcp/tools/hooks/benchmark.js.map +1 -0
  72. package/dist/mcp/fastmcp/tools/hooks/build-agents.d.ts +7 -0
  73. package/dist/mcp/fastmcp/tools/hooks/build-agents.d.ts.map +1 -0
  74. package/dist/mcp/fastmcp/tools/hooks/build-agents.js +276 -0
  75. package/dist/mcp/fastmcp/tools/hooks/build-agents.js.map +1 -0
  76. package/dist/mcp/fastmcp/tools/hooks/explain.d.ts +6 -0
  77. package/dist/mcp/fastmcp/tools/hooks/explain.d.ts.map +1 -0
  78. package/dist/mcp/fastmcp/tools/hooks/explain.js +164 -0
  79. package/dist/mcp/fastmcp/tools/hooks/explain.js.map +1 -0
  80. package/dist/mcp/fastmcp/tools/hooks/index.d.ts +28 -0
  81. package/dist/mcp/fastmcp/tools/hooks/index.d.ts.map +1 -0
  82. package/dist/mcp/fastmcp/tools/hooks/index.js +59 -0
  83. package/dist/mcp/fastmcp/tools/hooks/index.js.map +1 -0
  84. package/dist/mcp/fastmcp/tools/hooks/intelligence-bridge.d.ts +307 -0
  85. package/dist/mcp/fastmcp/tools/hooks/intelligence-bridge.d.ts.map +1 -0
  86. package/dist/mcp/fastmcp/tools/hooks/intelligence-bridge.js +714 -0
  87. package/dist/mcp/fastmcp/tools/hooks/intelligence-bridge.js.map +1 -0
  88. package/dist/mcp/fastmcp/tools/hooks/intelligence-tools.d.ts +58 -0
  89. package/dist/mcp/fastmcp/tools/hooks/intelligence-tools.d.ts.map +1 -0
  90. package/dist/mcp/fastmcp/tools/hooks/intelligence-tools.js +425 -0
  91. package/dist/mcp/fastmcp/tools/hooks/intelligence-tools.js.map +1 -0
  92. package/dist/mcp/fastmcp/tools/hooks/metrics.d.ts +6 -0
  93. package/dist/mcp/fastmcp/tools/hooks/metrics.d.ts.map +1 -0
  94. package/dist/mcp/fastmcp/tools/hooks/metrics.js +137 -0
  95. package/dist/mcp/fastmcp/tools/hooks/metrics.js.map +1 -0
  96. package/dist/mcp/fastmcp/tools/hooks/post-command.d.ts +7 -0
  97. package/dist/mcp/fastmcp/tools/hooks/post-command.d.ts.map +1 -0
  98. package/dist/mcp/fastmcp/tools/hooks/post-command.js +91 -0
  99. package/dist/mcp/fastmcp/tools/hooks/post-command.js.map +1 -0
  100. package/dist/mcp/fastmcp/tools/hooks/post-edit.d.ts +12 -0
  101. package/dist/mcp/fastmcp/tools/hooks/post-edit.d.ts.map +1 -0
  102. package/dist/mcp/fastmcp/tools/hooks/post-edit.js +146 -0
  103. package/dist/mcp/fastmcp/tools/hooks/post-edit.js.map +1 -0
  104. package/dist/mcp/fastmcp/tools/hooks/pre-command.d.ts +7 -0
  105. package/dist/mcp/fastmcp/tools/hooks/pre-command.d.ts.map +1 -0
  106. package/dist/mcp/fastmcp/tools/hooks/pre-command.js +70 -0
  107. package/dist/mcp/fastmcp/tools/hooks/pre-command.js.map +1 -0
  108. package/dist/mcp/fastmcp/tools/hooks/pre-edit.d.ts +14 -0
  109. package/dist/mcp/fastmcp/tools/hooks/pre-edit.d.ts.map +1 -0
  110. package/dist/mcp/fastmcp/tools/hooks/pre-edit.js +121 -0
  111. package/dist/mcp/fastmcp/tools/hooks/pre-edit.js.map +1 -0
  112. package/dist/mcp/fastmcp/tools/hooks/pretrain.d.ts +7 -0
  113. package/dist/mcp/fastmcp/tools/hooks/pretrain.d.ts.map +1 -0
  114. package/dist/mcp/fastmcp/tools/hooks/pretrain.js +171 -0
  115. package/dist/mcp/fastmcp/tools/hooks/pretrain.js.map +1 -0
  116. package/dist/mcp/fastmcp/tools/hooks/route.d.ts +12 -0
  117. package/dist/mcp/fastmcp/tools/hooks/route.d.ts.map +1 -0
  118. package/dist/mcp/fastmcp/tools/hooks/route.js +267 -0
  119. package/dist/mcp/fastmcp/tools/hooks/route.js.map +1 -0
  120. package/dist/mcp/fastmcp/tools/hooks/shared.d.ts +46 -0
  121. package/dist/mcp/fastmcp/tools/hooks/shared.d.ts.map +1 -0
  122. package/dist/mcp/fastmcp/tools/hooks/shared.js +159 -0
  123. package/dist/mcp/fastmcp/tools/hooks/shared.js.map +1 -0
  124. package/dist/mcp/fastmcp/tools/hooks/transfer.d.ts +7 -0
  125. package/dist/mcp/fastmcp/tools/hooks/transfer.d.ts.map +1 -0
  126. package/dist/mcp/fastmcp/tools/hooks/transfer.js +151 -0
  127. package/dist/mcp/fastmcp/tools/hooks/transfer.js.map +1 -0
  128. package/dist/mcp/tools/agent-booster-tools.d.ts +10 -1
  129. package/dist/mcp/tools/agent-booster-tools.d.ts.map +1 -1
  130. package/dist/mcp/tools/agent-booster-tools.js.map +1 -1
  131. package/dist/mcp/tools/sona-tools.d.ts.map +1 -1
  132. package/dist/mcp/tools/sona-tools.js +15 -3
  133. package/dist/mcp/tools/sona-tools.js.map +1 -1
  134. package/dist/memory/SharedMemoryPool.d.ts +16 -3
  135. package/dist/memory/SharedMemoryPool.d.ts.map +1 -1
  136. package/dist/memory/SharedMemoryPool.js +33 -1
  137. package/dist/memory/SharedMemoryPool.js.map +1 -1
  138. package/dist/middleware/auth.middleware.d.ts +114 -0
  139. package/dist/middleware/auth.middleware.d.ts.map +1 -0
  140. package/dist/middleware/auth.middleware.js +222 -0
  141. package/dist/middleware/auth.middleware.js.map +1 -0
  142. package/dist/optimizations/agent-booster-migration.d.ts.map +1 -1
  143. package/dist/optimizations/agent-booster-migration.js.map +1 -1
  144. package/dist/proxy/anthropic-to-gemini.d.ts.map +1 -1
  145. package/dist/proxy/anthropic-to-gemini.js.map +1 -1
  146. package/dist/proxy/anthropic-to-openrouter.d.ts.map +1 -1
  147. package/dist/proxy/anthropic-to-openrouter.js.map +1 -1
  148. package/dist/proxy/anthropic-to-requesty.d.ts.map +1 -1
  149. package/dist/proxy/anthropic-to-requesty.js.map +1 -1
  150. package/dist/proxy/quic-proxy.d.ts +0 -1
  151. package/dist/proxy/quic-proxy.d.ts.map +1 -1
  152. package/dist/proxy/quic-proxy.js +2 -1
  153. package/dist/proxy/quic-proxy.js.map +1 -1
  154. package/dist/reasoningbank/AdvancedMemory.d.ts.map +1 -1
  155. package/dist/reasoningbank/AdvancedMemory.js +12 -1
  156. package/dist/reasoningbank/AdvancedMemory.js.map +1 -1
  157. package/dist/reasoningbank/HybridBackend.d.ts +9 -0
  158. package/dist/reasoningbank/HybridBackend.d.ts.map +1 -1
  159. package/dist/reasoningbank/HybridBackend.js +48 -4
  160. package/dist/reasoningbank/HybridBackend.js.map +1 -1
  161. package/dist/reasoningbank/backend-selector.d.ts +1 -1
  162. package/dist/reasoningbank/backend-selector.d.ts.map +1 -1
  163. package/dist/reasoningbank/backend-selector.js.map +1 -1
  164. package/dist/reasoningbank/index-new.d.ts +0 -6
  165. package/dist/reasoningbank/index-new.d.ts.map +1 -1
  166. package/dist/reasoningbank/index-new.js +9 -7
  167. package/dist/reasoningbank/index-new.js.map +1 -1
  168. package/dist/reasoningbank/index.d.ts +1 -6
  169. package/dist/reasoningbank/index.d.ts.map +1 -1
  170. package/dist/reasoningbank/index.js +10 -7
  171. package/dist/reasoningbank/index.js.map +1 -1
  172. package/dist/router/providers/onnx-local.d.ts.map +1 -1
  173. package/dist/router/providers/onnx-local.js +3 -1
  174. package/dist/router/providers/onnx-local.js.map +1 -1
  175. package/dist/routing/CircuitBreakerRouter.d.ts +187 -0
  176. package/dist/routing/CircuitBreakerRouter.d.ts.map +1 -0
  177. package/dist/routing/CircuitBreakerRouter.js +460 -0
  178. package/dist/routing/CircuitBreakerRouter.js.map +1 -0
  179. package/dist/routing/SemanticRouter.d.ts +164 -0
  180. package/dist/routing/SemanticRouter.d.ts.map +1 -0
  181. package/dist/routing/SemanticRouter.js +291 -0
  182. package/dist/routing/SemanticRouter.js.map +1 -0
  183. package/dist/routing/index.d.ts +12 -0
  184. package/dist/routing/index.d.ts.map +1 -0
  185. package/dist/routing/index.js +10 -0
  186. package/dist/routing/index.js.map +1 -0
  187. package/dist/services/embedding-service.d.ts.map +1 -1
  188. package/dist/services/embedding-service.js +5 -2
  189. package/dist/services/embedding-service.js.map +1 -1
  190. package/dist/services/sona-agent-training.js +1 -1
  191. package/dist/services/sona-agent-training.js.map +1 -1
  192. package/dist/services/sona-agentdb-integration.d.ts.map +1 -1
  193. package/dist/services/sona-agentdb-integration.js +10 -5
  194. package/dist/services/sona-agentdb-integration.js.map +1 -1
  195. package/dist/services/sona-service.d.ts +6 -6
  196. package/dist/services/sona-service.d.ts.map +1 -1
  197. package/dist/services/sona-service.js +3 -1
  198. package/dist/services/sona-service.js.map +1 -1
  199. package/dist/utils/agentdb-runtime-patch.d.ts +1 -0
  200. package/dist/utils/agentdb-runtime-patch.d.ts.map +1 -1
  201. package/dist/utils/agentdb-runtime-patch.js +97 -2
  202. package/dist/utils/agentdb-runtime-patch.js.map +1 -1
  203. package/dist/utils/audit-logger.d.ts +115 -0
  204. package/dist/utils/audit-logger.d.ts.map +1 -0
  205. package/dist/utils/audit-logger.js +228 -0
  206. package/dist/utils/audit-logger.js.map +1 -0
  207. package/dist/utils/cli.d.ts +1 -1
  208. package/dist/utils/cli.d.ts.map +1 -1
  209. package/dist/utils/cli.js +5 -0
  210. package/dist/utils/cli.js.map +1 -1
  211. package/dist/utils/input-validator.d.ts +116 -0
  212. package/dist/utils/input-validator.d.ts.map +1 -0
  213. package/dist/utils/input-validator.js +299 -0
  214. package/dist/utils/input-validator.js.map +1 -0
  215. package/dist/utils/rate-limiter.js +2 -2
  216. package/dist/utils/rate-limiter.js.map +1 -1
  217. package/package.json +14 -3
  218. package/scripts/postinstall.js +72 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,358 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.0.1-alpha.20] - 2025-12-31
6
+
7
+ ### Fixed
8
+ - **Windows Compatibility**: Full persistence without native module compilation
9
+ - `better-sqlite3` moved to optionalDependencies
10
+ - **sql.js (WASM SQLite)** fallback for Windows persistence
11
+ - Automatic backend selection: native → WASM → memory
12
+ - No Visual Studio Build Tools required
13
+
14
+ ### Added
15
+ - **WASM SQLite Cache**: Cross-platform persistence via sql.js
16
+ - Stores embeddings in `~/.agentic-flow/embedding-cache-wasm.db`
17
+ - Debounced file writes (1s) for performance
18
+ - Same 9000x speedup on Windows
19
+
20
+ ### Changed
21
+ - EmbeddingCache auto-selects backend (priority order):
22
+ 1. Native SQLite (better-sqlite3) - Fastest, ~0.045ms
23
+ 2. WASM SQLite (sql.js) - Cross-platform, ~0.1ms
24
+ 3. In-memory LRU - No persistence, ~0.01ms
25
+ - New `getBackendType()` method: returns 'native' | 'wasm' | 'memory'
26
+
27
+ ### Performance
28
+ | Backend | Time | Persistence | Platform |
29
+ |---------|------|-------------|----------|
30
+ | Native SQLite | ~0.045ms | ✓ | Linux/macOS |
31
+ | WASM SQLite | ~0.1ms | ✓ | Windows/All |
32
+ | Memory | ~0.01ms | ✗ | Fallback |
33
+
34
+ ## [2.0.1-alpha.19] - 2025-12-31
35
+
36
+ ### Added
37
+ - **Cache Pretrain**: Pre-populate embedding cache for faster cold starts
38
+ - `pretrain(sources)` - Pretrain from files, globs, or text arrays
39
+ - `pretrainCodePatterns()` - 45 common programming patterns (~3ms)
40
+ - `pretrainFromRepo(path)` - Crawl and cache entire repositories
41
+
42
+ - **AI-Enhanced Pretrain** (ruvector integration):
43
+ - `pretrainWithAI()` - Uses attention mechanisms for intelligent caching
44
+ - `pretrainIntelligent()` - 5-stage analysis (patterns, AST, git, deps, chunks)
45
+ - `pretrainIncremental()` - Only cache changed files (git diff)
46
+ - `pretrainSemantic()` - Code-aware chunking (functions, classes, interfaces)
47
+ - `prefetchForContext()` - Context-aware prefetch based on current task
48
+
49
+ - **Attention-Guided Caching**:
50
+ - `HyperbolicAttention` - Hierarchical code structure (AST trees)
51
+ - `MoEAttention` - Expert routing (frontend/backend/data/test)
52
+ - `GraphRoPeAttention` - Dependency graph understanding
53
+ - `FastGRNN` - Pattern prediction for smart prefetch
54
+
55
+ - **Smart Pretraining Features**:
56
+ - Semantic chunking by code boundaries (not fixed size)
57
+ - Priority-based caching of frequently accessed patterns
58
+ - Background pretraining (non-blocking)
59
+ - Git history analysis (cache hot files first)
60
+ - Dependency graph caching
61
+
62
+ ### Performance (pretrain)
63
+ | Operation | Time | Notes |
64
+ |-----------|------|-------|
65
+ | Code patterns | ~3ms | 45 patterns, one-time |
66
+ | Custom texts | ~0.3ms | 5 texts batch |
67
+ | Cached query | ~0.01ms | Memory cache hit |
68
+ | Incremental | ~50ms | Git-based, 20 commits |
69
+ | AI pretrain | ~200ms | Full 5-stage analysis |
70
+ | Context prefetch | ~5ms | Task-aware prediction |
71
+
72
+ ## [2.0.1-alpha.18] - 2025-12-31
73
+
74
+ ### Added
75
+ - **Persistent SQLite Embedding Cache**: Cross-session embedding persistence
76
+ - New `EmbeddingCache` class with SQLite (better-sqlite3) backend
77
+ - **9000x faster** cached lookups: ~0.045ms vs ~400ms ONNX inference
78
+ - Batch writes with transactions: 0.016ms per embedding
79
+ - Stored at `~/.agentic-flow/embedding-cache.db`
80
+ - LRU eviction with configurable max entries (default: 10,000)
81
+ - Automatic cleanup of entries older than 30 days
82
+ - WAL mode for concurrent access
83
+
84
+ - **Cache Hierarchy** (checked in order):
85
+ 1. In-memory LRU cache (~0.001ms) - fastest, ephemeral
86
+ 2. Persistent SQLite cache (~0.045ms) - persists across sessions
87
+ 3. ONNX inference (~400ms) - only on complete cache miss
88
+
89
+ - **EmbeddingService Cache Methods**:
90
+ - `clearPersistentCache()` - Clear SQLite cache
91
+ - `clearAllCaches()` - Clear both memory and persistent caches
92
+ - `getPersistentCacheStats()` - Get cache statistics
93
+
94
+ - **Environment Variables**:
95
+ - `AGENTIC_FLOW_PERSISTENT_CACHE=true|false` (default: true)
96
+
97
+ ### Performance (with persistent cache)
98
+ | Operation | Time | Notes |
99
+ |-----------|------|-------|
100
+ | ONNX cold | ~400ms | First inference + cache write |
101
+ | SQLite read | ~0.045ms | Persistent cache lookup |
102
+ | SQLite batch write | 0.016ms/ea | Transactional batch insert |
103
+ | Memory cache | ~0.001ms | In-memory LRU lookup |
104
+ | **Speedup** | **9000x** | SQLite vs ONNX inference |
105
+
106
+ ### Changed
107
+ - EmbeddingService now checks persistent cache before ONNX inference
108
+ - Only semantic (ONNX) embeddings are persisted (simple hash-based are not)
109
+
110
+ ## [2.0.1-alpha.17] - 2025-12-31
111
+
112
+ ### Added
113
+ - **10 Attention Mechanisms** (ruvector@0.1.63):
114
+ - `MultiHeadAttention` - Pattern matching
115
+ - `FlashAttention` - Memory-efficient O(n)
116
+ - `HyperbolicAttention` - Hierarchical data (AST, trees)
117
+ - `LinearAttention` - O(n) real-time hooks
118
+ - `LocalGlobalAttention` - Long document summarization
119
+ - `MoEAttention` - Multi-agent routing
120
+ - `GraphRoPeAttention` - Code structure analysis
121
+ - `EdgeFeaturedAttention` - Import/dependency graphs
122
+ - `DualSpaceAttention` - Euclidean + Hyperbolic
123
+
124
+ - **Extended Worker Pool Operations**:
125
+ - `speculativeEmbed(files)` - Pre-embed for post-edit
126
+ - `analyzeAST(files)` - Multi-file parallel AST
127
+ - `analyzeComplexity(files)` - Cyclomatic metrics
128
+ - `buildDependencyGraph(files)` - Import graph
129
+ - `securityScan(files)` - Parallel SAST
130
+ - `ragRetrieve(query, chunks)` - Parallel RAG
131
+ - `rankContext(query, contexts)` - Relevance ranking
132
+ - `deduplicate(texts)` - Semantic deduplication
133
+ - `gitBlame(files)` - Parallel blame analysis
134
+ - `gitChurn(patterns, since)` - Code churn metrics
135
+
136
+ - **Parallel Attention Compute**:
137
+ - `parallelAttentionCompute()` - 3-4x faster multi-query
138
+ - `batchAttentionCompute()` - Batch Q-K-V sets
139
+ - `computeFlashAttentionAsync()` - Non-blocking flash
140
+ - `getAttentionForUseCase()` - Auto-select attention type
141
+
142
+ - **Training Utilities**:
143
+ - `AdamOptimizer` - Attention parameter training
144
+ - `infoNceLoss()` - Contrastive learning
145
+ - `mineHardNegatives()` - Hard negative mining
146
+ - `benchmarkAttention()` - Performance comparison
147
+
148
+ ### Changed
149
+ - Updated ruvector dependency: 0.1.62 → 0.1.63
150
+ - Intelligence bridge supports all attention mechanisms
151
+
152
+ ## [2.0.1-alpha.16] - 2025-12-31
153
+
154
+ ### Added
155
+ - **Parallel Intelligence** (ruvector@0.1.62): Full parallel worker integration
156
+ - `queueEpisode()` + `flushEpisodeBatch()` - 3-4x faster batch Q-learning
157
+ - `matchPatternsParallel(files)` - Multi-file parallel pretrain
158
+ - `indexMemoriesBackground(memories)` - Non-blocking hook indexing
159
+ - `searchParallel(query, topK)` - Parallel shard similarity search
160
+ - `analyzeFilesParallel(files)` - Multi-file AST routing
161
+ - `analyzeCommitsParallel(commits)` - Faster co-edit detection
162
+
163
+ - **Auto-detection for parallel mode**:
164
+ - MCP server (`MCP_SERVER=1`): Workers enabled automatically
165
+ - CLI hooks (`RUVECTOR_CLI=1`): Fast sequential mode
166
+ - Manual: `RUVECTOR_PARALLEL=1` to force enable
167
+
168
+ ### Changed
169
+ - Updated ruvector dependency: 0.1.61 → 0.1.62
170
+ - Intelligence bridge now lazy-loads parallel engine
171
+
172
+ ## [2.0.1-alpha.15] - 2025-12-31
173
+
174
+ ### Added
175
+ - **Parallel Worker Embeddings**: 7 worker threads for parallel ONNX processing
176
+ - Uses ruvector@0.1.61 with parallel worker pool
177
+ - SIMD128 enabled (6x faster single-threaded, 7x parallel)
178
+ - Auto-detection: defaults to ONNX when SIMD available
179
+
180
+ - **Advanced Embedding Features**:
181
+ - `similarityMatrix(texts)` - NxN pairwise similarity computation
182
+ - `semanticSearch(query, topK)` - Search against pre-built corpus
183
+ - `findDuplicates(texts, threshold)` - Near-duplicate detection
184
+ - `clusterTexts(texts, k)` - K-means semantic clustering
185
+ - `streamEmbed(texts, batchSize)` - Memory-efficient streaming
186
+
187
+ - **Parallel Use Cases** (from ruvector@0.1.61):
188
+ | Use Case | Current | With Workers | Benefit |
189
+ |--------------------|--------------------|-------------------|--------------------------|
190
+ | Q-learning updates | Sequential | Parallel batch | Faster learning |
191
+ | Pattern matching | 1 file at a time | 4+ files parallel | 3-4x faster pretrain |
192
+ | Memory indexing | Blocking | Background | Non-blocking hooks |
193
+ | Similarity search | Sequential scan | Parallel shards | Faster recall |
194
+ | Code analysis | Single AST | Multi-file AST | Faster routing |
195
+ | Git history | Sequential commits | Parallel commits | Faster co-edit detection |
196
+
197
+ ### Changed
198
+ - EmbeddingService now uses ruvector@0.1.61 (not ruvector-onnx-embeddings-wasm directly)
199
+ - Default backend changed from 'simple' to 'auto' (auto-detects ONNX/SIMD)
200
+ - Updated dependency: ruvector ^0.1.61
201
+
202
+ ### Performance (7 workers + SIMD)
203
+ - Cold start: ~1.5s (includes model download, worker init)
204
+ - Warm embedding: ~100-200ms per text (parallelized)
205
+ - Batch embedding: Up to 7x faster with parallel workers
206
+
207
+ ## [2.0.1-alpha.14] - 2025-12-31
208
+
209
+ ### Added
210
+ - **ONNX Embeddings with SIMD**: Real semantic embeddings via ruvector-onnx-embeddings-wasm
211
+ - SIMD128 enabled for 6x faster embedding generation
212
+ - 100% semantic accuracy (correctly identifies related/unrelated texts)
213
+ - all-MiniLM-L6-v2 model (384 dimensions)
214
+ - Configure with `AGENTIC_FLOW_EMBEDDINGS=onnx`
215
+
216
+ - **EmbeddingService**: Unified embedding interface
217
+ - Simple backend: ~0.04ms (hash-based, fast but not semantic)
218
+ - ONNX backend: ~400ms with SIMD (true semantic similarity)
219
+ - LRU cache for repeated embeddings
220
+ - Auto-fallback to simple if ONNX fails
221
+
222
+ - **Embedding Benchmark**: Compare simple vs ONNX embeddings
223
+ - Run with: `node --experimental-wasm-modules dist/intelligence/embedding-benchmark.js`
224
+ - Shows latency, accuracy, and semantic similarity comparisons
225
+
226
+ ### Changed
227
+ - Updated intelligence-bridge.ts to use EmbeddingService
228
+ - Added onnxruntime-node and ruvector-onnx-embeddings-wasm dependencies
229
+
230
+ ### Performance (SIMD enabled)
231
+ - Cold start: ~1.5s (includes model download)
232
+ - Warm embedding: ~400ms per text
233
+ - Batch embedding: ~400ms per text (sequential)
234
+
235
+ ## [2.0.1-alpha.13] - 2025-12-31
236
+
237
+ ### Added
238
+ - **SQLite Persistence**: Learning data now persists across npx calls and CLI invocations
239
+ - New `IntelligenceStore` class with cross-platform SQLite (better-sqlite3)
240
+ - Stores trajectories, routings, patterns, and operations
241
+ - Works on Linux, macOS, and Windows
242
+ - Database stored in `.agentic-flow/intelligence.db`
243
+
244
+ ### Changed
245
+ - **Intelligence Stats**: Now shows persisted data from SQLite
246
+ - Trajectories count persists across CLI invocations
247
+ - Routings count persists across CLI invocations
248
+ - New "Persistence (SQLite)" section in stats output
249
+
250
+ ### Verified
251
+ - Trajectories persist: created in one call, visible in next
252
+ - Routings persist: recorded for each routing decision
253
+ - Cross-platform SQLite with WAL mode for better concurrency
254
+
255
+ ## [2.0.1-alpha.12] - 2025-12-31
256
+
257
+ ### Fixed
258
+ - **HNSW Enabled Status**: Fixed intelligence stats showing "HNSW: Enabled: false"
259
+ - Reordered initialization to call `getIntelligence()` before `getIntelligenceStats()`
260
+ - Now correctly shows "HNSW: Enabled: true" with 150x speedup
261
+
262
+ ### Verified
263
+ - All intelligence stats display correctly
264
+ - HNSW enabled and operational
265
+
266
+ ## [2.0.1-alpha.11] - 2025-12-31
267
+
268
+ ### Fixed
269
+ - **AdamOptimizer Constructor**: Fixed "Failed to convert napi value Undefined into rust type `f64`" error
270
+ - AdamOptimizer now correctly receives all 4 required parameters: learning_rate, beta1, beta2, epsilon
271
+ - **Silent Warnings**: Removed noisy AgentDB controller warnings for v2+ installations
272
+ - **RuVector HNSW**: Verified HNSW indexing works with M=16, efConstruction=200, achieving 1ms search times
273
+
274
+ ### Verified
275
+ - Hooks run without any error messages
276
+ - Intelligence stats display cleanly
277
+ - RuVector backend with HNSW fully operational
278
+
279
+ ## [2.0.1-alpha.10] - 2025-12-31
280
+
281
+ ### Fixed
282
+ - **ruvector VectorDB/VectorDb Case Mismatch**: Fixed critical bug where @ruvector/core exports `VectorDb` but ruvector checks for `VectorDB`
283
+ - Updated postinstall.js with regex-based patching for whitespace-insensitive matching
284
+ - Added patch marker (`// AGENTIC-FLOW-PATCHED: VectorDb alias`) for idempotent patching
285
+ - Hooks now work correctly with `npx agentic-flow hooks init` and `npx agentic-flow hooks metrics`
286
+
287
+ ### Tested
288
+ - Verified postinstall patch applies correctly on fresh install
289
+ - Hooks init creates .claude/settings.json properly
290
+ - Hooks metrics command executes without VectorDB errors
291
+
292
+ ## [2.0.1-alpha.9] - 2025-12-31
293
+
294
+ ### Added
295
+ - **Runtime Patching System**: Added agentdb-runtime-patch.ts for runtime fixes
296
+ - Automatic AgentDB ESM import resolution patching
297
+ - Automatic ruvector VectorDB/VectorDb case mismatch fixing
298
+ - Works with npm install, npm install -g, and npx contexts
299
+
300
+ ### Changed
301
+ - **Hook System Migration**: Updated from ruvector hooks to agentic-flow@alpha hooks
302
+ - New environment variables: AGENTIC_FLOW_INTELLIGENCE, AGENTIC_FLOW_LEARNING_RATE
303
+ - Updated CLAUDE.md documentation with new hook commands
304
+
305
+ ## [2.0.1-alpha.8] - 2025-12-31
306
+
307
+ ### Fixed
308
+ - **TypeScript Compilation**: Fixed all 11 TypeScript errors in the core package
309
+ - Fixed AgentDBConfig property mismatch (`path` → `dbPath`)
310
+ - Fixed RuvectorLayer constructor signature (added dropout parameter)
311
+ - Fixed MoEAttention constructor to use config object
312
+ - Fixed SONAEngine type cast for proper interface compatibility
313
+ - Fixed ReasoningPattern local interface for type safety
314
+ - Fixed DebugStream.logConnection argument handling
315
+ - Added try-catch for optional AttentionService import
316
+ - Fixed AgentDB import to use named export
317
+
318
+ ### Changed
319
+ - **Type Safety Improvements**:
320
+ - Local ReasoningPattern interface now includes all required fields (similarity, approach, taskType)
321
+ - Added proper type casts for cross-module compatibility
322
+ - GNN initialization now uses RuvectorLayer instead of deprecated GraphNeuralNetwork
323
+
324
+ ### Tested
325
+ - ✅ All TypeScript compilation passes with zero errors
326
+ - ✅ Build completes successfully
327
+ - ✅ Retry and logging tests pass
328
+
329
+ ---
330
+
331
+ ## [2.0.1-alpha.4] - 2025-12-03
332
+
333
+ ### Added
334
+ - **SONA v0.1.4 Federated Learning Integration**: Complete integration with AgentDB
335
+ - Updated AgentDB dependency to 2.0.0-alpha.2.16
336
+ - Full support for `EphemeralLearningAgent`, `FederatedLearningCoordinator`, and `FederatedLearningManager`
337
+ - Quality-based filtering and weighted aggregation
338
+ - Large-scale federation (50+ agents with configurable limits)
339
+
340
+ ### Changed
341
+ - **Dependencies Updated**:
342
+ - `agentdb`: 2.0.0-alpha.2.15 → 2.0.0-alpha.2.16 (SONA v0.1.4 federated learning)
343
+
344
+ ### Documentation
345
+ - Comprehensive federated learning guide available in AgentDB package
346
+ - 5 detailed use cases for distributed learning
347
+ - API documentation and performance tuning recommendations
348
+
349
+ ### Tested
350
+ - ✅ Complete federated learning workflow with 50+ agents
351
+ - ✅ Quality filtering and weighted consolidation
352
+ - ✅ Multi-agent coordination and automatic aggregation
353
+ - ✅ All test suites passing
354
+
355
+ ---
356
+
5
357
  ## [1.10.2] - 2025-01-10
6
358
 
7
359
  ### Fixed