synapse-gateway 2.0.0
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 +385 -0
- package/bin/synapse.js +242 -0
- package/docs/PLAN.md +1723 -0
- package/docs/PRD.md +1799 -0
- package/drizzle.config.ts +12 -0
- package/next.config.ts +8 -0
- package/package.json +82 -0
- package/postcss.config.mjs +7 -0
- package/public/file.svg +1 -0
- package/public/globe.svg +1 -0
- package/public/next.svg +1 -0
- package/public/vercel.svg +1 -0
- package/public/window.svg +1 -0
- package/src/app/api/analytics/cost/route.ts +13 -0
- package/src/app/api/analytics/usage/route.ts +16 -0
- package/src/app/api/auth/login/route.ts +42 -0
- package/src/app/api/cache/route.ts +19 -0
- package/src/app/api/dashboard/route.ts +35 -0
- package/src/app/api/distill/route.ts +10 -0
- package/src/app/api/events/route.ts +54 -0
- package/src/app/api/health/route.ts +10 -0
- package/src/app/api/intelligence/forensics/route.ts +23 -0
- package/src/app/api/intelligence/neural-router/route.ts +23 -0
- package/src/app/api/keys/route.ts +34 -0
- package/src/app/api/mcp/route.ts +49 -0
- package/src/app/api/memory/route.ts +10 -0
- package/src/app/api/models/benchmark/route.ts +13 -0
- package/src/app/api/models/route.ts +39 -0
- package/src/app/api/namespace/route.ts +25 -0
- package/src/app/api/plugins/route.ts +41 -0
- package/src/app/api/providers/accounts/route.ts +91 -0
- package/src/app/api/providers/fetch-models/route.ts +52 -0
- package/src/app/api/providers/health/route.ts +10 -0
- package/src/app/api/providers/route.ts +46 -0
- package/src/app/api/routes/pipeline/route.ts +20 -0
- package/src/app/api/settings/route.ts +33 -0
- package/src/app/api/skills/route.ts +39 -0
- package/src/app/api/v1/chat/completions/route.ts +156 -0
- package/src/app/api/v1/models/route.ts +44 -0
- package/src/app/dashboard/intelligence/loading.tsx +14 -0
- package/src/app/dashboard/intelligence/page.tsx +125 -0
- package/src/app/dashboard/layout.tsx +143 -0
- package/src/app/dashboard/loading.tsx +17 -0
- package/src/app/dashboard/memory/loading.tsx +15 -0
- package/src/app/dashboard/memory/page.tsx +71 -0
- package/src/app/dashboard/models/loading.tsx +13 -0
- package/src/app/dashboard/models/page.tsx +107 -0
- package/src/app/dashboard/page.tsx +183 -0
- package/src/app/dashboard/playground/loading.tsx +17 -0
- package/src/app/dashboard/playground/page.tsx +212 -0
- package/src/app/dashboard/providers/loading.tsx +15 -0
- package/src/app/dashboard/providers/page.tsx +248 -0
- package/src/app/dashboard/routes/loading.tsx +15 -0
- package/src/app/dashboard/routes/page.tsx +72 -0
- package/src/app/dashboard/settings/loading.tsx +20 -0
- package/src/app/dashboard/settings/page.tsx +208 -0
- package/src/app/dashboard/skills/loading.tsx +26 -0
- package/src/app/dashboard/skills/page.tsx +137 -0
- package/src/app/dashboard/vault/loading.tsx +18 -0
- package/src/app/dashboard/vault/page.tsx +139 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +59 -0
- package/src/app/layout.tsx +32 -0
- package/src/app/login/page.tsx +87 -0
- package/src/app/page.tsx +5 -0
- package/src/components/ui/badge.tsx +32 -0
- package/src/components/ui/button.tsx +38 -0
- package/src/components/ui/card.tsx +50 -0
- package/src/components/ui/error-boundary.tsx +47 -0
- package/src/components/ui/index.ts +11 -0
- package/src/components/ui/input.tsx +26 -0
- package/src/components/ui/select.tsx +24 -0
- package/src/components/ui/skeleton.tsx +53 -0
- package/src/components/ui/toast.tsx +51 -0
- package/src/instrumentation.ts +6 -0
- package/src/lib/__tests__/auth.test.ts +42 -0
- package/src/lib/__tests__/format.test.ts +94 -0
- package/src/lib/__tests__/namespace.test.ts +102 -0
- package/src/lib/__tests__/squeezer.test.ts +93 -0
- package/src/lib/__tests__/utils.test.ts +28 -0
- package/src/lib/analytics/index.ts +187 -0
- package/src/lib/auth/guard.tsx +71 -0
- package/src/lib/auth/index.ts +105 -0
- package/src/lib/auth/middleware.ts +64 -0
- package/src/lib/benchmark/index.ts +137 -0
- package/src/lib/bootstrap.ts +122 -0
- package/src/lib/cache/index.ts +1 -0
- package/src/lib/cache/semantic.ts +211 -0
- package/src/lib/config/defaults.ts +61 -0
- package/src/lib/config/index.ts +72 -0
- package/src/lib/config/schema.ts +63 -0
- package/src/lib/db/index.ts +22 -0
- package/src/lib/db/migrate.ts +327 -0
- package/src/lib/db/schema.ts +303 -0
- package/src/lib/distiller/index.ts +331 -0
- package/src/lib/fallback/index.ts +153 -0
- package/src/lib/forensics/index.ts +188 -0
- package/src/lib/format/anthropic.ts +139 -0
- package/src/lib/format/gemini.ts +130 -0
- package/src/lib/format/index.ts +3 -0
- package/src/lib/format/openai.ts +78 -0
- package/src/lib/health/index.ts +158 -0
- package/src/lib/mcp/builtin.ts +83 -0
- package/src/lib/mcp/index.ts +1 -0
- package/src/lib/mcp/registry.ts +49 -0
- package/src/lib/memory/index.ts +3 -0
- package/src/lib/memory/store.ts +215 -0
- package/src/lib/memory/types.ts +56 -0
- package/src/lib/namespace/index.ts +89 -0
- package/src/lib/neural/features.ts +74 -0
- package/src/lib/neural/index.ts +85 -0
- package/src/lib/neural/strategies.ts +124 -0
- package/src/lib/pipeline/index.ts +84 -0
- package/src/lib/pipeline/types.ts +77 -0
- package/src/lib/plugins/builtin.ts +79 -0
- package/src/lib/plugins/index.ts +65 -0
- package/src/lib/prediction/index.ts +113 -0
- package/src/lib/providers/api-key/anthropic.ts +96 -0
- package/src/lib/providers/api-key/deepseek.ts +108 -0
- package/src/lib/providers/api-key/gemini.ts +112 -0
- package/src/lib/providers/api-key/openai.ts +122 -0
- package/src/lib/providers/api-key/openrouter.ts +112 -0
- package/src/lib/providers/base-adapter.ts +122 -0
- package/src/lib/providers/registry.ts +46 -0
- package/src/lib/providers/types.ts +121 -0
- package/src/lib/router/index.ts +82 -0
- package/src/lib/skills/forge.ts +57 -0
- package/src/lib/skills/index.ts +3 -0
- package/src/lib/skills/registry.ts +195 -0
- package/src/lib/skills/types.ts +44 -0
- package/src/lib/squeezer/index.ts +158 -0
- package/src/lib/utils/cn.ts +6 -0
- package/src/lib/utils/logger.ts +16 -0
- package/src/middleware.ts +60 -0
- package/tsconfig.json +34 -0
package/docs/PRD.md
ADDED
|
@@ -0,0 +1,1799 @@
|
|
|
1
|
+
# Product Requirements Document (PRD)
|
|
2
|
+
# Adnify — Next-Gen AI Gateway & Intelligence Platform
|
|
3
|
+
|
|
4
|
+
> **Versi:** 2.0.0
|
|
5
|
+
> **Tanggal:** 8 Juni 2026
|
|
6
|
+
> **Status:** Draft
|
|
7
|
+
> **Codename:** NEXUS
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Executive Summary
|
|
12
|
+
|
|
13
|
+
**Adnify** bukan sekadar AI router. Adnify adalah **AI Gateway & Intelligence Platform** yang merevolusi cara developer berinteraksi dengan AI providers. Dibanding freegate (proxy via Tor) dan 9router (router dengan token saver), Adnify adalah **generasi berikutnya** dengan AI-powered decision making, semantic caching, dan predictive cost management.
|
|
14
|
+
|
|
15
|
+
**Tagline:** *One Gateway. Infinite AI. Zero Waste.*
|
|
16
|
+
|
|
17
|
+
**Visi:** Menjadi operating system untuk AI API consumption — bukan hanya meroute request, tapi secara aktif mengoptimalkan setiap token, setiap dollar, dan setiap detik.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 2. Competitive Intelligence — Why We're Different
|
|
22
|
+
|
|
23
|
+
### 2.1 Limitasi Kompetitor
|
|
24
|
+
|
|
25
|
+
| Masalah | freegate | 9router | Solusi Adnify |
|
|
26
|
+
|---------|----------|---------|---------------|
|
|
27
|
+
| Routing statis | Ya | Ya (priority saja) | **AI-powered dynamic routing** |
|
|
28
|
+
| Tidak belajar dari pattern | Ya | Ya | **Machine learning routing** |
|
|
29
|
+
| Token compression basic | N/A | RTK 20-40% | **Neural Compressor 40-65%** |
|
|
30
|
+
| Tanpa semantic cache | Ya | Ya | **Embedding-based semantic cache** |
|
|
31
|
+
| Fallback manual/linear | Ya | 3-tier linear | **Decision tree fallback** |
|
|
32
|
+
| Tidak predict cost | Ya | Ya | **Predictive cost engine** |
|
|
33
|
+
| Dashboard informatif saja | Ya | Ya | **Actionable intelligence dashboard** |
|
|
34
|
+
| Tanpa auto-scaling | Ya | Ya | **Adaptive rate management** |
|
|
35
|
+
| Provider relationship 1:1 | Ya | Ya | **Provider mesh network** |
|
|
36
|
+
| Tidak ada model aliasing | Ya | Ya | **Universal model namespace** |
|
|
37
|
+
| Tanpa A/B testing model | Ya | Ya | **Model quality benchmarking** |
|
|
38
|
+
| Logging pasif | Ya | Ya | **Smart request forensics** |
|
|
39
|
+
| Tidak punya MCP support | Ya | Ya | **Native MCP gateway** |
|
|
40
|
+
| Tanpa prompt optimization | Ya | Ya | **Prompt pre-processor** |
|
|
41
|
+
| Tidak punya memory/amnesia | Ya | Ya | **Persistent Memory Engine** |
|
|
42
|
+
| Tidak belajar dari experience | Ya | Ya | **Self-Learning & Distiller** |
|
|
43
|
+
| Tanpa skill management | Ya | Ya | **Dynamic Skill Rotation Engine** |
|
|
44
|
+
| Tanpa skill creation | Ya | Ya | **Skill Forge (create & group skills)** |
|
|
45
|
+
|
|
46
|
+
### 2.2 Breakthrough Features (Tidak Ada di Kompetitor Manapun)
|
|
47
|
+
|
|
48
|
+
1. **Neural Router** — AI yang belajar pattern user dan otomatis memilih provider terbaik
|
|
49
|
+
2. **Semantic Cache** — Cache berbasis makna, bukan exact match (hemat 15-30% requests)
|
|
50
|
+
3. **Adaptive Token Squeezer** — Compression yang belajar dan meningkat dari waktu ke waktu
|
|
51
|
+
4. **Predictive Cost Engine** — Prediksi biaya bulanan dan auto-adjust routing
|
|
52
|
+
5. **Model Quality Benchmark** — A/B test antar model, track quality score
|
|
53
|
+
6. **Universal Model Namespace** — Satu model ID bisa resolve ke banyak provider
|
|
54
|
+
7. **Provider Mesh Network** — Providers saling cover, optimal utilization
|
|
55
|
+
8. **Smart Request Forensics** — Analyze kenapa request gagal, suggest fix
|
|
56
|
+
9. **MCP Gateway** — Native Model Context Protocol support
|
|
57
|
+
10. **Prompt Pre-processor** — Optimize prompt sebelum dikirim untuk hasil lebih baik
|
|
58
|
+
11. **Request Pipeline Builder** — Visual pipeline untuk customize processing
|
|
59
|
+
12. **Real-time Collaboration** — Share sessions, combo configs antar team
|
|
60
|
+
13. **Conversation Context Manager** — Smart context window management
|
|
61
|
+
14. **Provider Arbitrage** — Auto-switch ke provider termurah per request
|
|
62
|
+
15. **Zero-Config Auto-Discovery** — Otomatis detect dan configure providers
|
|
63
|
+
16. **Persistent Memory & Self-Learning** — Tidak pernah amnesia, semakin pintar seiring waktu
|
|
64
|
+
17. **Experience Distiller** — Merangkum apa yang sudah dikerjakan menjadi reusable knowledge
|
|
65
|
+
18. **Adaptive Intelligence** — Belajar dari feedback, error, sukses, dan pattern user
|
|
66
|
+
19. **Dynamic Skill Rotation** — Rotasi skill secara dinamis per request, tanpa mencampur skill
|
|
67
|
+
20. **Skill Forge** — Buat, kelompokkan, dan kelola custom skills + import dari OpenClaw
|
|
68
|
+
21. **Skill Groups** — Kategorikan skill menjadi groups, rotasi per group untuk organisasi yang rapi
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 3. Architecture — The Neural Gateway
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
┌──────────────────────────────┐
|
|
76
|
+
│ Client Tools │
|
|
77
|
+
│ Claude|Cursor|Codex|Cline|... │
|
|
78
|
+
└──────────────┬───────────────┘
|
|
79
|
+
│
|
|
80
|
+
http://localhost:3333/v1
|
|
81
|
+
│
|
|
82
|
+
┌──────────────▼───────────────┐
|
|
83
|
+
│ INTELLIGENCE LAYER │
|
|
84
|
+
│ │
|
|
85
|
+
│ ┌─────────────────────────┐ │
|
|
86
|
+
│ │ Neural Router Engine │ │
|
|
87
|
+
│ │ (ML-based routing that │ │
|
|
88
|
+
│ │ learns from patterns) │ │
|
|
89
|
+
│ └──────────┬──────────────┘ │
|
|
90
|
+
│ │ │
|
|
91
|
+
│ ┌──────────▼──────────────┐ │
|
|
92
|
+
│ │ Request Pipeline │ │
|
|
93
|
+
│ │ ┌─────┐ ┌─────┐ ┌────┐ │ │
|
|
94
|
+
│ │ │Prompt│→│Token│→│Fmt │ │ │
|
|
95
|
+
│ │ │PrePro│ │Sque │ │Xlat│ │ │
|
|
96
|
+
│ │ └─────┘ └─────┘ └────┘ │ │
|
|
97
|
+
│ └──────────┬──────────────┘ │
|
|
98
|
+
│ │ │
|
|
99
|
+
│ ┌──────────▼──────────────┐ │
|
|
100
|
+
│ │ Semantic Cache │ │
|
|
101
|
+
│ │ (embedding-based, │ │
|
|
102
|
+
│ │ not exact match) │ │
|
|
103
|
+
│ └──────────┬──────────────┘ │
|
|
104
|
+
│ │ │
|
|
105
|
+
│ ┌──────────▼──────────────┐ │
|
|
106
|
+
│ │ Decision Fallback Tree │ │
|
|
107
|
+
│ │ (context-aware, not │ │
|
|
108
|
+
│ │ linear) │ │
|
|
109
|
+
│ └──────────┬──────────────┘ │
|
|
110
|
+
└─────────────┼─────────────────┘
|
|
111
|
+
│
|
|
112
|
+
┌───────────────────┼───────────────────┐
|
|
113
|
+
│ │ │
|
|
114
|
+
┌───────▼──────┐ ┌────────▼──────┐ ┌────────▼──────┐
|
|
115
|
+
│ PROVIDER │ │ PROVIDER │ │ PROVIDER │
|
|
116
|
+
│ MESH LAYER │ │ MESH LAYER │ │ MESH LAYER │
|
|
117
|
+
│ │ │ │ │ │
|
|
118
|
+
│ ┌───────────┐ │ │ ┌───────────┐ │ │ ┌───────────┐ │
|
|
119
|
+
│ │ Account A │ │ │ │ Account A │ │ │ │ Account A │ │
|
|
120
|
+
│ │ Account B │ │ │ │ Account B │ │ │ │ Account B │ │
|
|
121
|
+
│ │ Account C │ │ │ │ Account C │ │ │ │ Account C │ │
|
|
122
|
+
│ └───────────┘ │ │ └───────────┘ │ │ └───────────┘ │
|
|
123
|
+
│ Claude │ │ OpenAI │ │ Gemini │
|
|
124
|
+
└───────────────┘ └───────────────┘ └───────────────┘
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 3.1 Tech Stack
|
|
128
|
+
|
|
129
|
+
| Layer | Teknologi | Alasan |
|
|
130
|
+
|-------|-----------|--------|
|
|
131
|
+
| Runtime | **Bun** (fallback Node.js 20+) | 3x faster than Node, native TS |
|
|
132
|
+
| Framework | **Next.js 15** (App Router) | SSR + API + Dashboard unified |
|
|
133
|
+
| Language | **TypeScript** (strict) | Type safety |
|
|
134
|
+
| Database | **SQLite** (better-sqlite3 + Turso option) | Local-first, optional cloud sync |
|
|
135
|
+
| ORM | **Drizzle ORM** | Type-safe, lightweight |
|
|
136
|
+
| AI/ML | **ONNX Runtime** (local inference) | Neural router + embeddings |
|
|
137
|
+
| Embeddings | **Local TF-IDF + MiniLM** | Semantic cache tanpa API call |
|
|
138
|
+
| Styling | **Tailwind CSS 4 + Radix UI** | Modern, accessible, performant |
|
|
139
|
+
| Charts | **Tremor** | Beautiful dashboard components |
|
|
140
|
+
| Real-time | **Server-Sent Events + WebSocket** | Hybrid approach |
|
|
141
|
+
| Auth | **JWT + WebAuthn** | Passwordless support |
|
|
142
|
+
| Validation | **Zod** | Runtime type safety |
|
|
143
|
+
| Testing | **Vitest + Playwright** | Fast + comprehensive |
|
|
144
|
+
| Logging | **Pino** | Structured logging |
|
|
145
|
+
| CLI | **Commander.js** | Rich CLI experience |
|
|
146
|
+
| Package | **npm** (global CLI) | `npm i -g adnify` |
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 4. Core Features — Deep Dive
|
|
151
|
+
|
|
152
|
+
### 4.1 NEURAL ROUTER ENGINE (Breakthrough #1)
|
|
153
|
+
|
|
154
|
+
**Konsep:** Router yang belajar dari historical data dan secara otomatis menentukan provider terbaik untuk setiap request.
|
|
155
|
+
|
|
156
|
+
**Cara Kerja:**
|
|
157
|
+
```
|
|
158
|
+
Setiap request menghasilkan feature vector:
|
|
159
|
+
[model, hour_of_day, prompt_length, has_code, has_tools,
|
|
160
|
+
streaming, temperature, user_id]
|
|
161
|
+
|
|
162
|
+
Router memprediksi:
|
|
163
|
+
→ Best provider (accuracy score)
|
|
164
|
+
→ Expected latency
|
|
165
|
+
→ Expected cost
|
|
166
|
+
→ Likelihood of success
|
|
167
|
+
|
|
168
|
+
Training data: Semua request_logs (success + failure)
|
|
169
|
+
Update model: Setiap 1000 requests atau 1 jam
|
|
170
|
+
Inference time: <5ms (ONNX)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Routing Modes:**
|
|
174
|
+
1. **Auto (Neural)** — AI decides, learns from your patterns
|
|
175
|
+
2. **Balanced** — Neural + rule-based hybrid
|
|
176
|
+
3. **Manual** — Traditional priority/latency/cost routing
|
|
177
|
+
4. **Adaptive** — Switches between modes based on confidence
|
|
178
|
+
|
|
179
|
+
**ML Pipeline:**
|
|
180
|
+
```
|
|
181
|
+
┌──────────┐ ┌───────────┐ ┌──────────┐ ┌──────────┐
|
|
182
|
+
│ Feature │ → │ Feature │ → │ Neural │ → │ Provider │
|
|
183
|
+
│ Extract │ │ Vector │ │ Model │ │ Selection│
|
|
184
|
+
└──────────┘ └───────────┘ └──────────┘ └──────────┘
|
|
185
|
+
↑ │
|
|
186
|
+
│ ┌───────────┐ │
|
|
187
|
+
└──────────│ Feedback │←────────────────────────┘
|
|
188
|
+
│ Loop │ (success/failure/latency/cost)
|
|
189
|
+
└───────────┘
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Kapan Neural Router aktif:**
|
|
193
|
+
- Setelah 100+ requests (minimum data untuk training)
|
|
194
|
+
- Confidence score >70% (fallback ke rule-based jika di bawah)
|
|
195
|
+
- User bisa toggle on/off
|
|
196
|
+
|
|
197
|
+
### 4.2 SEMANTIC CACHE (Breakthrough #2)
|
|
198
|
+
|
|
199
|
+
**Konsep:** Cache berbasis makna/semantik, bukan exact string match. Dua prompt yang berbeda kata tapi sama maksudnya akan hit cache yang sama.
|
|
200
|
+
|
|
201
|
+
**Cara Kerja:**
|
|
202
|
+
```
|
|
203
|
+
Prompt: "Explain how async/await works in JavaScript"
|
|
204
|
+
→ Generate embedding (local MiniLM, 384-dim)
|
|
205
|
+
→ Search similar embeddings in cache (cosine similarity >0.95)
|
|
206
|
+
→ Found: "How does async await work in JS?" (similarity: 0.97)
|
|
207
|
+
→ Return cached response (instant, $0 cost)
|
|
208
|
+
|
|
209
|
+
Prompt: "What is React hooks?"
|
|
210
|
+
→ Generate embedding
|
|
211
|
+
→ Search cache → Not found (best match: 0.72, below threshold)
|
|
212
|
+
→ Forward to provider → Cache response with embedding
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Configuration:**
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"semanticCache": {
|
|
219
|
+
"enabled": true,
|
|
220
|
+
"similarityThreshold": 0.95,
|
|
221
|
+
"ttlMinutes": 30,
|
|
222
|
+
"maxEntries": 10000,
|
|
223
|
+
"embeddingModel": "local-minilm",
|
|
224
|
+
"excludeModels": ["creative-*"],
|
|
225
|
+
"excludePatterns": ["*random*", "*generate*"]
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**Teknis:**
|
|
231
|
+
- Embedding: Local MiniLM-L6 (22MB, runs on CPU, <10ms per embedding)
|
|
232
|
+
- Storage: SQLite dengan vector extension (or brute-force untuk <10K entries)
|
|
233
|
+
- Search: Cosine similarity, approximate nearest neighbor
|
|
234
|
+
- Privacy: Embedding tidak dikirim ke external service
|
|
235
|
+
- Bypass: Temperature > 0, creative tasks, user can opt-out per request
|
|
236
|
+
|
|
237
|
+
**Savings Target:** 15-30% of requests served from cache
|
|
238
|
+
|
|
239
|
+
### 4.3 ADAPTIVE TOKEN SQUEEZER (Breakthrough #3)
|
|
240
|
+
|
|
241
|
+
**Konsep:** Token compression yang terus belajar dan meningkat. Tidak sekadar regex-based seperti RTK, tapi memahami konteks.
|
|
242
|
+
|
|
243
|
+
**Evolution dari RTK:**
|
|
244
|
+
|
|
245
|
+
| Aspek | RTK (9router) | Adnify Token Squeezer |
|
|
246
|
+
|-------|---------------|----------------------|
|
|
247
|
+
| Detection | Regex pattern | Regex + AST parsing + ML classifier |
|
|
248
|
+
| Compression | Single-pass filter | Multi-pass adaptive pipeline |
|
|
249
|
+
| Learning | Static rules | Learns optimal compression per model |
|
|
250
|
+
| Context-aware | No | Yes (knows model context window) |
|
|
251
|
+
| Statistics | Before/after | Before/after/quality score |
|
|
252
|
+
| Aggressiveness | Fixed | Adaptive (based on context fill %) |
|
|
253
|
+
| Code handling | Generic | Language-aware (JS, Python, Go, etc.) |
|
|
254
|
+
|
|
255
|
+
**Pipeline:**
|
|
256
|
+
```
|
|
257
|
+
Input Message
|
|
258
|
+
│
|
|
259
|
+
├─ 1. DETECT: Classifier identifies content type per message block
|
|
260
|
+
│ (code, git-diff, log, file-tree, natural language, etc.)
|
|
261
|
+
│
|
|
262
|
+
├─ 2. ANALYZE: Calculate current context usage
|
|
263
|
+
│ tokens_used / context_window = fill_percentage
|
|
264
|
+
│
|
|
265
|
+
├─ 3. DECIDE: Choose compression strategy based on fill %
|
|
266
|
+
│ <50% → Light compression (metadata only)
|
|
267
|
+
│ 50-75% → Medium compression (filters active)
|
|
268
|
+
│ 75-90% → Aggressive compression (multi-pass)
|
|
269
|
+
│ >90% → Emergency truncation (keep most relevant)
|
|
270
|
+
│
|
|
271
|
+
├─ 4. COMPRESS: Apply selected filters
|
|
272
|
+
│ git-diff: Semantic diff (keep meaningful changes only)
|
|
273
|
+
│ file-tree: Collapse irrelevant paths
|
|
274
|
+
│ logs: Extract unique patterns, remove duplicates
|
|
275
|
+
│ code: Language-aware (preserve semantics, remove boilerplate)
|
|
276
|
+
│ generic: Smart truncate with summarization
|
|
277
|
+
│
|
|
278
|
+
├─ 5. VERIFY: Ensure compression didn't lose critical info
|
|
279
|
+
│ checksums match, no code syntax broken
|
|
280
|
+
│
|
|
281
|
+
└─ 6. STATS: Record compression metrics
|
|
282
|
+
original_tokens, compressed_tokens, savings_%,
|
|
283
|
+
filters_used, quality_score
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**Language-Aware Code Compression:**
|
|
287
|
+
```javascript
|
|
288
|
+
// Before (142 tokens):
|
|
289
|
+
function calculateTotalPrice(items: CartItem[], discount: Discount, taxRate: number): number {
|
|
290
|
+
let subtotal = 0;
|
|
291
|
+
for (const item of items) {
|
|
292
|
+
subtotal += item.price * item.quantity;
|
|
293
|
+
}
|
|
294
|
+
const discountAmount = discount.type === 'percentage'
|
|
295
|
+
? subtotal * (discount.value / 100)
|
|
296
|
+
: discount.value;
|
|
297
|
+
const afterDiscount = subtotal - discountAmount;
|
|
298
|
+
const tax = afterDiscount * taxRate;
|
|
299
|
+
return afterDiscount + tax;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// After compression (58 tokens, -59%):
|
|
303
|
+
fn calculateTotalPrice(items, discount, taxRate):
|
|
304
|
+
subtotal = sum(item.price * item.quantity)
|
|
305
|
+
discountAmt = discount.type == '%' ? subtotal * discount.value/100 : discount.value
|
|
306
|
+
return (subtotal - discountAmt) * (1 + taxRate)
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**Quality Scoring:**
|
|
310
|
+
Setiap compression mendapat quality score:
|
|
311
|
+
- **1.0** — Lossless (metadata only removed)
|
|
312
|
+
- **0.9** — Near-lossless (whitespace/comments removed)
|
|
313
|
+
- **0.8** — Acceptable (minor detail loss, semantics preserved)
|
|
314
|
+
- **0.7** — Degraded (some info loss, may affect response quality)
|
|
315
|
+
- **<0.7** — Rejected (use original)
|
|
316
|
+
|
|
317
|
+
### 4.4 PREDICTIVE COST ENGINE (Breakthrough #4)
|
|
318
|
+
|
|
319
|
+
**Konsep:** Prediksi biaya dan secara otomatis optimalkan routing berdasarkan budget.
|
|
320
|
+
|
|
321
|
+
**Features:**
|
|
322
|
+
1. **Real-time cost tracking** — Per request, per provider, per model, per day
|
|
323
|
+
2. **Cost prediction** — "Based on your usage pattern, you'll spend $47 this month"
|
|
324
|
+
3. **Budget alerts** — "You've used 80% of your monthly budget"
|
|
325
|
+
4. **Auto-optimization** — When approaching budget, switch to cheaper providers
|
|
326
|
+
5. **Cost comparison** — Show how much each provider would cost for the same usage
|
|
327
|
+
6. **ROI analysis** — "Claude Opus costs 5x more but produces 2x better code"
|
|
328
|
+
|
|
329
|
+
**Auto-Optimization Rules:**
|
|
330
|
+
```
|
|
331
|
+
Budget: $50/month
|
|
332
|
+
|
|
333
|
+
Week 1: Used $10 → All providers available (normal routing)
|
|
334
|
+
Week 2: Used $25 → Prefer cheap/free providers (cost-optimized)
|
|
335
|
+
Week 3: Used $40 → Free providers only (budget-conserving)
|
|
336
|
+
Week 4: Used $48 → Strict free-only mode (budget-protection)
|
|
337
|
+
|
|
338
|
+
Monthly reset → Back to normal routing
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Dashboard Widget:**
|
|
342
|
+
```
|
|
343
|
+
┌─────────────────────────────────────────────────┐
|
|
344
|
+
│ Monthly Budget: $50.00 │
|
|
345
|
+
│ ████████████████░░░░░░░░ 68% used ($34.20) │
|
|
346
|
+
│ │
|
|
347
|
+
│ Projected: $48.50 (within budget ✅) │
|
|
348
|
+
│ Savings: $127.30 (via Adnify optimization) │
|
|
349
|
+
│ │
|
|
350
|
+
│ Auto-optimization: │
|
|
351
|
+
│ Week 1-2: All tiers → Normal routing │
|
|
352
|
+
│ Week 3-4: Cheap+Free only → Cost-saving mode │
|
|
353
|
+
│ │
|
|
354
|
+
│ [Adjust Budget] [Export Report] [Reset] │
|
|
355
|
+
└─────────────────────────────────────────────────┘
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### 4.5 MODEL QUALITY BENCHMARK (Breakthrough #5)
|
|
359
|
+
|
|
360
|
+
**Konsep:** A/B test antar model untuk task yang sama, track quality score secara otomatis.
|
|
361
|
+
|
|
362
|
+
**Cara Kerja:**
|
|
363
|
+
```
|
|
364
|
+
1. User sends request to "auto/" namespace
|
|
365
|
+
2. Adnify routes to 2+ models simultaneously (shadow mode)
|
|
366
|
+
3. Primary model response → returned to user
|
|
367
|
+
4. Shadow model response → evaluated silently
|
|
368
|
+
5. Quality metrics recorded:
|
|
369
|
+
- Response latency
|
|
370
|
+
- Token efficiency (output tokens / usefulness)
|
|
371
|
+
- Error rate (syntax errors in code, hallucinations)
|
|
372
|
+
- User satisfaction (implicit: was response accepted or retried?)
|
|
373
|
+
6. Dashboard shows quality comparison per model per task-type
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
**Benchmark Dashboard:**
|
|
377
|
+
```
|
|
378
|
+
┌─────────────────────────────────────────────────────────┐
|
|
379
|
+
│ Model Quality Benchmark — Code Generation Tasks │
|
|
380
|
+
│ │
|
|
381
|
+
│ Model │ Latency │ Tokens │ Quality │ Cost │
|
|
382
|
+
│────────────────────┼─────────┼────────┼─────────┼────────│
|
|
383
|
+
│ cc/claude-opus-4-7 │ 4.2s │ 890 │ 92/100 │ $0.045 │
|
|
384
|
+
│ oa/gpt-5.5 │ 3.1s │ 720 │ 89/100 │ $0.038 │
|
|
385
|
+
│ glm/glm-5.1 │ 2.8s │ 650 │ 85/100 │ $0.004 │
|
|
386
|
+
│ ds/deepseek-v4 │ 3.5s │ 780 │ 87/100 │ $0.002 │
|
|
387
|
+
│ kr/claude-sonnet │ 3.8s │ 810 │ 88/100 │ $0.000 │
|
|
388
|
+
│ │
|
|
389
|
+
│ Best Value: ds/deepseek-v4 (87 quality, $0.002) │
|
|
390
|
+
│ Best Quality: cc/claude-opus-4-7 (92 quality) │
|
|
391
|
+
│ Best Speed: glm/glm-5.1 (2.8s) │
|
|
392
|
+
└─────────────────────────────────────────────────────────┘
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### 4.6 UNIVERSAL MODEL NAMESPACE (Breakthrough #6)
|
|
396
|
+
|
|
397
|
+
**Konsep:** Satu model ID yang otomatis resolve ke provider terbaik. User tidak perlu tahu provider mana yang menyediakan.
|
|
398
|
+
|
|
399
|
+
**Namespace Resolution:**
|
|
400
|
+
```
|
|
401
|
+
User requests: "best/code-model"
|
|
402
|
+
→ Resolve based on:
|
|
403
|
+
1. Which providers have this model available?
|
|
404
|
+
2. Which has cheapest price?
|
|
405
|
+
3. Which has lowest latency right now?
|
|
406
|
+
4. Which has most quota remaining?
|
|
407
|
+
→ Select optimal provider
|
|
408
|
+
→ Route request
|
|
409
|
+
|
|
410
|
+
User requests: "free/any"
|
|
411
|
+
→ Find any free model that can handle this task
|
|
412
|
+
→ Prefer highest quality among free options
|
|
413
|
+
|
|
414
|
+
User requests: "fast/flash"
|
|
415
|
+
→ Find lowest-latency model available
|
|
416
|
+
→ Route to fastest provider
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
**Built-in Namespaces:**
|
|
420
|
+
| Namespace | Behavior |
|
|
421
|
+
|-----------|----------|
|
|
422
|
+
| `best/{task}` | Highest quality model available |
|
|
423
|
+
| `fast/{task}` | Lowest latency model |
|
|
424
|
+
| `cheap/{task}` | Cheapest model |
|
|
425
|
+
| `free/{task}` | Best free model |
|
|
426
|
+
| `auto/{task}` | Neural router decides |
|
|
427
|
+
| `balanced/{task}` | Best quality/price ratio |
|
|
428
|
+
| `{provider}/{model}` | Specific provider (explicit) |
|
|
429
|
+
| `{combo_name}` | User-defined combo |
|
|
430
|
+
|
|
431
|
+
**Task Types:**
|
|
432
|
+
| Task | Description | Preferred Models |
|
|
433
|
+
|------|-------------|-----------------|
|
|
434
|
+
| `code` | Code generation/editing | Claude Opus, GPT-5.5, DeepSeek |
|
|
435
|
+
| `chat` | General conversation | Claude Sonnet, GPT-5.4 |
|
|
436
|
+
| `reason` | Complex reasoning | Claude Opus, o3, DeepSeek R1 |
|
|
437
|
+
| `fast` | Quick responses | Haiku, Flash, MiniMax |
|
|
438
|
+
| `review` | Code review | Claude Opus, GPT-5.5 |
|
|
439
|
+
| `translate` | Code translation | Claude, GPT |
|
|
440
|
+
| `debug` | Debug assistance | Claude, DeepSeek |
|
|
441
|
+
| `doc` | Documentation | Claude Sonnet, GPT |
|
|
442
|
+
|
|
443
|
+
### 4.7 PROVIDER MESH NETWORK (Breakthrough #7)
|
|
444
|
+
|
|
445
|
+
**Konsep:** Providers berbagi beban secara cerdas. Jika satu provider down, request otomatis didistribusikan ke providers lain yang punya model serupa.
|
|
446
|
+
|
|
447
|
+
**Mesh Topology:**
|
|
448
|
+
```
|
|
449
|
+
┌──────────────────────────────────────────────────────────┐
|
|
450
|
+
│ MODEL REGISTRY │
|
|
451
|
+
│ │
|
|
452
|
+
│ claude-sonnet-4.5 available on: │
|
|
453
|
+
│ ├─ kr/claude-sonnet-4.5 (free, unlimited) │
|
|
454
|
+
│ ├─ an/claude-sonnet-4.5 (API key, $3/1M) │
|
|
455
|
+
│ ├─ or/claude-sonnet-4.5 (OpenRouter, $3/1M) │
|
|
456
|
+
│ └─ gh/claude-sonnet-4.5 (Copilot, subscription) │
|
|
457
|
+
│ │
|
|
458
|
+
│ Request for claude-sonnet-4.5: │
|
|
459
|
+
│ 1. Check all 4 providers health │
|
|
460
|
+
│ 2. Check quota on each │
|
|
461
|
+
│ 3. Check account availability │
|
|
462
|
+
│ 4. Route to optimal (free > sub > cheap > paid) │
|
|
463
|
+
│ 5. If primary fails → instant mesh failover │
|
|
464
|
+
└──────────────────────────────────────────────────────────┘
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
**Mesh Intelligence:**
|
|
468
|
+
- **Load balancing** — Distribute across all providers that have the same model
|
|
469
|
+
- **Quota maximization** — Use every provider's quota before falling to paid
|
|
470
|
+
- **Geographic optimization** — Route to closest provider endpoint
|
|
471
|
+
- **Health-aware** — Skip unhealthy providers automatically
|
|
472
|
+
- **Cost cascade** — Free → Subscription → Cheap → Pay-per-use
|
|
473
|
+
|
|
474
|
+
### 4.8 SMART REQUEST FORENSICS (Breakthrough #8)
|
|
475
|
+
|
|
476
|
+
**Konsep:** Setiap error dianalisis secara mendalam dan diberi saran perbaikan.
|
|
477
|
+
|
|
478
|
+
**Forensics Analysis:**
|
|
479
|
+
```
|
|
480
|
+
Request FAILED:
|
|
481
|
+
Model: cc/claude-opus-4-7
|
|
482
|
+
Provider: Anthropic (claude-code)
|
|
483
|
+
Error: HTTP 429 "rate_limit_exceeded"
|
|
484
|
+
|
|
485
|
+
Forensics:
|
|
486
|
+
├─ Root cause: Quota exhausted (5h rolling window)
|
|
487
|
+
├─ Quota used: 48,200 / 50,000 tokens (96.4%)
|
|
488
|
+
├─ Reset in: 23 minutes
|
|
489
|
+
├─ Pattern: High usage detected (3.2x normal)
|
|
490
|
+
│
|
|
491
|
+
├─ Suggestions:
|
|
492
|
+
│ 1. Switch to kr/claude-sonnet-4.5 (free, same model family)
|
|
493
|
+
│ 2. Use glm/glm-5.1 until reset (cheap, $0.004 saved)
|
|
494
|
+
│ 3. Enable Semantic Cache (would have saved 12% this session)
|
|
495
|
+
│ 4. Increase Token Squeezer aggressiveness to "aggressive"
|
|
496
|
+
│
|
|
497
|
+
├─ Auto-action taken:
|
|
498
|
+
│ → Fallback to kr/claude-sonnet-4.5 (successful)
|
|
499
|
+
│ → 3 similar requests automatically rerouted
|
|
500
|
+
│
|
|
501
|
+
└─ Impact: Zero downtime, $0.00 cost for fallback requests
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
### 4.9 MCP GATEWAY (Breakthrough #9)
|
|
505
|
+
|
|
506
|
+
**Konsep:** Native Model Context Protocol gateway. Adnify menjadi MCP server yang bisa diakses oleh MCP clients.
|
|
507
|
+
|
|
508
|
+
**MCP Features:**
|
|
509
|
+
- Adnify acts as **MCP Server** — expose tools, resources, prompts
|
|
510
|
+
- Adnify acts as **MCP Client** — connect to external MCP servers
|
|
511
|
+
- **Tool proxy** — AI coding tools can discover and use Adnify's tools via MCP
|
|
512
|
+
- **Resource provider** — Expose provider health, quota, cost as MCP resources
|
|
513
|
+
- **Prompt templates** — Pre-built prompt templates via MCP
|
|
514
|
+
|
|
515
|
+
**MCP Tools exposed:**
|
|
516
|
+
```
|
|
517
|
+
adnify.get_provider_health — Check provider status
|
|
518
|
+
adnify.list_models — List available models
|
|
519
|
+
adnify.get_quota — Check quota status
|
|
520
|
+
adnify.get_cost_report — Get cost report
|
|
521
|
+
adnify.create_combo — Create a combo
|
|
522
|
+
adnify.test_connection — Test provider connection
|
|
523
|
+
adnify.get_recommendations — Get model recommendations
|
|
524
|
+
adnify.get_benchmark — Get quality benchmarks
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
### 4.10 PROMPT PRE-PROCESSOR (Breakthrough #10)
|
|
528
|
+
|
|
529
|
+
**Konsep:** Optimize user prompts sebelum dikirim ke model untuk hasil yang lebih baik dan token lebih hemat.
|
|
530
|
+
|
|
531
|
+
**Optimizations:**
|
|
532
|
+
1. **System prompt injection** — Tambahkan optimal system prompt berdasarkan task
|
|
533
|
+
2. **Context deduplication** — Hapus informasi duplikat dalam conversation
|
|
534
|
+
3. **Instruction clarity** — Restrukturisasi prompt untuk clarity
|
|
535
|
+
4. **Tool output summarization** — Ringkas output tool yang terlalu panjang
|
|
536
|
+
5. **Language normalization** — Standardize language ke English untuk hasil lebih baik
|
|
537
|
+
6. **Code context optimization** — Hanya kirim relevant code context
|
|
538
|
+
|
|
539
|
+
**Example:**
|
|
540
|
+
```
|
|
541
|
+
Original prompt (340 tokens):
|
|
542
|
+
"Can you please look at this code and tell me what's wrong with it?
|
|
543
|
+
I've been trying to fix this bug for hours and I can't figure it out.
|
|
544
|
+
The error message says 'TypeError: Cannot read property 'map' of undefined'
|
|
545
|
+
and it happens when I click the button. Here's the code..."
|
|
546
|
+
|
|
547
|
+
Optimized prompt (180 tokens, -47%):
|
|
548
|
+
"Debug: TypeError on button click — 'map' of undefined
|
|
549
|
+
|
|
550
|
+
Identify root cause in provided component:
|
|
551
|
+
- Check if data prop is null/undefined before .map()
|
|
552
|
+
- Verify data flow from parent to child
|
|
553
|
+
- Suggest fix with null-safe pattern"
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
### 4.11 REQUEST PIPELINE BUILDER (Breakthrough #11)
|
|
557
|
+
|
|
558
|
+
**Konsep:** Visual pipeline builder untuk customize bagaimana request diproses.
|
|
559
|
+
|
|
560
|
+
**Default Pipeline:**
|
|
561
|
+
```
|
|
562
|
+
Input → Auth → Rate Limit → Format Detect → Prompt Pre-Process →
|
|
563
|
+
Token Squeeze → Semantic Cache Check → Neural Router →
|
|
564
|
+
Format Translate → Send to Provider → Response → Format Translate Back →
|
|
565
|
+
Cache Store → Log → Output
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
**Custom Pipeline Example:**
|
|
569
|
+
```
|
|
570
|
+
Input → Auth → [Custom: PII Redactor] → Token Squeeze →
|
|
571
|
+
[Custom: Sentiment Analyzer] → Neural Router → Send →
|
|
572
|
+
[Custom: Response Validator] → [Custom: Profanity Filter] → Output
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
**Pipeline Nodes:**
|
|
576
|
+
- Auth, Rate Limit, CORS (built-in)
|
|
577
|
+
- Token Squeezer (built-in)
|
|
578
|
+
- Prompt Pre-processor (built-in)
|
|
579
|
+
- Format Translation (built-in)
|
|
580
|
+
- Semantic Cache (built-in)
|
|
581
|
+
- Neural Router (built-in)
|
|
582
|
+
- Custom JavaScript nodes (user-defined)
|
|
583
|
+
- Conditional routing (if/else based on request properties)
|
|
584
|
+
- Branching (parallel processing)
|
|
585
|
+
- Transform nodes (modify request/response)
|
|
586
|
+
|
|
587
|
+
### 4.12 CONVERSATION CONTEXT MANAGER (Breakthrough #12)
|
|
588
|
+
|
|
589
|
+
**Konsep:** Manage conversation context secara cerdas agar tidak melewati context window.
|
|
590
|
+
|
|
591
|
+
**Features:**
|
|
592
|
+
1. **Auto-summarization** — Saat context hampir penuh, ringkas pesan lama
|
|
593
|
+
2. **Relevance ranking** — Hanya kirim pesan yang relevan dengan pertanyaan terakhir
|
|
594
|
+
3. **Sliding window** — Keep last N messages + summary of older messages
|
|
595
|
+
4. **Semantic selection** — Pilih pesan yang paling relevan berdasarkan embedding
|
|
596
|
+
5. **Token budget allocation** — Allocate budget per message type:
|
|
597
|
+
```
|
|
598
|
+
System prompt: 10% of context
|
|
599
|
+
Recent messages: 50% of context
|
|
600
|
+
Relevant history: 25% of context
|
|
601
|
+
Tool outputs: 15% of context (compressed)
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
### 4.13 PROVIDER ARBITRAGE (Breakthrough #13)
|
|
605
|
+
|
|
606
|
+
**Konsep:** Secara otomatis mencari provider termurah untuk setiap request.
|
|
607
|
+
|
|
608
|
+
**Arbitrage Engine:**
|
|
609
|
+
```
|
|
610
|
+
Request: claude-sonnet-4.5, 2000 input tokens
|
|
611
|
+
|
|
612
|
+
Available providers for this model:
|
|
613
|
+
kr/claude-sonnet-4.5 → $0.000 (free)
|
|
614
|
+
gh/claude-sonnet-4.5 → $0.000 (subscription, quota remaining)
|
|
615
|
+
an/claude-sonnet-4.5 → $0.006 (API, $3/1M input)
|
|
616
|
+
or/claude-sonnet-4.5 → $0.007 (OpenRouter, $3.5/1M)
|
|
617
|
+
|
|
618
|
+
→ Route to kr/ (free, save $0.007)
|
|
619
|
+
|
|
620
|
+
If kr/ quota exhausted:
|
|
621
|
+
→ Route to gh/ (subscription, save $0.007)
|
|
622
|
+
|
|
623
|
+
If gh/ quota exhausted:
|
|
624
|
+
→ Route to an/ (cheapest paid)
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
### 4.14 ZERO-CONFIG AUTO-DISCOVERY (Breakthrough #14)
|
|
628
|
+
|
|
629
|
+
**Konsep:** Adnify otomatis mendeteksi providers yang sudah terkonfigurasi di system.
|
|
630
|
+
|
|
631
|
+
**Auto-Detection:**
|
|
632
|
+
```
|
|
633
|
+
Scan system for:
|
|
634
|
+
├─ ~/.claude/config.json → Detect Claude Code
|
|
635
|
+
├─ ~/.codex/config.json → Detect Codex
|
|
636
|
+
├─ ~/.cursor/settings.json → Detect Cursor
|
|
637
|
+
├─ ~/.config/kiro/ → Detect Kiro
|
|
638
|
+
├─ ANTHROPIC_API_KEY env var → Detect Anthropic
|
|
639
|
+
├─ OPENAI_API_KEY env var → Detect OpenAI
|
|
640
|
+
├─ GOOGLE_API_KEY env var → Detect Gemini
|
|
641
|
+
├─ localhost:11434 → Detect Ollama
|
|
642
|
+
├─ localhost:1234 → Detect LM Studio
|
|
643
|
+
└─ git config → Detect GitHub
|
|
644
|
+
|
|
645
|
+
→ Auto-configure detected providers
|
|
646
|
+
→ Show in dashboard: "3 providers auto-detected! [Review]"
|
|
647
|
+
→ User just clicks "Confirm" → Ready to use
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
### 4.15 REAL-TIME COLLABORATION (Breakthrough #15)
|
|
651
|
+
|
|
652
|
+
**Konsep:** Share combos, pipeline configs, dan benchmark results antar team members.
|
|
653
|
+
|
|
654
|
+
**Features:**
|
|
655
|
+
- Share combo via link (encrypted)
|
|
656
|
+
- Team workspace (shared provider pool)
|
|
657
|
+
- Benchmark sharing (compare models across team)
|
|
658
|
+
- Pipeline sharing (reuse custom pipelines)
|
|
659
|
+
- Usage aggregation (team-wide analytics)
|
|
660
|
+
|
|
661
|
+
### 4.16 PERSISTENT MEMORY ENGINE (Breakthrough #16)
|
|
662
|
+
|
|
663
|
+
**Konsep:** Adnify tidak pernah lupa. Setiap keputusan, hasil, error, dan pattern disimpan permanen dan digunakan untuk membuat keputusan yang lebih baik di masa depan. Tidak seperti kompetitor yang reset saat restart, Adnify membangun knowledge base yang terus bertumbuh.
|
|
664
|
+
|
|
665
|
+
**Masalah yang dipecahkan:**
|
|
666
|
+
- freegate & 9router: Setiap restart → semua metrics hilang, semua learning hilang
|
|
667
|
+
- Tidak ada memory antar sessions
|
|
668
|
+
- Tidak bisa belajar dari kesalahan yang sama
|
|
669
|
+
- Tidak bisa mengenali pattern user
|
|
670
|
+
|
|
671
|
+
**Memory Architecture:**
|
|
672
|
+
```
|
|
673
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
674
|
+
│ PERSISTENT MEMORY LAYER │
|
|
675
|
+
│ │
|
|
676
|
+
│ ┌──────────────────┐ ┌──────────────────┐ ┌────────────┐ │
|
|
677
|
+
│ │ EPISODIC │ │ SEMANTIC │ │ PROCEDURAL │ │
|
|
678
|
+
│ │ MEMORY │ │ MEMORY │ │ MEMORY │ │
|
|
679
|
+
│ │ │ │ │ │ │ │
|
|
680
|
+
│ │ "Apa yang terjadi"│ │ "Apa yang diketahui"│ │ "Cara melakukan"│
|
|
681
|
+
│ │ │ │ │ │ │ │
|
|
682
|
+
│ │ • Request logs │ │ • Model knowledge│ │ • Routing │ │
|
|
683
|
+
│ │ • Error history │ │ • Provider facts │ │ rules │ │
|
|
684
|
+
│ │ • Success chains │ │ • User patterns │ │ • Fallback │ │
|
|
685
|
+
│ │ • Fallback paths │ │ • Cost patterns │ │ strategies │ │
|
|
686
|
+
│ │ • Token savings │ │ • Quality scores │ │ • Compress │ │
|
|
687
|
+
│ │ │ │ │ │ patterns │ │
|
|
688
|
+
│ │ TTL: 90 days │ │ TTL: Forever │ │ TTL: Forever│ │
|
|
689
|
+
│ │ (raw detail) │ │ (summarized) │ │ (compiled) │ │
|
|
690
|
+
│ └──────────────────┘ └──────────────────┘ └────────────┘ │
|
|
691
|
+
│ │ │ │ │
|
|
692
|
+
│ └──────────────────────┼────────────────────┘ │
|
|
693
|
+
│ │ │
|
|
694
|
+
│ ┌────────────▼─────────────┐ │
|
|
695
|
+
│ │ EXPERIENCE DISTILLER │ │
|
|
696
|
+
│ │ │ │
|
|
697
|
+
│ │ Episodic → Semantic → │ │
|
|
698
|
+
│ │ Procedural (compaction) │ │
|
|
699
|
+
│ │ │ │
|
|
700
|
+
│ │ "Dari 10,000 requests, │ │
|
|
701
|
+
│ │ aku belajar bahwa..." │ │
|
|
702
|
+
│ └────────────┬──────────────┘ │
|
|
703
|
+
│ │ │
|
|
704
|
+
│ ┌────────────▼─────────────┐ │
|
|
705
|
+
│ │ KNOWLEDGE BASE │ │
|
|
706
|
+
│ │ (SQLite, persistent) │ │
|
|
707
|
+
│ └──────────────────────────┘ │
|
|
708
|
+
└──────────────────────────────────────────────────────────────┘
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
**Tiga Jenis Memory:**
|
|
712
|
+
|
|
713
|
+
**1. Episodic Memory (Apa yang terjadi)**
|
|
714
|
+
```
|
|
715
|
+
Menyimpan setiap event/episode:
|
|
716
|
+
|
|
717
|
+
Request Episode:
|
|
718
|
+
timestamp: 2026-06-08T14:23:02Z
|
|
719
|
+
event: "request_completed"
|
|
720
|
+
model: "glm/glm-5.1"
|
|
721
|
+
provider: "GLM/Zhipu"
|
|
722
|
+
task_type: "code_generation"
|
|
723
|
+
input_tokens: 2340
|
|
724
|
+
output_tokens: 890
|
|
725
|
+
tokens_saved: 1240 (squeezer)
|
|
726
|
+
latency_ms: 2100
|
|
727
|
+
cost: $0.002
|
|
728
|
+
quality_score: 0.85
|
|
729
|
+
success: true
|
|
730
|
+
cache_hit: false
|
|
731
|
+
|
|
732
|
+
Error Episode:
|
|
733
|
+
timestamp: 2026-06-08T14:25:01Z
|
|
734
|
+
event: "request_failed"
|
|
735
|
+
model: "cc/claude-opus-4-7"
|
|
736
|
+
provider: "Claude Code"
|
|
737
|
+
error_type: "rate_limit_429"
|
|
738
|
+
root_cause: "quota_exhausted"
|
|
739
|
+
quota_remaining: 180
|
|
740
|
+
quota_reset_in: "23m"
|
|
741
|
+
fallback_to: "kr/claude-sonnet-4.5"
|
|
742
|
+
fallback_success: true
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
**2. Semantic Memory (Apa yang diketahui)**
|
|
746
|
+
```
|
|
747
|
+
Pengetahuan yang sudah dirangkum dan disimpan permanen:
|
|
748
|
+
|
|
749
|
+
Model Knowledge:
|
|
750
|
+
"glm/glm-5.1":
|
|
751
|
+
avg_latency: { p50: 2100, p95: 4500, p99: 8000 }
|
|
752
|
+
avg_quality: 0.85
|
|
753
|
+
best_for: ["code_generation", "translation"]
|
|
754
|
+
worst_for: ["complex_reasoning", "creative_writing"]
|
|
755
|
+
error_rate: 0.03
|
|
756
|
+
cost_efficiency: 9.2/10
|
|
757
|
+
learned_from: 3420 requests
|
|
758
|
+
|
|
759
|
+
Provider Knowledge:
|
|
760
|
+
"kr/ (Kiro)":
|
|
761
|
+
reliability: 0.98
|
|
762
|
+
peak_hours: ["09:00-12:00", "14:00-17:00"]
|
|
763
|
+
best_models: ["claude-sonnet-4.5", "glm-5"]
|
|
764
|
+
avg_daily_quota: "unlimited"
|
|
765
|
+
rate_limit_pattern: "very_rare"
|
|
766
|
+
learned_from: 89 days of data
|
|
767
|
+
|
|
768
|
+
User Pattern Knowledge:
|
|
769
|
+
"default_user":
|
|
770
|
+
preferred_models: ["claude-opus", "glm-5.1"]
|
|
771
|
+
peak_usage_hours: [9, 10, 11, 14, 15]
|
|
772
|
+
avg_daily_requests: 87
|
|
773
|
+
avg_daily_tokens: 245000
|
|
774
|
+
common_task_types: ["code_gen: 45%", "debug: 25%", "review: 20%", "doc: 10%"]
|
|
775
|
+
budget_sensitivity: "medium"
|
|
776
|
+
quality_preference: "high"
|
|
777
|
+
learned_from: 89 days of data
|
|
778
|
+
|
|
779
|
+
Compression Knowledge:
|
|
780
|
+
"git_diff_compression":
|
|
781
|
+
avg_savings: 0.42
|
|
782
|
+
best_strategy: "semantic_hunk_collapse"
|
|
783
|
+
quality_impact: 0.02 (minimal)
|
|
784
|
+
language_specific: { "js": 0.48, "python": 0.45, "go": 0.38 }
|
|
785
|
+
learned_from: 1520 samples
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
**3. Procedural Memory (Cara melakukan sesuatu)**
|
|
789
|
+
```
|
|
790
|
+
Aturan dan strategi yang sudah terbukti berhasil:
|
|
791
|
+
|
|
792
|
+
Routing Rules (auto-generated):
|
|
793
|
+
IF task_type == "code_generation" AND hour IN peak_hours:
|
|
794
|
+
→ prefer glm/glm-5.1 (99.2% success, $0.002)
|
|
795
|
+
→ fallback kr/claude-sonnet (97.8% success, $0.000)
|
|
796
|
+
|
|
797
|
+
IF user_budget_remaining < 20%:
|
|
798
|
+
→ strict free-only mode
|
|
799
|
+
→ prefer kr/ then oc/
|
|
800
|
+
|
|
801
|
+
IF model == "claude-opus" AND provider == "cc/":
|
|
802
|
+
→ check quota first (avg exhaustion at 48K tokens)
|
|
803
|
+
→ if quota < 5K → preemptive fallback to kr/claude-sonnet
|
|
804
|
+
|
|
805
|
+
Fallback Rules (auto-generated):
|
|
806
|
+
IF error == "429" AND provider == "cc/":
|
|
807
|
+
→ 87% chance quota exhausted → immediate mesh failover
|
|
808
|
+
→ don't waste time retrying (learned: retry success rate only 12%)
|
|
809
|
+
|
|
810
|
+
IF error == "timeout" AND model_family == "claude":
|
|
811
|
+
→ try different provider in mesh (not same provider)
|
|
812
|
+
→ learned: same provider timeout = 73% chance of repeated timeout
|
|
813
|
+
|
|
814
|
+
Compression Rules (auto-generated):
|
|
815
|
+
IF context_fill > 80% AND content_type == "git_diff":
|
|
816
|
+
→ apply aggressive multi-pass compression
|
|
817
|
+
→ learned: quality impact only 3% at aggressive level
|
|
818
|
+
|
|
819
|
+
IF model == "glm-5.1" AND task == "code":
|
|
820
|
+
→ compress more aggressively (model handles compressed input well)
|
|
821
|
+
→ learned: quality score only drops 1.2% with 50% compression
|
|
822
|
+
```
|
|
823
|
+
|
|
824
|
+
**Memory Persistence:**
|
|
825
|
+
```
|
|
826
|
+
Storage Location: ~/.adnify/memory/
|
|
827
|
+
├── episodic/ # Recent detailed events (SQLite)
|
|
828
|
+
│ └── episodes.db # Rolling 90-day window
|
|
829
|
+
├── semantic/ # Summarized knowledge (SQLite)
|
|
830
|
+
│ └── knowledge.db # Permanent, grows over time
|
|
831
|
+
├── procedural/ # Compiled rules (SQLite)
|
|
832
|
+
│ └── rules.db # Auto-generated + user-verified
|
|
833
|
+
├── models/ # Trained ML models
|
|
834
|
+
│ ├── neural-router.onnx # Trained routing model
|
|
835
|
+
│ ├── embeddings/ # Cached embeddings
|
|
836
|
+
│ └── compression/ # Learned compression params
|
|
837
|
+
└── distill/ # Distillation checkpoints
|
|
838
|
+
└── last-distill.json # Last distillation metadata
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
**Memory Lifecycle:**
|
|
842
|
+
```
|
|
843
|
+
┌─────────────┐
|
|
844
|
+
│ EVENT │
|
|
845
|
+
│ (real-time) │
|
|
846
|
+
└──────┬──────┘
|
|
847
|
+
│
|
|
848
|
+
┌──────▼──────┐
|
|
849
|
+
│ EPISODIC │ ← Store raw event immediately
|
|
850
|
+
│ MEMORY │
|
|
851
|
+
│ (SQLite) │
|
|
852
|
+
└──────┬──────┘
|
|
853
|
+
│
|
|
854
|
+
┌────────────┤ Every 6 hours or 1000 events
|
|
855
|
+
│ │ (whichever comes first)
|
|
856
|
+
│ ┌──────▼──────┐
|
|
857
|
+
│ │ DISTILLER │ ← Summarize, extract patterns
|
|
858
|
+
│ │ ENGINE │
|
|
859
|
+
│ └──────┬──────┘
|
|
860
|
+
│ │
|
|
861
|
+
│ ┌──────▼──────┐
|
|
862
|
+
│ │ SEMANTIC │ ← Update knowledge base
|
|
863
|
+
│ │ MEMORY │
|
|
864
|
+
│ │ (permanent)│
|
|
865
|
+
│ └──────┬──────┘
|
|
866
|
+
│ │
|
|
867
|
+
│ ┌──────▼──────┐
|
|
868
|
+
│ │ PROCEDURAL │ ← Generate/update rules
|
|
869
|
+
│ │ MEMORY │
|
|
870
|
+
│ │ (compiled) │
|
|
871
|
+
│ └──────┬──────┘
|
|
872
|
+
│ │
|
|
873
|
+
│ ┌──────▼──────┐
|
|
874
|
+
│ │ COMPACT │ ← Archive old episodic data
|
|
875
|
+
│ │ EPISODIC │ (keep 90 days raw, forever summarized)
|
|
876
|
+
│ └─────────────┘
|
|
877
|
+
│
|
|
878
|
+
User restarts?
|
|
879
|
+
│
|
|
880
|
+
┌────────▼────────┐
|
|
881
|
+
│ AUTO-RESTORE │ ← Load all 3 memory types
|
|
882
|
+
│ FROM DISK │ ← Resume exactly where left off
|
|
883
|
+
└─────────────────┘ ← Zero amnesia
|
|
884
|
+
```
|
|
885
|
+
|
|
886
|
+
---
|
|
887
|
+
|
|
888
|
+
### 4.17 EXPERIENCE DISTILLER (Breakthrough #17)
|
|
889
|
+
|
|
890
|
+
**Konsep:** Engine yang secara berkala merangkum semua experience menjadi knowledge yang lebih padat dan actionable. Seperti otak manusia yang mengonsolidasi memori saat tidur.
|
|
891
|
+
|
|
892
|
+
**Distillation Pipeline:**
|
|
893
|
+
```
|
|
894
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
895
|
+
│ EXPERIENCE DISTILLER │
|
|
896
|
+
│ │
|
|
897
|
+
│ Trigger: Every 6 hours OR every 1000 new episodes │
|
|
898
|
+
│ │
|
|
899
|
+
│ Step 1: AGGREGATE │
|
|
900
|
+
│ ┌────────────────────────────────────────────────────────┐ │
|
|
901
|
+
│ │ SELECT all episodic data since last distillation │ │
|
|
902
|
+
│ │ Group by: provider, model, task_type, hour, outcome │ │
|
|
903
|
+
│ │ Calculate: avg, p50, p95, success_rate, error_rate │ │
|
|
904
|
+
│ └────────────────────────────────────────────────────────┘ │
|
|
905
|
+
│ │ │
|
|
906
|
+
│ Step 2: EXTRACT PATTERNS │
|
|
907
|
+
│ ┌────────────────────────────────────────────────────────┐ │
|
|
908
|
+
│ │ Pattern Mining: │ │
|
|
909
|
+
│ │ • "Provider X fails 73% of the time between 14:00-15:00│ │
|
|
910
|
+
│ │ • "Model Y gives best quality for task Z" │ │
|
|
911
|
+
│ │ • "User prefers model A over B for code review" │ │
|
|
912
|
+
│ │ • "Compression saves most on TypeScript files" │ │
|
|
913
|
+
│ │ • "Fallback from X→Y succeeds 94% of the time" │ │
|
|
914
|
+
│ │ │ │
|
|
915
|
+
│ │ Anomaly Detection: │ │
|
|
916
|
+
│ │ • "Provider X latency increased 3x today" │ │
|
|
917
|
+
│ │ • "Error rate for model Y doubled this week" │ │
|
|
918
|
+
│ │ • "User usage pattern shifted to more debugging" │ │
|
|
919
|
+
│ └────────────────────────────────────────────────────────┘ │
|
|
920
|
+
│ │ │
|
|
921
|
+
│ Step 3: UPDATE KNOWLEDGE │
|
|
922
|
+
│ ┌────────────────────────────────────────────────────────┐ │
|
|
923
|
+
│ │ Merge new findings with existing semantic memory: │ │
|
|
924
|
+
│ │ │ │
|
|
925
|
+
│ │ Old: glm-5.1 avg_quality: 0.85 (from 2840 requests) │ │
|
|
926
|
+
│ │ New: glm-5.1 avg_quality: 0.83 (from 580 new requests) │ │
|
|
927
|
+
│ │ → Updated: glm-5.1 avg_quality: 0.847 (3420 requests) │ │
|
|
928
|
+
│ │ │ │
|
|
929
|
+
│ │ Confidence-weighted merge: │ │
|
|
930
|
+
│ │ weight_new = new_samples / (new_samples + old_samples) │ │
|
|
931
|
+
│ │ result = old * (1 - weight_new) + new * weight_new │ │
|
|
932
|
+
│ └────────────────────────────────────────────────────────┘ │
|
|
933
|
+
│ │ │
|
|
934
|
+
│ Step 4: GENERATE RULES │
|
|
935
|
+
│ ┌────────────────────────────────────────────────────────┐ │
|
|
936
|
+
│ │ Auto-generate procedural rules from patterns: │ │
|
|
937
|
+
│ │ │ │
|
|
938
|
+
│ │ IF pattern confidence > 85%: │ │
|
|
939
|
+
│ │ → Generate routing rule │ │
|
|
940
|
+
│ │ → Generate fallback rule │ │
|
|
941
|
+
│ │ → Generate compression rule │ │
|
|
942
|
+
│ │ │ │
|
|
943
|
+
│ │ IF pattern contradicts existing rule: │ │
|
|
944
|
+
│ │ → Flag for review (don't auto-replace) │ │
|
|
945
|
+
│ │ → Show in dashboard: "Rule X may be outdated" │ │
|
|
946
|
+
│ │ │ │
|
|
947
|
+
│ │ IF pattern is entirely new: │ │
|
|
948
|
+
│ │ → Create new rule with "auto-generated" tag │ │
|
|
949
|
+
│ │ → Monitor effectiveness for 7 days │ │
|
|
950
|
+
│ │ → If effective → promote to "verified" │ │
|
|
951
|
+
│ └────────────────────────────────────────────────────────┘ │
|
|
952
|
+
│ │ │
|
|
953
|
+
│ Step 5: RETRAIN MODELS │
|
|
954
|
+
│ ┌────────────────────────────────────────────────────────┐ │
|
|
955
|
+
│ │ Retrain Neural Router with new data: │ │
|
|
956
|
+
│ │ • Add new training samples from episodes │ │
|
|
957
|
+
│ │ • Retrain ONNX model │ │
|
|
958
|
+
│ │ • Validate accuracy > old model │ │
|
|
959
|
+
│ │ • If better → deploy new model │ │
|
|
960
|
+
│ │ • If worse → keep old model, log failure │ │
|
|
961
|
+
│ │ │ │
|
|
962
|
+
│ │ Update compression parameters: │ │
|
|
963
|
+
│ │ • Adjust filter aggressiveness per content type │ │
|
|
964
|
+
│ │ • Update language-specific compression rules │ │
|
|
965
|
+
│ │ • Refine quality thresholds based on feedback │ │
|
|
966
|
+
│ └────────────────────────────────────────────────────────┘ │
|
|
967
|
+
│ │ │
|
|
968
|
+
│ Step 6: COMPACT & ARCHIVE │
|
|
969
|
+
│ ┌────────────────────────────────────────────────────────┐ │
|
|
970
|
+
│ │ • Archive episodic data older than 90 days │ │
|
|
971
|
+
│ │ • Keep only summarized version in semantic memory │ │
|
|
972
|
+
│ │ • Optimize SQLite (VACUUM) │ │
|
|
973
|
+
│ │ • Save distillation checkpoint │ │
|
|
974
|
+
│ └────────────────────────────────────────────────────────┘ │
|
|
975
|
+
└─────────────────────────────────────────────────────────────┘
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
**Distillation Schedule:**
|
|
979
|
+
```
|
|
980
|
+
┌─────────────┬──────────────────────┬─────────────────────┐
|
|
981
|
+
│ Frequency │ What │ Why │
|
|
982
|
+
├─────────────┼──────────────────────┼─────────────────────┤
|
|
983
|
+
│ Real-time │ Store episodes │ No data loss │
|
|
984
|
+
│ Every 1h │ Update health scores │ Quick reaction │
|
|
985
|
+
│ Every 6h │ Full distillation │ Pattern extraction │
|
|
986
|
+
│ Every 24h │ Rule generation │ Procedural learning │
|
|
987
|
+
│ Every 7d │ Model retraining │ Neural improvement │
|
|
988
|
+
│ Every 30d │ Deep analysis │ Long-term patterns │
|
|
989
|
+
│ On restart │ Memory restoration │ Zero amnesia │
|
|
990
|
+
└─────────────┴──────────────────────┴─────────────────────┘
|
|
991
|
+
```
|
|
992
|
+
|
|
993
|
+
**Distillation Intelligence Level:**
|
|
994
|
+
```
|
|
995
|
+
Day 1-7: "Learning basic patterns" — Simple statistical rules
|
|
996
|
+
Day 8-30: "Understanding preferences" — User model + provider profiles
|
|
997
|
+
Day 31-90: "Predicting outcomes" — Neural router accuracy improves
|
|
998
|
+
Day 91+: "Expert optimization" — Proactive optimization, anomaly detection
|
|
999
|
+
Day 365+: "Mastery" — Deep understanding of user workflow, auto-suggests combos
|
|
1000
|
+
```
|
|
1001
|
+
|
|
1002
|
+
---
|
|
1003
|
+
|
|
1004
|
+
### 4.18 ADAPTIVE INTELLIGENCE LAYER (Breakthrough #18)
|
|
1005
|
+
|
|
1006
|
+
**Konsep:** Layer yang menghubungkan semua memory dan membuat keputusan cerdas berdasarkan accumulated knowledge.
|
|
1007
|
+
|
|
1008
|
+
**Intelligence Loop:**
|
|
1009
|
+
```
|
|
1010
|
+
┌──────────────────┐
|
|
1011
|
+
│ NEW REQUEST │
|
|
1012
|
+
└────────┬─────────┘
|
|
1013
|
+
│
|
|
1014
|
+
┌────────▼─────────┐
|
|
1015
|
+
│ CONSULT MEMORY │
|
|
1016
|
+
│ │
|
|
1017
|
+
│ Episodic: │
|
|
1018
|
+
│ "What happened │
|
|
1019
|
+
│ last time I │
|
|
1020
|
+
│ routed this │
|
|
1021
|
+
│ model?" │
|
|
1022
|
+
│ │
|
|
1023
|
+
│ Semantic: │
|
|
1024
|
+
│ "What do I know │
|
|
1025
|
+
│ about this │
|
|
1026
|
+
│ provider?" │
|
|
1027
|
+
│ │
|
|
1028
|
+
│ Procedural: │
|
|
1029
|
+
│ "What rules │
|
|
1030
|
+
│ should I │
|
|
1031
|
+
│ follow?" │
|
|
1032
|
+
└────────┬─────────┘
|
|
1033
|
+
│
|
|
1034
|
+
┌────────▼─────────┐
|
|
1035
|
+
│ MAKE DECISION │
|
|
1036
|
+
│ │
|
|
1037
|
+
│ Confidence? │
|
|
1038
|
+
│ ├─ High (>80%) │ → Execute automatically
|
|
1039
|
+
│ ├─ Med (50-80%) │ → Execute + monitor
|
|
1040
|
+
│ └─ Low (<50%) │ → Execute + flag for review
|
|
1041
|
+
└────────┬─────────┘
|
|
1042
|
+
│
|
|
1043
|
+
┌────────▼─────────┐
|
|
1044
|
+
│ EXECUTE & │
|
|
1045
|
+
│ OBSERVE │
|
|
1046
|
+
│ │
|
|
1047
|
+
│ Record outcome │
|
|
1048
|
+
│ in episodic │
|
|
1049
|
+
│ memory │
|
|
1050
|
+
└────────┬─────────┘
|
|
1051
|
+
│
|
|
1052
|
+
┌────────▼─────────┐
|
|
1053
|
+
│ LEARN & ADAPT │
|
|
1054
|
+
│ │
|
|
1055
|
+
│ Was prediction │
|
|
1056
|
+
│ correct? │
|
|
1057
|
+
│ ├─ Yes → Reinforce│
|
|
1058
|
+
│ └─ No → Adjust │
|
|
1059
|
+
│ │
|
|
1060
|
+
│ Feed to next │
|
|
1061
|
+
│ distillation │
|
|
1062
|
+
└──────────────────┘
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1065
|
+
**Adaptive Behaviors (Semakin pintar seiring waktu):**
|
|
1066
|
+
|
|
1067
|
+
**1. Routing Intelligence**
|
|
1068
|
+
```
|
|
1069
|
+
Week 1: "I see you use claude-opus a lot. It's working well."
|
|
1070
|
+
Week 2: "I noticed claude-opus fails more during 14:00-15:00. I'll preemptively use glm-5.1 during that time."
|
|
1071
|
+
Week 4: "Based on 2,340 requests, I've optimized your routing. Your avg latency dropped from 4.2s to 2.8s."
|
|
1072
|
+
Week 8: "I've learned your code-review tasks get 94% quality with claude-opus but only 78% with glm. I'll always route code reviews to claude."
|
|
1073
|
+
```
|
|
1074
|
+
|
|
1075
|
+
**2. Compression Intelligence**
|
|
1076
|
+
```
|
|
1077
|
+
Week 1: "Applying standard compression. Saved 35% tokens."
|
|
1078
|
+
Week 2: "I noticed you work mostly with TypeScript. I've optimized TS-specific compression. Saved 45%."
|
|
1079
|
+
Week 4: "Your git diffs have a pattern — mostly import changes and type annotations. I've learned to preserve these while compressing other parts. Saved 52%."
|
|
1080
|
+
Week 8: "Based on your feedback loop, I've found the optimal compression level for each task type. Average savings: 58%."
|
|
1081
|
+
```
|
|
1082
|
+
|
|
1083
|
+
**3. Cost Intelligence**
|
|
1084
|
+
```
|
|
1085
|
+
Week 1: "You've spent $12 this week."
|
|
1086
|
+
Week 2: "I could have saved you $4 by routing 23 requests to free providers instead of paid. I'll do this automatically now."
|
|
1087
|
+
Week 4: "I've optimized your routing. Projected monthly cost dropped from $180 to $67 while maintaining same quality."
|
|
1088
|
+
Week 8: "Budget alert: At current rate, you'll exceed $50 budget on June 25. I've auto-switched to cost-saving mode."
|
|
1089
|
+
```
|
|
1090
|
+
|
|
1091
|
+
**4. Fallback Intelligence**
|
|
1092
|
+
```
|
|
1093
|
+
Week 1: "Provider A failed. Falling back to Provider B."
|
|
1094
|
+
Week 2: "I've learned that when Provider A fails with 429, retrying is useless (12% success). I'll immediately failover from now on."
|
|
1095
|
+
Week 4: "I've built a fallback decision tree based on 500+ failures. Average recovery time reduced from 3.2s to 0.8s."
|
|
1096
|
+
Week 8: "I can predict provider failures 30 seconds before they happen based on latency degradation patterns. Preemptive switching active."
|
|
1097
|
+
```
|
|
1098
|
+
|
|
1099
|
+
**5. Quality Intelligence**
|
|
1100
|
+
```
|
|
1101
|
+
Week 1: "Model X generated code. I can't assess quality yet."
|
|
1102
|
+
Week 2: "I've noticed Model X's code has syntax errors 8% of the time. Model Y only 2%. I'll prefer Model Y for code tasks."
|
|
1103
|
+
Week 4: "I've built quality scores for all models across 6 task types. Your 'best/code' namespace now resolves to the ACTUAL best model, not just the most expensive one."
|
|
1104
|
+
Week 8: "Shadow testing revealed that glm-5.1 produces equal quality to claude-opus for your specific codebase patterns at 1/15th the cost. Updated routing."
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
**Memory Dashboard Widget:**
|
|
1108
|
+
```
|
|
1109
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
1110
|
+
│ 🧠 Memory & Learning Status │
|
|
1111
|
+
├──────────────────────────────────────────────────────────────┤
|
|
1112
|
+
│ │
|
|
1113
|
+
│ Episodic: 12,340 events stored (90-day rolling window) │
|
|
1114
|
+
│ Semantic: 847 knowledge entries (permanent, growing) │
|
|
1115
|
+
│ Procedural: 156 auto-generated rules (134 verified ✅) │
|
|
1116
|
+
│ │
|
|
1117
|
+
│ Learning Progress: │
|
|
1118
|
+
│ ████████████████████░░░░ 82% ("Expert optimization") │
|
|
1119
|
+
│ │
|
|
1120
|
+
│ Knowledge Highlights: │
|
|
1121
|
+
│ • Best model for YOUR code: glm-5.1 (92% quality, $0.002) │
|
|
1122
|
+
│ • Your peak hours: 09:00-12:00, 14:00-17:00 │
|
|
1123
|
+
│ • Your prefered style: concise, technical │
|
|
1124
|
+
│ • Learned 23 unique fallback paths │
|
|
1125
|
+
│ • Compression optimized for TypeScript (your main language) │
|
|
1126
|
+
│ │
|
|
1127
|
+
│ Recent Insights: │
|
|
1128
|
+
│ 💡 "I've learned that DeepSeek V4 gives you the best │
|
|
1129
|
+
│ results for debugging tasks. Updated auto-routing." │
|
|
1130
|
+
│ ⚡ "Detected new pattern: you do more code reviews on │
|
|
1131
|
+
│ Fridays. I'll pre-load relevant models." │
|
|
1132
|
+
│ 📊 "After 4,500 requests, I've reduced your avg latency │
|
|
1133
|
+
│ from 3.8s to 2.1s (45% improvement)" │
|
|
1134
|
+
│ 💰 "Optimized routing saved you $127 this month vs direct │
|
|
1135
|
+
│ API usage. That's 68% savings." │
|
|
1136
|
+
│ │
|
|
1137
|
+
│ Memory Usage: 23.4 MB / 100 MB │
|
|
1138
|
+
│ Next distillation: in 2h 14m │
|
|
1139
|
+
│ Last model retrain: 5 days ago (accuracy: 94.2%) │
|
|
1140
|
+
│ │
|
|
1141
|
+
│ [View Knowledge Base] [View Rules] [Export Memory] │
|
|
1142
|
+
└──────────────────────────────────────────────────────────────┘
|
|
1143
|
+
```
|
|
1144
|
+
|
|
1145
|
+
---
|
|
1146
|
+
|
|
1147
|
+
### 4.19 DYNAMIC SKILL ROTATION ENGINE (Breakthrough #19)
|
|
1148
|
+
|
|
1149
|
+
**Konsep:** Adnify bisa me-rotasi "skill" (system prompts + behavior configs) secara dinamis per request. Setiap request mendapat satu skill yang aktif — tidak pernah dicampur. Skill dirotasi berdasarkan task type, schedule, atau user preference.
|
|
1150
|
+
|
|
1151
|
+
**Mengapa Ini Berbeda dari Kompetitor:**
|
|
1152
|
+
- freegate/9router: Tidak punya konsep skill sama sekali
|
|
1153
|
+
- OpenClaw: Punya skill tapi statis, harus manual switch
|
|
1154
|
+
- Adnify: Skill dirotasi OTOMATIS berdasarkan konteks request
|
|
1155
|
+
|
|
1156
|
+
**Skill Definition:**
|
|
1157
|
+
```typescript
|
|
1158
|
+
interface Skill {
|
|
1159
|
+
id: string
|
|
1160
|
+
name: string
|
|
1161
|
+
description: string
|
|
1162
|
+
version: string
|
|
1163
|
+
author: string // 'system' | 'user' | 'openclaw' | 'community'
|
|
1164
|
+
|
|
1165
|
+
// Core skill content
|
|
1166
|
+
systemPrompt: string // System prompt yang di-inject
|
|
1167
|
+
behavior: {
|
|
1168
|
+
temperature?: number // Override temperature
|
|
1169
|
+
maxTokens?: number // Override max tokens
|
|
1170
|
+
modelPreferences?: string[] // Preferred models for this skill
|
|
1171
|
+
compressionLevel?: 'none' | 'light' | 'balanced' | 'aggressive'
|
|
1172
|
+
responseFormat?: 'concise' | 'detailed' | 'code-only' | 'explanatory'
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
// Rotation config
|
|
1176
|
+
rotation: {
|
|
1177
|
+
enabled: boolean
|
|
1178
|
+
trigger: 'task_match' | 'schedule' | 'round_robin' | 'quality_based' | 'manual'
|
|
1179
|
+
taskTypes?: string[] // ['code', 'debug', 'review', 'doc', 'chat']
|
|
1180
|
+
schedule?: string // cron expression for schedule rotation
|
|
1181
|
+
priority?: number // Higher = preferred when multiple match
|
|
1182
|
+
cooldownMs?: number // Minimum time before this skill activates again
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
// Metadata
|
|
1186
|
+
group: string // Skill group name
|
|
1187
|
+
tags: string[]
|
|
1188
|
+
qualityScore?: number // Learned quality score
|
|
1189
|
+
usageCount: number
|
|
1190
|
+
lastUsedAt?: Date
|
|
1191
|
+
createdAt: Date
|
|
1192
|
+
updatedAt: Date
|
|
1193
|
+
}
|
|
1194
|
+
```
|
|
1195
|
+
|
|
1196
|
+
**Rotation Strategies:**
|
|
1197
|
+
|
|
1198
|
+
**1. Task-Match Rotation (Default)**
|
|
1199
|
+
```
|
|
1200
|
+
Request arrives with task_type: "code_generation"
|
|
1201
|
+
→ Search skills where rotation.taskTypes includes "code_generation"
|
|
1202
|
+
→ Found 3 matching skills:
|
|
1203
|
+
skill/typescript-expert (priority: 90, quality: 94)
|
|
1204
|
+
skill/fullstack-dev (priority: 70, quality: 88)
|
|
1205
|
+
skill/code-general (priority: 50, quality: 85)
|
|
1206
|
+
→ Select "skill/typescript-expert" (highest priority)
|
|
1207
|
+
→ Inject its systemPrompt into request
|
|
1208
|
+
→ NEVER mix — only ONE skill active per request
|
|
1209
|
+
```
|
|
1210
|
+
|
|
1211
|
+
**2. Round-Robin Rotation**
|
|
1212
|
+
```
|
|
1213
|
+
Group: "code-review-skills"
|
|
1214
|
+
Skills: [skill/code-reviewer-v1, skill/code-reviewer-v2, skill/code-reviewer-v3]
|
|
1215
|
+
|
|
1216
|
+
Request 1 (code-review) → skill/code-reviewer-v1
|
|
1217
|
+
Request 2 (code-review) → skill/code-reviewer-v2
|
|
1218
|
+
Request 3 (code-review) → skill/code-reviewer-v3
|
|
1219
|
+
Request 4 (code-review) → skill/code-reviewer-v1 (rotate back)
|
|
1220
|
+
```
|
|
1221
|
+
|
|
1222
|
+
**3. Quality-Based Rotation**
|
|
1223
|
+
```
|
|
1224
|
+
Track quality score per skill per task type:
|
|
1225
|
+
skill/typescript-expert → code_gen quality: 94/100
|
|
1226
|
+
skill/fullstack-dev → code_gen quality: 88/100
|
|
1227
|
+
|
|
1228
|
+
When task = code_gen → always use typescript-expert
|
|
1229
|
+
BUT if typescript-expert has been used 10x in a row →
|
|
1230
|
+
rotate to fullstack-dev for 1 request (prevent staleness)
|
|
1231
|
+
compare quality → update scores
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
**4. Schedule-Based Rotation**
|
|
1235
|
+
```
|
|
1236
|
+
Morning (06:00-12:00): skill/fresh-coder (energetic, detailed)
|
|
1237
|
+
Afternoon (12:00-18:00): skill/focused-dev (concise, productive)
|
|
1238
|
+
Evening (18:00-22:00): skill/night-owl (creative, exploratory)
|
|
1239
|
+
Night (22:00-06:00): skill/quiet-mode (minimal, fast)
|
|
1240
|
+
```
|
|
1241
|
+
|
|
1242
|
+
**5. Weighted Random Rotation**
|
|
1243
|
+
```
|
|
1244
|
+
Group: "debugging-skills"
|
|
1245
|
+
skill/debug-detective weight: 50% (proven best)
|
|
1246
|
+
skill/log-analyzer weight: 30% (good for logs)
|
|
1247
|
+
skill/error-whisperer weight: 20% (experimental)
|
|
1248
|
+
|
|
1249
|
+
Random selection with weights → ensures variety while favoring best
|
|
1250
|
+
```
|
|
1251
|
+
|
|
1252
|
+
**Rotation Rules (NO MIXING):**
|
|
1253
|
+
```
|
|
1254
|
+
┌──────────────────────────────────────────────────────────┐
|
|
1255
|
+
│ SKILL ROTATION RULES │
|
|
1256
|
+
│ │
|
|
1257
|
+
│ 1. ONE SKILL PER REQUEST — never combine/mix skills │
|
|
1258
|
+
│ 2. Skill is injected as systemPrompt — replaces default │
|
|
1259
|
+
│ 3. Skill rotation happens BEFORE request reaches provider│
|
|
1260
|
+
│ 4. If no skill matches → use default (no skill) │
|
|
1261
|
+
│ 5. Skills within same group rotate, never mix │
|
|
1262
|
+
│ 6. Cross-group: only one group active per request │
|
|
1263
|
+
│ 7. Skill cooldown prevents rapid re-activation │
|
|
1264
|
+
│ 8. Quality scores auto-update from distiller │
|
|
1265
|
+
└──────────────────────────────────────────────────────────┘
|
|
1266
|
+
```
|
|
1267
|
+
|
|
1268
|
+
**Built-in Skills:**
|
|
1269
|
+
|
|
1270
|
+
| Skill | Group | Trigger | Description |
|
|
1271
|
+
|-------|-------|---------|-------------|
|
|
1272
|
+
| `code-architect` | coding | task=code | Designs clean, scalable code architecture |
|
|
1273
|
+
| `debug-detective` | debugging | task=debug | Systematic debugging with root cause analysis |
|
|
1274
|
+
| `code-reviewer` | review | task=review | Thorough code review with suggestions |
|
|
1275
|
+
| `doc-writer` | docs | task=doc | Writes clear, comprehensive documentation |
|
|
1276
|
+
| `api-designer` | coding | task=api | RESTful API design expert |
|
|
1277
|
+
| `test-engineer` | testing | task=test | Comprehensive test case generation |
|
|
1278
|
+
| `perf-optimizer` | optimization | task=perf | Performance bottleneck identification |
|
|
1279
|
+
| `security-scanner` | security | task=security | Security vulnerability detection |
|
|
1280
|
+
| `refactor-pro` | refactoring | task=refactor | Clean code refactoring patterns |
|
|
1281
|
+
| `sql-architect` | database | task=sql | Database schema and query optimization |
|
|
1282
|
+
|
|
1283
|
+
---
|
|
1284
|
+
|
|
1285
|
+
### 4.20 SKILL FORGE — Create & Manage Skills (Breakthrough #20)
|
|
1286
|
+
|
|
1287
|
+
**Konsep:** User bisa membuat custom skills, mengelompokkannya, mengimport dari OpenClaw, dan mengelola semuanya dari dashboard.
|
|
1288
|
+
|
|
1289
|
+
**Skill Creation:**
|
|
1290
|
+
```
|
|
1291
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
1292
|
+
│ ⚒️ Skill Forge — Create New Skill │
|
|
1293
|
+
├──────────────────────────────────────────────────────────────┤
|
|
1294
|
+
│ │
|
|
1295
|
+
│ Basic Info: │
|
|
1296
|
+
│ Name: [my-react-expert ] │
|
|
1297
|
+
│ Description: [React/Next.js specialist with TypeScript ] │
|
|
1298
|
+
│ Version: [1.0.0] Author: [user] │
|
|
1299
|
+
│ Tags: [react, nextjs, typescript, frontend] │
|
|
1300
|
+
│ │
|
|
1301
|
+
│ System Prompt: │
|
|
1302
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
1303
|
+
│ │ You are an expert React and Next.js developer. │ │
|
|
1304
|
+
│ │ Always use TypeScript with strict typing. │ │
|
|
1305
|
+
│ │ Prefer functional components with hooks. │ │
|
|
1306
|
+
│ │ Use Server Components when possible. │ │
|
|
1307
|
+
│ │ Follow the App Router pattern. │ │
|
|
1308
|
+
│ │ Error boundaries are required for all data fetching. │ │
|
|
1309
|
+
│ │ ... │ │
|
|
1310
|
+
│ └──────────────────────────────────────────────────────┘ │
|
|
1311
|
+
│ │
|
|
1312
|
+
│ Behavior Overrides: │
|
|
1313
|
+
│ Temperature: [0.3] (lower = more deterministic) │
|
|
1314
|
+
│ Max Tokens: [4096] │
|
|
1315
|
+
│ Compression: [balanced ▾] │
|
|
1316
|
+
│ Response Format: [code-only ▾] │
|
|
1317
|
+
│ Preferred Models: [claude-sonnet, glm-5.1, deepseek] │
|
|
1318
|
+
│ │
|
|
1319
|
+
│ Rotation Config: │
|
|
1320
|
+
│ Enable Rotation: [✓] │
|
|
1321
|
+
│ Trigger: [task_match ▾] │
|
|
1322
|
+
│ Task Types: [code, review] ← when to activate │
|
|
1323
|
+
│ Group: [frontend-skills] ← group for rotation │
|
|
1324
|
+
│ Priority: [80] ← higher = preferred │
|
|
1325
|
+
│ Cooldown: [30s] ← min time between activations │
|
|
1326
|
+
│ │
|
|
1327
|
+
│ [Test Skill] [Save as Draft] [Publish] │
|
|
1328
|
+
└──────────────────────────────────────────────────────────────┘
|
|
1329
|
+
```
|
|
1330
|
+
|
|
1331
|
+
**OpenClaw Skill Import:**
|
|
1332
|
+
```
|
|
1333
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
1334
|
+
│ 📥 Import from OpenClaw │
|
|
1335
|
+
├──────────────────────────────────────────────────────────────┤
|
|
1336
|
+
│ │
|
|
1337
|
+
│ Source: [OpenClaw Registry URL or local path] │
|
|
1338
|
+
│ │
|
|
1339
|
+
│ Found 5 skills: │
|
|
1340
|
+
│ ☑ skill/openclaw-code-review (v2.1) — Code review │
|
|
1341
|
+
│ ☑ skill/openclaw-debug (v1.8) — Debug assistant │
|
|
1342
|
+
│ ☐ skill/openclaw-refactor (v3.0) — Refactoring │
|
|
1343
|
+
│ ☐ skill/openclaw-test-gen (v1.5) — Test generator │
|
|
1344
|
+
│ ☑ skill/openclaw-api-design (v2.0) — API designer │
|
|
1345
|
+
│ │
|
|
1346
|
+
│ Import Options: │
|
|
1347
|
+
│ Import to group: [openclaw-imports] │
|
|
1348
|
+
│ Enable rotation: [✓] │
|
|
1349
|
+
│ Map task types automatically: [✓] │
|
|
1350
|
+
│ │
|
|
1351
|
+
│ [Import Selected (3 skills)] │
|
|
1352
|
+
└──────────────────────────────────────────────────────────────┘
|
|
1353
|
+
```
|
|
1354
|
+
|
|
1355
|
+
**Skill Compatibility Layer (OpenClaw → Adnify):**
|
|
1356
|
+
```typescript
|
|
1357
|
+
// OpenClaw skill format → Adnify skill format converter
|
|
1358
|
+
function convertOpenClawSkill(openclawSkill: OpenClawSkill): Skill {
|
|
1359
|
+
return {
|
|
1360
|
+
id: `openclaw/${openclawSkill.id}`,
|
|
1361
|
+
name: openclawSkill.name,
|
|
1362
|
+
description: openclawSkill.description,
|
|
1363
|
+
version: openclawSkill.version,
|
|
1364
|
+
author: 'openclaw',
|
|
1365
|
+
systemPrompt: openclawSkill.systemPrompt || openclawSkill.instructions,
|
|
1366
|
+
behavior: {
|
|
1367
|
+
temperature: openclawSkill.temperature,
|
|
1368
|
+
maxTokens: openclawSkill.maxTokens,
|
|
1369
|
+
compressionLevel: 'balanced',
|
|
1370
|
+
responseFormat: 'detailed',
|
|
1371
|
+
},
|
|
1372
|
+
rotation: {
|
|
1373
|
+
enabled: true,
|
|
1374
|
+
trigger: 'task_match',
|
|
1375
|
+
taskTypes: mapOpenClawCategories(openclawSkill.categories),
|
|
1376
|
+
priority: openclawSkill.priority || 50,
|
|
1377
|
+
cooldownMs: 30000,
|
|
1378
|
+
},
|
|
1379
|
+
group: 'openclaw-imports',
|
|
1380
|
+
tags: openclawSkill.tags || [],
|
|
1381
|
+
usageCount: 0,
|
|
1382
|
+
createdAt: new Date(),
|
|
1383
|
+
updatedAt: new Date(),
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
```
|
|
1387
|
+
|
|
1388
|
+
---
|
|
1389
|
+
|
|
1390
|
+
### 4.21 SKILL GROUPS — Organize & Rotate by Group (Breakthrough #21)
|
|
1391
|
+
|
|
1392
|
+
**Konsep:** Skills dikelompokkan menjadi groups. Setiap group punya rotasi sendiri. Satu request hanya pernah menggunakan SATU skill dari SATU group. Tidak pernah mencampur.
|
|
1393
|
+
|
|
1394
|
+
**Group Architecture:**
|
|
1395
|
+
```
|
|
1396
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
1397
|
+
│ SKILL GROUPS │
|
|
1398
|
+
│ │
|
|
1399
|
+
│ 📁 coding-skills (active) │
|
|
1400
|
+
│ │ ├── skill/typescript-expert (priority: 90) ★ 94/100 │
|
|
1401
|
+
│ │ ├── skill/python-wizard (priority: 80) 91/100 │
|
|
1402
|
+
│ │ ├── skill/go-specialist (priority: 70) 88/100 │
|
|
1403
|
+
│ │ └── skill/rustacean (priority: 60) 86/100 │
|
|
1404
|
+
│ │ Rotation: round_robin | task_match │
|
|
1405
|
+
│ │ Active skill: skill/typescript-expert │
|
|
1406
|
+
│ │ │
|
|
1407
|
+
│ 📁 debugging-skills (active) │
|
|
1408
|
+
│ │ ├── skill/debug-detective (priority: 90) ★ 95/100 │
|
|
1409
|
+
│ │ ├── skill/log-analyzer (priority: 70) 89/100 │
|
|
1410
|
+
│ │ └── skill/error-whisperer (priority: 50) 82/100 │
|
|
1411
|
+
│ │ Rotation: quality_based │
|
|
1412
|
+
│ │ Active skill: skill/debug-detective │
|
|
1413
|
+
│ │ │
|
|
1414
|
+
│ 📁 review-skills (active) │
|
|
1415
|
+
│ │ ├── skill/code-reviewer (priority: 90) 93/100 │
|
|
1416
|
+
│ │ └── skill/arch-reviewer (priority: 80) 87/100 │
|
|
1417
|
+
│ │ Rotation: task_match │
|
|
1418
|
+
│ │ Active skill: skill/code-reviewer │
|
|
1419
|
+
│ │ │
|
|
1420
|
+
│ 📁 openclaw-imports (active) │
|
|
1421
|
+
│ │ ├── skill/openclaw-code-review (priority: 70) 85/100 │
|
|
1422
|
+
│ │ ├── skill/openclaw-debug (priority: 60) 83/100 │
|
|
1423
|
+
│ │ └── skill/openclaw-api-design (priority: 60) 81/100 │
|
|
1424
|
+
│ │ Rotation: round_robin │
|
|
1425
|
+
│ │ │
|
|
1426
|
+
│ 📁 custom-experiments (draft) │
|
|
1427
|
+
│ │ └── skill/my-experiment-v1 (priority: 50) ??/100 │
|
|
1428
|
+
│ │ Rotation: manual │
|
|
1429
|
+
│ │
|
|
1430
|
+
│ ★ = highest quality in group │
|
|
1431
|
+
│ Active = skill that will be used on next matching request │
|
|
1432
|
+
└─────────────────────────────────────────────────────────────┘
|
|
1433
|
+
```
|
|
1434
|
+
|
|
1435
|
+
**Group Resolution per Request:**
|
|
1436
|
+
```
|
|
1437
|
+
Request arrives: task_type = "code_generation", lang = "typescript"
|
|
1438
|
+
|
|
1439
|
+
1. Find matching groups:
|
|
1440
|
+
coding-skills → has skills for "code" task → MATCH
|
|
1441
|
+
debugging-skills → no skills for "code" task → SKIP
|
|
1442
|
+
review-skills → no skills for "code" task → SKIP
|
|
1443
|
+
|
|
1444
|
+
2. Select group: coding-skills (only matching group)
|
|
1445
|
+
|
|
1446
|
+
3. Select skill within group (based on group's rotation strategy):
|
|
1447
|
+
round_robin → next in rotation → skill/python-wizard
|
|
1448
|
+
OR task_match → match lang=typescript → skill/typescript-expert
|
|
1449
|
+
|
|
1450
|
+
4. Apply skill:
|
|
1451
|
+
- Inject systemPrompt from skill/typescript-expert
|
|
1452
|
+
- Apply behavior overrides (temperature, maxTokens, etc.)
|
|
1453
|
+
- Apply model preferences
|
|
1454
|
+
|
|
1455
|
+
5. Send to provider with skill active
|
|
1456
|
+
|
|
1457
|
+
Result: ONE group, ONE skill, NO mixing
|
|
1458
|
+
```
|
|
1459
|
+
|
|
1460
|
+
**Group Configuration:**
|
|
1461
|
+
```typescript
|
|
1462
|
+
interface SkillGroup {
|
|
1463
|
+
id: string
|
|
1464
|
+
name: string
|
|
1465
|
+
description: string
|
|
1466
|
+
|
|
1467
|
+
// Which skills belong to this group
|
|
1468
|
+
skillIds: string[]
|
|
1469
|
+
|
|
1470
|
+
// Rotation config for this group
|
|
1471
|
+
rotation: {
|
|
1472
|
+
strategy: 'round_robin' | 'task_match' | 'quality_based' | 'weighted_random' | 'schedule'
|
|
1473
|
+
taskTypes: string[] // Which task types trigger this group
|
|
1474
|
+
languages?: string[] // Optional: only match specific languages
|
|
1475
|
+
schedule?: string // Cron for schedule-based rotation
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
// Group state
|
|
1479
|
+
activeSkillId: string // Currently active skill in rotation
|
|
1480
|
+
rotationIndex: number // For round-robin tracking
|
|
1481
|
+
lastRotatedAt: Date
|
|
1482
|
+
|
|
1483
|
+
// Group status
|
|
1484
|
+
enabled: boolean
|
|
1485
|
+
createdAt: Date
|
|
1486
|
+
updatedAt: Date
|
|
1487
|
+
}
|
|
1488
|
+
```
|
|
1489
|
+
|
|
1490
|
+
**Skill Quality Tracking (Integration with Distiller):**
|
|
1491
|
+
```
|
|
1492
|
+
Every distillation run (every 6 hours):
|
|
1493
|
+
|
|
1494
|
+
1. Analyze requests grouped by skill:
|
|
1495
|
+
skill/typescript-expert:
|
|
1496
|
+
total_requests: 234
|
|
1497
|
+
avg_quality_score: 94/100
|
|
1498
|
+
avg_latency: 2.8s
|
|
1499
|
+
avg_tokens_saved: 45%
|
|
1500
|
+
user_acceptance_rate: 91% (did user retry after this skill?)
|
|
1501
|
+
|
|
1502
|
+
skill/python-wizard:
|
|
1503
|
+
total_requests: 187
|
|
1504
|
+
avg_quality_score: 91/100
|
|
1505
|
+
avg_latency: 3.1s
|
|
1506
|
+
avg_tokens_saved: 42%
|
|
1507
|
+
user_acceptance_rate: 88%
|
|
1508
|
+
|
|
1509
|
+
2. Update skill quality scores:
|
|
1510
|
+
typescript-expert: 94 → 94 (stable)
|
|
1511
|
+
python-wizard: 91 → 92 (improving)
|
|
1512
|
+
|
|
1513
|
+
3. Auto-adjust rotation priorities:
|
|
1514
|
+
If quality_based rotation:
|
|
1515
|
+
→ Always prefer typescript-expert for TypeScript code
|
|
1516
|
+
→ Rotate to python-wizard only for Python code
|
|
1517
|
+
|
|
1518
|
+
4. Generate insights:
|
|
1519
|
+
"skill/typescript-expert is your best coding skill (94/100 quality)"
|
|
1520
|
+
"skill/debug-detective has 95% quality — consider using it more"
|
|
1521
|
+
"skill/my-experiment-v1 quality dropped to 72/100 — review needed"
|
|
1522
|
+
```
|
|
1523
|
+
|
|
1524
|
+
**Skill Dashboard Page:**
|
|
1525
|
+
```
|
|
1526
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
1527
|
+
│ ⚒️ Skills │
|
|
1528
|
+
├──────────────────────────────────────────────────────────────┤
|
|
1529
|
+
│ │
|
|
1530
|
+
│ ┌─ Active Rotations ───────────────────────────────────────┐│
|
|
1531
|
+
│ │ ││
|
|
1532
|
+
│ │ coding-skills: ││
|
|
1533
|
+
│ │ [typescript-expert] → python-wizard → go-specialist ││
|
|
1534
|
+
│ │ ▲ active rotation: round_robin ││
|
|
1535
|
+
│ │ ││
|
|
1536
|
+
│ │ debugging-skills: ││
|
|
1537
|
+
│ │ [debug-detective] → log-analyzer → error-whisperer ││
|
|
1538
|
+
│ │ ▲ active rotation: quality_based ││
|
|
1539
|
+
│ │ ││
|
|
1540
|
+
│ │ review-skills: ││
|
|
1541
|
+
│ │ [code-reviewer] → arch-reviewer ││
|
|
1542
|
+
│ │ ▲ active rotation: task_match ││
|
|
1543
|
+
│ └──────────────────────────────────────────────────────────┘│
|
|
1544
|
+
│ │
|
|
1545
|
+
│ ┌─ Skill Performance ──────────────────────────────────────┐│
|
|
1546
|
+
│ │ ││
|
|
1547
|
+
│ │ Skill │ Used │ Quality │ Accept │ Avg ms ││
|
|
1548
|
+
│ │───────────────────────┼──────┼─────────┼────────┼────────││
|
|
1549
|
+
│ │ typescript-expert │ 234 │ 94/100 │ 91% │ 2.8s ││
|
|
1550
|
+
│ │ debug-detective │ 189 │ 95/100 │ 93% │ 3.1s ││
|
|
1551
|
+
│ │ code-reviewer │ 156 │ 93/100 │ 90% │ 4.2s ││
|
|
1552
|
+
│ │ python-wizard │ 187 │ 91/100 │ 88% │ 3.1s ││
|
|
1553
|
+
│ │ go-specialist │ 98 │ 88/100 │ 85% │ 2.9s ││
|
|
1554
|
+
│ │ openclaw-debug │ 67 │ 83/100 │ 80% │ 3.5s ││
|
|
1555
|
+
│ │ my-experiment-v1 │ 12 │ 72/100 │ 75% │ 4.1s ││
|
|
1556
|
+
│ └──────────────────────────────────────────────────────────┘│
|
|
1557
|
+
│ │
|
|
1558
|
+
│ [+ Create Skill] [📥 Import from OpenClaw] [⚙️ Manage Groups]│
|
|
1559
|
+
└──────────────────────────────────────────────────────────────┘
|
|
1560
|
+
```
|
|
1561
|
+
|
|
1562
|
+
**Skill Creation from Experience (Integration with Memory):**
|
|
1563
|
+
```
|
|
1564
|
+
After 30+ days of learning, Distiller can AUTO-SUGGEST new skills:
|
|
1565
|
+
|
|
1566
|
+
"I've noticed that when you work on React projects, you always
|
|
1567
|
+
customize the system prompt to include TypeScript strict mode,
|
|
1568
|
+
Server Components, and App Router patterns.
|
|
1569
|
+
|
|
1570
|
+
This combination has produced 94% quality across 450 requests.
|
|
1571
|
+
|
|
1572
|
+
[Create as Skill: 'react-typescript-expert']"
|
|
1573
|
+
|
|
1574
|
+
→ User clicks "Create" → Skill auto-populated from learned patterns
|
|
1575
|
+
→ Added to "coding-skills" group
|
|
1576
|
+
→ Immediately available for rotation
|
|
1577
|
+
```
|
|
1578
|
+
|
|
1579
|
+
**Skill Import Sources:**
|
|
1580
|
+
1. **OpenClaw Registry** — Import skills from OpenClaw's skill marketplace
|
|
1581
|
+
2. **Local Files** — Import `.md` or `.json` skill files from disk
|
|
1582
|
+
3. **URL** — Import skill from any URL
|
|
1583
|
+
4. **Community** — Import shared skills from other Adnify users
|
|
1584
|
+
5. **Auto-Generated** — Skills auto-created by Distiller from user patterns
|
|
1585
|
+
|
|
1586
|
+
---
|
|
1587
|
+
|
|
1588
|
+
## 5. Dashboard — The Intelligence Center
|
|
1589
|
+
|
|
1590
|
+
### 5.1 Dashboard Pages
|
|
1591
|
+
|
|
1592
|
+
| Page | Description | Key Widgets |
|
|
1593
|
+
|------|-------------|-------------|
|
|
1594
|
+
| **Command Center** | Real-time overview | Neural Router status, live request feed, cost ticker, savings counter |
|
|
1595
|
+
| **Providers** | Provider management | Health matrix, mesh topology, auto-discovery |
|
|
1596
|
+
| **Models** | Model browser | Quality benchmarks, pricing comparison, namespace resolver |
|
|
1597
|
+
| **Routes** | Routing & Combos | Neural Router config, combo builder, pipeline builder |
|
|
1598
|
+
| **Skills** | Skill management | Skill forge, rotation config, group manager, OpenClaw import |
|
|
1599
|
+
| **Intelligence** | AI Analytics | Predictions, benchmarks, forensics, recommendations |
|
|
1600
|
+
| **Playground** | Chat playground | Multi-model compare, token analyzer, pipeline preview |
|
|
1601
|
+
| **Vault** | Security & Config | API keys, OAuth sessions, access control |
|
|
1602
|
+
| **Settings** | App settings | General, cache, compression, notifications |
|
|
1603
|
+
|
|
1604
|
+
### 5.2 Command Center (Home)
|
|
1605
|
+
|
|
1606
|
+
```
|
|
1607
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
1608
|
+
│ 🧠 Adnify Neural Gateway v2.0.0 │
|
|
1609
|
+
├──────────────────────────────────────────────────────────────┤
|
|
1610
|
+
│ │
|
|
1611
|
+
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
|
|
1612
|
+
│ │ Requests │ │ Saved │ │ Cost │ │ Active │ │
|
|
1613
|
+
│ │ 1,247 │ │ $127.30 │ │ $34.20 │ │ 12 prov │ │
|
|
1614
|
+
│ │ today:89 │ │ 42% tok │ │ budget: │ │ mesh:OK │ │
|
|
1615
|
+
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
|
|
1616
|
+
│ │
|
|
1617
|
+
│ ┌─ Neural Router ──────────────────────────────────────────┐│
|
|
1618
|
+
│ │ Mode: Auto (Neural) Confidence: 87% Accuracy: 94% ││
|
|
1619
|
+
│ │ Training data: 1,247 requests Last trained: 2m ago ││
|
|
1620
|
+
│ │ ││
|
|
1621
|
+
│ │ Recent decisions: ││
|
|
1622
|
+
│ │ 14:23:02 → glm/glm-5.1 (cost-optimal) ✅ 2.1s ││
|
|
1623
|
+
│ │ 14:23:01 → kr/claude-sonnet (free-tier) ✅ 3.8s ││
|
|
1624
|
+
│ │ 14:22:58 → ds/deepseek-v4 (mesh-failover) ✅ 3.2s ││
|
|
1625
|
+
│ └──────────────────────────────────────────────────────────┘│
|
|
1626
|
+
│ │
|
|
1627
|
+
│ ┌─ Semantic Cache ─────────────────────────────────────────┐│
|
|
1628
|
+
│ │ Hit rate: 18.3% Entries: 342 Size: 2.1MB ││
|
|
1629
|
+
│ │ Tokens saved: 89,400 Cost saved: $0.42 ││
|
|
1630
|
+
│ │ ││
|
|
1631
|
+
│ │ Top cached queries: ││
|
|
1632
|
+
│ │ 1. "async await js" (hit 23x) ││
|
|
1633
|
+
│ │ 2. "react hooks" (hit 18x) ││
|
|
1634
|
+
│ │ 3. "git merge conflict" (hit 15x) ││
|
|
1635
|
+
│ └──────────────────────────────────────────────────────────┘│
|
|
1636
|
+
│ │
|
|
1637
|
+
│ ┌─ Live Feed ──────────────────────────────────────────────┐│
|
|
1638
|
+
│ │ 14:23:02 POST /v1/chat/completions → glm/glm-5.1 200 ││
|
|
1639
|
+
│ │ 14:23:01 POST /v1/chat/completions → kr/claude-sn 200 ││
|
|
1640
|
+
│ │ 14:22:58 POST /v1/chat/completions → ds/deepseek 200 ││
|
|
1641
|
+
│ │ 14:22:55 POST /v1/chat/completions → an/claude-op 429 ││
|
|
1642
|
+
│ │ └─ Fallback → ds/deepseek (auto-recovered) ││
|
|
1643
|
+
│ └──────────────────────────────────────────────────────────┘│
|
|
1644
|
+
│ │
|
|
1645
|
+
│ ┌─ Recommendations ────────────────────────────────────────┐│
|
|
1646
|
+
│ │ 💡 Enable aggressive compression (save extra 12%) ││
|
|
1647
|
+
│ │ 💡 Add GLM account #2 (load balance, reduce 429s) ││
|
|
1648
|
+
│ │ ⚠️ Claude Code quota 94% used, reset in 23min ││
|
|
1649
|
+
│ │ 💡 Semantic cache similarity: try 0.93 for more hits ││
|
|
1650
|
+
│ └──────────────────────────────────────────────────────────┘│
|
|
1651
|
+
└──────────────────────────────────────────────────────────────┘
|
|
1652
|
+
```
|
|
1653
|
+
|
|
1654
|
+
### 5.3 Intelligence Page
|
|
1655
|
+
|
|
1656
|
+
**Sub-tabs:**
|
|
1657
|
+
1. **Predictions** — Cost prediction, usage forecast, budget projection
|
|
1658
|
+
2. **Benchmarks** — Model quality comparison, A/B testing results
|
|
1659
|
+
3. **Forensics** — Error analysis, root cause, suggestions
|
|
1660
|
+
4. **Recommendations** — AI-generated optimization suggestions
|
|
1661
|
+
5. **Pattern Analysis** — Usage patterns, peak hours, model preferences
|
|
1662
|
+
|
|
1663
|
+
### 5.4 Multi-Model Playground
|
|
1664
|
+
|
|
1665
|
+
**Fitur unik:** Bandingkan response dari 2-4 model secara side-by-side.
|
|
1666
|
+
|
|
1667
|
+
```
|
|
1668
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
1669
|
+
│ Playground — Multi-Model Compare │
|
|
1670
|
+
│ │
|
|
1671
|
+
│ Prompt: "Write a binary search in Go" │
|
|
1672
|
+
│ │
|
|
1673
|
+
│ ┌─ Claude Sonnet 4.5 ─────┐ ┌─ GPT-5.5 ────────────────┐ │
|
|
1674
|
+
│ │ ```go │ │ ```go │ │
|
|
1675
|
+
│ │ func binarySearch(...) { │ │ func binarySearch(...) { │ │
|
|
1676
|
+
│ │ // implementation │ │ // implementation │ │
|
|
1677
|
+
│ │ } │ │ } │ │
|
|
1678
|
+
│ │ ``` │ │ ``` │ │
|
|
1679
|
+
│ │ │ │ │ │
|
|
1680
|
+
│ │ Tokens: 245 │ │ Tokens: 198 │ │
|
|
1681
|
+
│ │ Latency: 3.2s │ │ Latency: 2.1s │ │
|
|
1682
|
+
│ │ Quality: 92/100 │ │ Quality: 88/100 │ │
|
|
1683
|
+
│ │ Cost: $0.000 (free) │ │ Cost: $0.012 │ │
|
|
1684
|
+
│ └──────────────────────────┘ └───────────────────────────┘ │
|
|
1685
|
+
│ │
|
|
1686
|
+
│ ┌─ DeepSeek V4 ────────────┐ ┌─ GLM-5.1 ────────────────┐ │
|
|
1687
|
+
│ │ (streaming...) │ │ (streaming...) │ │
|
|
1688
|
+
│ └──────────────────────────┘ └───────────────────────────┘ │
|
|
1689
|
+
│ │
|
|
1690
|
+
│ [Send to All] [Export Comparison] [Save as Benchmark] │
|
|
1691
|
+
└─────────────────────────────────────────────────────────────┘
|
|
1692
|
+
```
|
|
1693
|
+
|
|
1694
|
+
---
|
|
1695
|
+
|
|
1696
|
+
## 6. Non-Functional Requirements
|
|
1697
|
+
|
|
1698
|
+
### 6.1 Performance
|
|
1699
|
+
| Metric | Target |
|
|
1700
|
+
|--------|--------|
|
|
1701
|
+
| Proxy overhead | <50ms (p95) |
|
|
1702
|
+
| Neural Router inference | <5ms |
|
|
1703
|
+
| Semantic cache lookup | <10ms |
|
|
1704
|
+
| Embedding generation | <15ms |
|
|
1705
|
+
| Dashboard LCP | <800ms |
|
|
1706
|
+
| Memory idle | <200MB |
|
|
1707
|
+
| Memory under load | <512MB |
|
|
1708
|
+
| Cold start | <3 seconds |
|
|
1709
|
+
|
|
1710
|
+
### 6.2 Scalability
|
|
1711
|
+
- Handle 100+ concurrent requests
|
|
1712
|
+
- 10,000+ cached entries
|
|
1713
|
+
- 100,000+ request logs
|
|
1714
|
+
- 40+ providers simultaneously
|
|
1715
|
+
|
|
1716
|
+
### 6.3 Security
|
|
1717
|
+
- AES-256 encryption for stored credentials
|
|
1718
|
+
- WebAuthn support (passwordless)
|
|
1719
|
+
- Optional API key enforcement
|
|
1720
|
+
- Rate limiting per IP + per API key
|
|
1721
|
+
- CORS strict mode option
|
|
1722
|
+
- No secrets in logs or error messages
|
|
1723
|
+
- Encrypted cloud sync (E2E)
|
|
1724
|
+
|
|
1725
|
+
### 6.4 Compatibility
|
|
1726
|
+
- Bun 1.1+ (primary) / Node.js 20+ (fallback)
|
|
1727
|
+
- Windows, macOS, Linux
|
|
1728
|
+
- Chrome, Firefox, Safari, Edge
|
|
1729
|
+
- Mobile responsive (PWA-ready)
|
|
1730
|
+
- MCP protocol v2024-11-05
|
|
1731
|
+
|
|
1732
|
+
---
|
|
1733
|
+
|
|
1734
|
+
## 7. Project Phases
|
|
1735
|
+
|
|
1736
|
+
### Phase 1 — Foundation (Week 1-2)
|
|
1737
|
+
- Project setup (Next.js 15, Bun, TypeScript, SQLite)
|
|
1738
|
+
- Provider adapter interface + 5 providers
|
|
1739
|
+
- Basic routing (priority + latency)
|
|
1740
|
+
- OpenAI-compatible API
|
|
1741
|
+
- Basic dashboard
|
|
1742
|
+
|
|
1743
|
+
### Phase 2 — Intelligence Engine (Week 3-5)
|
|
1744
|
+
- Neural Router (ONNX Runtime, local ML)
|
|
1745
|
+
- Semantic Cache (MiniLM embeddings)
|
|
1746
|
+
- Adaptive Token Squeezer
|
|
1747
|
+
- Predictive Cost Engine
|
|
1748
|
+
- Smart Request Forensics
|
|
1749
|
+
- **Persistent Memory Engine (Episodic + Semantic + Procedural)**
|
|
1750
|
+
- **Experience Distiller (auto-summarization & pattern extraction)**
|
|
1751
|
+
|
|
1752
|
+
### Phase 3 — Advanced Platform (Week 6-8)
|
|
1753
|
+
- Universal Model Namespace
|
|
1754
|
+
- Provider Mesh Network
|
|
1755
|
+
- Model Quality Benchmark
|
|
1756
|
+
- Prompt Pre-processor
|
|
1757
|
+
- Request Pipeline Builder
|
|
1758
|
+
- Conversation Context Manager
|
|
1759
|
+
- MCP Gateway
|
|
1760
|
+
- **Adaptive Intelligence Layer (connects memory to all decisions)**
|
|
1761
|
+
- **Dynamic Skill Rotation Engine**
|
|
1762
|
+
- **Skill Forge (create, import from OpenClaw, group)**
|
|
1763
|
+
- **Skill Groups (categorize & rotate by group)**
|
|
1764
|
+
|
|
1765
|
+
### Phase 4 — Dashboard & UX (Week 9-10)
|
|
1766
|
+
- Full Intelligence Center dashboard
|
|
1767
|
+
- Multi-Model Playground
|
|
1768
|
+
- Provider auto-discovery
|
|
1769
|
+
- Provider Arbitrage engine
|
|
1770
|
+
- Collaboration features
|
|
1771
|
+
|
|
1772
|
+
### Phase 5 — Polish & Release (Week 11-12)
|
|
1773
|
+
- 40+ providers
|
|
1774
|
+
- Plugin system
|
|
1775
|
+
- Testing (unit, integration, E2E)
|
|
1776
|
+
- Documentation
|
|
1777
|
+
- npm publish + CLI
|
|
1778
|
+
- v2.0.0 release
|
|
1779
|
+
|
|
1780
|
+
**Total: 12 Minggu**
|
|
1781
|
+
|
|
1782
|
+
---
|
|
1783
|
+
|
|
1784
|
+
## 8. Success Metrics
|
|
1785
|
+
|
|
1786
|
+
| Metric | Target | Measurement |
|
|
1787
|
+
|--------|--------|-------------|
|
|
1788
|
+
| Token savings | 40-65% | Before/after RTK+ |
|
|
1789
|
+
| Request savings via cache | 15-30% | Semantic cache hit rate |
|
|
1790
|
+
| Neural Router accuracy | >90% | Correct provider selection |
|
|
1791
|
+
| Fallback speed | <1 second | Time to alternative response |
|
|
1792
|
+
| Cost reduction vs direct | >60% | Total spend comparison |
|
|
1793
|
+
| Setup time | <3 minutes | Zero-config auto-discovery |
|
|
1794
|
+
| Dashboard load | <800ms | LCP measurement |
|
|
1795
|
+
| Provider uptime | 99.99% | Via mesh failover |
|
|
1796
|
+
| Memory retention | 100% | Zero data loss on restart |
|
|
1797
|
+
| Learning improvement | >20% | Latency/cost reduction after 30 days vs day 1 |
|
|
1798
|
+
| Distillation accuracy | >85% | Auto-generated rules that are correct |
|
|
1799
|
+
| Knowledge growth | Linear | Knowledge entries increase monotonically |
|