agentic-flow 2.0.1-alpha.17 → 2.0.1-alpha.19

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/CHANGELOG.md CHANGED
@@ -2,6 +2,82 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.0.1-alpha.19] - 2025-12-31
6
+
7
+ ### Added
8
+ - **Cache Pretrain**: Pre-populate embedding cache for faster cold starts
9
+ - `pretrain(sources)` - Pretrain from files, globs, or text arrays
10
+ - `pretrainCodePatterns()` - 45 common programming patterns (~3ms)
11
+ - `pretrainFromRepo(path)` - Crawl and cache entire repositories
12
+
13
+ - **AI-Enhanced Pretrain** (ruvector integration):
14
+ - `pretrainWithAI()` - Uses attention mechanisms for intelligent caching
15
+ - `pretrainIntelligent()` - 5-stage analysis (patterns, AST, git, deps, chunks)
16
+ - `pretrainIncremental()` - Only cache changed files (git diff)
17
+ - `pretrainSemantic()` - Code-aware chunking (functions, classes, interfaces)
18
+ - `prefetchForContext()` - Context-aware prefetch based on current task
19
+
20
+ - **Attention-Guided Caching**:
21
+ - `HyperbolicAttention` - Hierarchical code structure (AST trees)
22
+ - `MoEAttention` - Expert routing (frontend/backend/data/test)
23
+ - `GraphRoPeAttention` - Dependency graph understanding
24
+ - `FastGRNN` - Pattern prediction for smart prefetch
25
+
26
+ - **Smart Pretraining Features**:
27
+ - Semantic chunking by code boundaries (not fixed size)
28
+ - Priority-based caching of frequently accessed patterns
29
+ - Background pretraining (non-blocking)
30
+ - Git history analysis (cache hot files first)
31
+ - Dependency graph caching
32
+
33
+ ### Performance (pretrain)
34
+ | Operation | Time | Notes |
35
+ |-----------|------|-------|
36
+ | Code patterns | ~3ms | 45 patterns, one-time |
37
+ | Custom texts | ~0.3ms | 5 texts batch |
38
+ | Cached query | ~0.01ms | Memory cache hit |
39
+ | Incremental | ~50ms | Git-based, 20 commits |
40
+ | AI pretrain | ~200ms | Full 5-stage analysis |
41
+ | Context prefetch | ~5ms | Task-aware prediction |
42
+
43
+ ## [2.0.1-alpha.18] - 2025-12-31
44
+
45
+ ### Added
46
+ - **Persistent SQLite Embedding Cache**: Cross-session embedding persistence
47
+ - New `EmbeddingCache` class with SQLite (better-sqlite3) backend
48
+ - **9000x faster** cached lookups: ~0.045ms vs ~400ms ONNX inference
49
+ - Batch writes with transactions: 0.016ms per embedding
50
+ - Stored at `~/.agentic-flow/embedding-cache.db`
51
+ - LRU eviction with configurable max entries (default: 10,000)
52
+ - Automatic cleanup of entries older than 30 days
53
+ - WAL mode for concurrent access
54
+
55
+ - **Cache Hierarchy** (checked in order):
56
+ 1. In-memory LRU cache (~0.001ms) - fastest, ephemeral
57
+ 2. Persistent SQLite cache (~0.045ms) - persists across sessions
58
+ 3. ONNX inference (~400ms) - only on complete cache miss
59
+
60
+ - **EmbeddingService Cache Methods**:
61
+ - `clearPersistentCache()` - Clear SQLite cache
62
+ - `clearAllCaches()` - Clear both memory and persistent caches
63
+ - `getPersistentCacheStats()` - Get cache statistics
64
+
65
+ - **Environment Variables**:
66
+ - `AGENTIC_FLOW_PERSISTENT_CACHE=true|false` (default: true)
67
+
68
+ ### Performance (with persistent cache)
69
+ | Operation | Time | Notes |
70
+ |-----------|------|-------|
71
+ | ONNX cold | ~400ms | First inference + cache write |
72
+ | SQLite read | ~0.045ms | Persistent cache lookup |
73
+ | SQLite batch write | 0.016ms/ea | Transactional batch insert |
74
+ | Memory cache | ~0.001ms | In-memory LRU lookup |
75
+ | **Speedup** | **9000x** | SQLite vs ONNX inference |
76
+
77
+ ### Changed
78
+ - EmbeddingService now checks persistent cache before ONNX inference
79
+ - Only semantic (ONNX) embeddings are persisted (simple hash-based are not)
80
+
5
81
  ## [2.0.1-alpha.17] - 2025-12-31
6
82
 
7
83
  ### Added