overmind-mcp 2.8.50 → 2.8.52
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/dist/bin/cli.js +30 -4
- package/dist/bin/cli.js.map +1 -1
- package/dist/lib/orchestration/swarm.js +2 -2
- package/dist/lib/orchestration/swarm.js.map +1 -1
- package/dist/lib/processRegistry.js +2 -2
- package/dist/lib/processRegistry.js.map +1 -1
- package/dist/lib/sessions.js +2 -2
- package/dist/lib/sessions.js.map +1 -1
- package/dist/memory/MemoryFactory.js +2 -2
- package/dist/memory/MemoryFactory.js.map +1 -1
- package/dist/memory/PostgresMemoryProvider.d.ts.map +1 -1
- package/dist/memory/PostgresMemoryProvider.js +2 -2
- package/dist/memory/PostgresMemoryProvider.js.map +1 -1
- package/dist/services/ClaudeRunner.d.ts.map +1 -1
- package/dist/services/ClaudeRunner.js +38 -0
- package/dist/services/ClaudeRunner.js.map +1 -1
- package/dist/services/ClineRunner.js +2 -2
- package/dist/services/ClineRunner.js.map +1 -1
- package/dist/services/GeminiRunner.js +2 -2
- package/dist/services/GeminiRunner.js.map +1 -1
- package/dist/services/NousHermesRunner.js +2 -2
- package/dist/services/NousHermesRunner.js.map +1 -1
- package/dist/services/OpenClawRunner.js +2 -2
- package/dist/services/OpenClawRunner.js.map +1 -1
- package/dist/services/OpenCodeRunner.js +2 -2
- package/dist/services/OpenCodeRunner.js.map +1 -1
- package/dist/services/QwenCliRunner.js +2 -2
- package/dist/services/QwenCliRunner.js.map +1 -1
- package/dist/services/hermes/binaryFinder.js +2 -2
- package/dist/services/hermes/binaryFinder.js.map +1 -1
- package/dist/services/hermes/configYamlFilter.js +2 -2
- package/dist/services/hermes/configYamlFilter.js.map +1 -1
- package/dist/services/hermes/processUtils.js +2 -2
- package/dist/services/hermes/processUtils.js.map +1 -1
- package/docs/OVERMIND_HERMES_SNIPERBOT_FLOW.md +1 -1
- package/docs/SETUP_HERMES_AGENT_FROM_SCRATCH.md +18 -18
- package/docs/SUBTILISATION_EXPLAINED.md +2 -2
- package/docs/agent-http-tutorial.md +524 -524
- package/docs/doc_guide_agent_hermes_permanent.md +1 -1
- package/docs/doc_hermes_gateway.md +2 -2
- package/docs/guide_agent_hermes_overmind.md +1 -1
- package/docs/provider-config-map.md +556 -556
- package/package.json +1 -1
- package/docs/PLAN_REFACTORING_OVERMIND_V2.md +0 -414
- package/docs/PLAN_REFACTOR_OVERMIND_AGI.md +0 -606
|
@@ -1,606 +0,0 @@
|
|
|
1
|
-
# 🚀 PLAN DE REFACTORISATION — Overmind → Réseau Agentique Décentralisé (AGI-Ready)
|
|
2
|
-
|
|
3
|
-
> **Objectif** : Transformer Overmind d'un orchestrateur mono-machine en un **réseau de noeuds RPC agentiques** capable d'émergence collective. Ambitieux mais ancré dans la réalité du code existant.
|
|
4
|
-
|
|
5
|
-
> **Auteur** : Sniperbot Analyst
|
|
6
|
-
> **Date** : Juin 2026
|
|
7
|
-
> **Status** : PROPOSITION — En attente de validation
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## 📊 ÉTAT DES LIEUX — Ce qu'on a MAINTENANT
|
|
12
|
-
|
|
13
|
-
### Architecture Actuelle (Mono-Machine)
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
┌─────────────────────────────────────────────────┐
|
|
17
|
-
│ MACHINE LOCALE (Windows) │
|
|
18
|
-
│ │
|
|
19
|
-
│ ┌──────────┐ HTTP/JSON-RPC ┌──────────────┐ │
|
|
20
|
-
│ │ Hermes │ ◄──────────────► │ Overmind │ │
|
|
21
|
-
│ │ Gateway │ localhost:3099 │ MCP Server │ │
|
|
22
|
-
│ │ (Agent) │ │ (port 3099) │ │
|
|
23
|
-
│ └──────────┘ └──────┬───────┘ │
|
|
24
|
-
│ │ │
|
|
25
|
-
│ ┌────────────────────┤ │
|
|
26
|
-
│ │ │ │
|
|
27
|
-
│ ┌──────▼──────┐ ┌───────▼──────┐ │
|
|
28
|
-
│ │ PostgreSQL │ │ PostgreSQL │ │
|
|
29
|
-
│ │ overmind_core│ │ agent_sniper │ │
|
|
30
|
-
│ │ (partagé) │ │ (agent-local) │ │
|
|
31
|
-
│ └──────────────┘ └──────────────┘ │
|
|
32
|
-
│ │ │
|
|
33
|
-
│ ┌──────▼──────┐ │
|
|
34
|
-
│ │ PostgreSQL │ │
|
|
35
|
-
│ │ agent_miniX │ (1 DB par agent) │
|
|
36
|
-
│ └──────────────┘ │
|
|
37
|
-
└─────────────────────────────────────────────────┘
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Ce qui existe DÉJA dans le code
|
|
41
|
-
|
|
42
|
-
| Composant | Fichier | Status |
|
|
43
|
-
|---|---|---|
|
|
44
|
-
| **JSON-RPC 2.0 Bridge** | `src/bridge/types.ts` | ✅ Opérationnel |
|
|
45
|
-
| **Circuit Breaker** | `src/bridge/BridgeProxy.ts` | ✅ Closed→Open→Half-Open |
|
|
46
|
-
| **Memory Factory** | `src/memory/MemoryFactory.ts` | ✅ PostgreSQL only |
|
|
47
|
-
| **DB par agent** | `PostgresMemoryProvider.ts:91` | ✅ `agent_<name>` isolé |
|
|
48
|
-
| **DB partagée** | `PostgresMemoryProvider.ts:77` | ✅ `overmind_core` |
|
|
49
|
-
| **Recherche cross-DB** | `PostgresMemoryProvider.ts:465` | ✅ Agent DB + Core DB |
|
|
50
|
-
| **pgvector embeddings** | `PostgresMemoryProvider.ts:442` | ✅ Qwen 8B, 4096D |
|
|
51
|
-
| **Process Registry** | `src/lib/processRegistry.ts` | ✅ PID tracking |
|
|
52
|
-
| **Swarm orchestration** | `src/lib/orchestration/swarm.ts` | ⚠️ Existe, à explorer |
|
|
53
|
-
| **14 outils MCP** | `src/server.ts` | ✅ Complets |
|
|
54
|
-
|
|
55
|
-
### Le VRAI problème mémoire
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
// PostgresMemoryProvider.ts lignes 91-94
|
|
59
|
-
private getDbName(agentName?: string): string {
|
|
60
|
-
if (!agentName) return this.coreDbName; // "overmind_core"
|
|
61
|
-
return `agent_${this.sanitizeIdentifier(agentName)}`; // "agent_sniper"
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
**Réalité** :
|
|
66
|
-
- ❌ **Pas de vraie mémoire communautaire** — `overmind_core` existe mais n'est alimenté QUE par `memory_store` sans `agentName`
|
|
67
|
-
- ❌ **Pas de sync inter-machines** — PostgreSQL est local (127.0.0.1:5432)
|
|
68
|
-
- ❌ **Pas de gossip protocol** — les agents ne partagent pas entre eux
|
|
69
|
-
- ✅ **La base technique existe** — DB par agent + DB core + vector search
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## 🎯 VISION — Ce qu'on veut ATTEINDRE
|
|
74
|
-
|
|
75
|
-
### Architecture Cible (Réseau Multi-Noeuds)
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
┌─────────────────────────────┐ ┌─────────────────────────────┐
|
|
79
|
-
│ NOEUD A (Machine 1) │ │ NOEUD B (Machine 2) │
|
|
80
|
-
│ Windows/Desktop │ │ Linux/Cloud │
|
|
81
|
-
│ │ │ │
|
|
82
|
-
│ ┌─────────┐ ┌──────────┐ │ │ ┌─────────┐ ┌──────────┐ │
|
|
83
|
-
│ │ Hermes │ │ Overmind │ │ │ │ Hermes │ │ Overmind │ │
|
|
84
|
-
│ │ Agents │ │ Node A │ │ │ │ Agents │ │ Node B │ │
|
|
85
|
-
│ │ (x N) │ │ (RPC) │ │ │ │ (x N) │ │ (RPC) │ │
|
|
86
|
-
│ └────┬────┘ └─────┬────┘ │ │ └────┬────┘ └─────┬────┘ │
|
|
87
|
-
│ │ │ │ │ │ │ │
|
|
88
|
-
│ ┌────▼────┐ ┌─────▼────┐ │ │ ┌────▼────┐ ┌─────▼────┐ │
|
|
89
|
-
│ │ PG Local│ │ Sync │ │ │ │ PG Local│ │ Sync │ │
|
|
90
|
-
│ │ agents │ │ Engine │◄┼─────┼─►│ agents │ │ Engine │ │
|
|
91
|
-
│ │ + core │ │ (Gossip) │ │ │ │ + core │ │ (Gossip) │ │
|
|
92
|
-
│ └─────────┘ └──────────┘ │ │ └─────────┘ └──────────┘ │
|
|
93
|
-
│ │ │ │ │ │
|
|
94
|
-
│ ┌─────▼────┐ │ │ ┌─────▼────┐ │
|
|
95
|
-
│ │ Mesh │ │ │ │ Mesh │ │
|
|
96
|
-
│ │ Layer │ │ │ │ Layer │ │
|
|
97
|
-
│ └──────────┘ │ │ └──────────┘ │
|
|
98
|
-
└─────────────────────────────┘ └─────────────────────────────┘
|
|
99
|
-
│ │
|
|
100
|
-
└───────────┬───────────────┘
|
|
101
|
-
│
|
|
102
|
-
┌───────▼───────┐
|
|
103
|
-
│ Shared Core │
|
|
104
|
-
│ (PostgreSQL │
|
|
105
|
-
│ Répliqué) │
|
|
106
|
-
└───────────────┘
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## 📋 PHASE 1 — Fondations Réseau (2-3 semaines)
|
|
112
|
-
|
|
113
|
-
### 1.1 Refactor du Memory Provider → Multi-Source
|
|
114
|
-
|
|
115
|
-
**Problème actuel** : `PostgresMemoryProvider` hardcode `127.0.0.1:5432`.
|
|
116
|
-
|
|
117
|
-
**Solution** : Config multi-sources.
|
|
118
|
-
|
|
119
|
-
```typescript
|
|
120
|
-
// NOUVEAU : memory/MemoryConfig.ts
|
|
121
|
-
interface MemorySource {
|
|
122
|
-
name: string;
|
|
123
|
-
type: 'local' | 'remote' | 'shared';
|
|
124
|
-
host: string;
|
|
125
|
-
port: number;
|
|
126
|
-
database: string;
|
|
127
|
-
auth: 'env' | 'token';
|
|
128
|
-
priority: number; // 0 = primaire, 1+ = fallback
|
|
129
|
-
syncMode: 'none' | 'push' | 'pull' | 'bidirectional';
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
**Fichiers à modifier** :
|
|
134
|
-
- `src/memory/PostgresMemoryProvider.ts` → Accepter config dynamique
|
|
135
|
-
- `src/memory/MemoryFactory.ts` → Multi-provider pool
|
|
136
|
-
- Nouveau : `src/memory/MemorySync.ts` → Sync engine
|
|
137
|
-
|
|
138
|
-
### 1.2 Noeud RPC — Transport Layer
|
|
139
|
-
|
|
140
|
-
**Existant** : BridgeProxy utilise déjà JSON-RPC 2.0 sur HTTP.
|
|
141
|
-
|
|
142
|
-
**Extension** : Ajouter un mode "server" au Bridge.
|
|
143
|
-
|
|
144
|
-
```typescript
|
|
145
|
-
// NOUVEAU : src/bridge/RpcNode.ts
|
|
146
|
-
interface RpcNode {
|
|
147
|
-
nodeId: string; // UUID du noeud
|
|
148
|
-
endpoints: string[]; // ["http://192.168.1.10:3099/mcp"]
|
|
149
|
-
capabilities: string[]; // ["memory", "run_agent", "orchestration"]
|
|
150
|
-
status: 'online' | 'offline' | 'syncing';
|
|
151
|
-
lastHeartbeat: number;
|
|
152
|
-
agentCount: number;
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**Comment ça marche entre 2 PC distants** :
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
Machine A (Windows, IP: 192.168.1.10)
|
|
160
|
-
→ Overmind MCP Server écoute sur 0.0.0.0:3099 (pas juste localhost)
|
|
161
|
-
→ Déclare ses agents locaux
|
|
162
|
-
→ Se connecte à Machine B via HTTP
|
|
163
|
-
|
|
164
|
-
Machine B (Linux, IP: 192.168.1.20)
|
|
165
|
-
→ Overmind MCP Server écoute sur 0.0.0.0:3099
|
|
166
|
-
→ Déclare ses agents locaux
|
|
167
|
-
→ Se connecte à Machine A via HTTP
|
|
168
|
-
|
|
169
|
-
Flux RPC:
|
|
170
|
-
A.run_agent("analyse_crypto")
|
|
171
|
-
→ A check si agent local disponible
|
|
172
|
-
→ Si non, forward à B via RPC
|
|
173
|
-
→ B exécute, retourne résultat à A
|
|
174
|
-
→ A stocke en mémoire locale + notifie B (sync)
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
**Pas besoin de WebSocket** — HTTP + polling/heartbeat suffit pour 2 noeuds.
|
|
178
|
-
|
|
179
|
-
### 1.3 Gossip Protocol (Light)
|
|
180
|
-
|
|
181
|
-
```typescript
|
|
182
|
-
// NOUVEAU : src/bridge/GossipEngine.ts
|
|
183
|
-
class GossipEngine {
|
|
184
|
-
// Chaque noeud partage :
|
|
185
|
-
// 1. Sa liste d'agents disponibles
|
|
186
|
-
// 2. Ses capabilities (memory, compute, models)
|
|
187
|
-
// 3. Son statut (load, queue depth)
|
|
188
|
-
|
|
189
|
-
async broadcastKnowledge(chunk: KnowledgeChunk): Promise<void> {
|
|
190
|
-
// Pousse un knowledge_chunk vers les autres noeuds
|
|
191
|
-
// Pas de sync complet — seulement les nouveautés
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
async requestKnowledge(query: string): Promise<SearchResult[]> {
|
|
195
|
-
// Demande aux autres noeuds de chercher dans leur mémoire
|
|
196
|
-
// Agrège les résultats
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
**Fréquence** : Heartbeat toutes les 30s, sync knowledge toutes les 5min.
|
|
202
|
-
|
|
203
|
-
---
|
|
204
|
-
|
|
205
|
-
## 📋 PHASE 2 — Mémoire Distribuée (2-3 semaines)
|
|
206
|
-
|
|
207
|
-
### 2.1 Le Problème Mémoire — Diagnostic Précis
|
|
208
|
-
|
|
209
|
-
**Ce qui existe RÉELLEMENT** :
|
|
210
|
-
|
|
211
|
-
| Couche | Implémentation | Isolation | Partage |
|
|
212
|
-
|---|---|---|---|
|
|
213
|
-
| **Fichiers plats Hermes** | MEMORY.md, USER.md | Par agent | ❌ Aucun |
|
|
214
|
-
| **DB locale Overmind** | `agent_<name>` PostgreSQL | Par agent | ❌ Aucun |
|
|
215
|
-
| **DB Core** | `overmind_core` PostgreSQL | Global | ⚠️ Existe mais vide |
|
|
216
|
-
| **Cross-DB search** | `searchMemory()` lignes 458-521 | Lit agent + core | ✅ Code présent |
|
|
217
|
-
|
|
218
|
-
**Le "overmind_core" EST la mémoire partagée**. Elle fonctionne. Mais :
|
|
219
|
-
- Personne n'y écrit systématiquement
|
|
220
|
-
- Pas de mécanisme de push automatique
|
|
221
|
-
- Pas de sync entre machines
|
|
222
|
-
|
|
223
|
-
### 2.2 Solution — 3 Zones Mémoire
|
|
224
|
-
|
|
225
|
-
```
|
|
226
|
-
Zone 1: PRIVATE (agent-local, jamais partagé)
|
|
227
|
-
→ DB: agent_<name>
|
|
228
|
-
→ Contenu: préférences user, corrections, notes perso
|
|
229
|
-
→ Flag: source = "private"
|
|
230
|
-
|
|
231
|
-
Zone 2: SHARED (noeud-local, partagé entre agents du même noeud)
|
|
232
|
-
→ DB: overmind_core
|
|
233
|
-
→ Contenu: décisions architecturales, patterns, erreurs communes
|
|
234
|
-
→ Flag: source = "shared"
|
|
235
|
-
→ Auto-sync: tout knowledge avec source="shared" → gossip push
|
|
236
|
-
|
|
237
|
-
Zone 3: FEDERATED (cross-noeuds, partagé entre toutes les machines)
|
|
238
|
-
→ DB: overmind_federation (nouvelle)
|
|
239
|
-
→ Contenu: discoveries, breakthroughs, AGI-signals
|
|
240
|
-
→ Flag: source = "federation"
|
|
241
|
-
→ Sync: gossip protocol → tous les noeuds
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
### 2.3 Modifications Code Mémoire
|
|
245
|
-
|
|
246
|
-
```typescript
|
|
247
|
-
// MODIFIER : PostgresMemoryProvider.ts
|
|
248
|
-
|
|
249
|
-
// Avant :
|
|
250
|
-
private getDbName(agentName?: string): string {
|
|
251
|
-
if (!agentName) return this.coreDbName;
|
|
252
|
-
return `agent_${this.sanitizeIdentifier(agentName)}`;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// Après :
|
|
256
|
-
private getDbName(agentName?: string, zone?: 'private' | 'shared' | 'federation'): string {
|
|
257
|
-
switch (zone) {
|
|
258
|
-
case 'private': return `agent_${this.sanitizeIdentifier(agentName!)}`;
|
|
259
|
-
case 'shared': return this.coreDbName;
|
|
260
|
-
case 'federation': return 'overmind_federation';
|
|
261
|
-
default:
|
|
262
|
-
if (!agentName) return this.coreDbName;
|
|
263
|
-
return `agent_${this.sanitizeIdentifier(agentName)}`;
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// searchMemory() étendu :
|
|
268
|
-
async searchMemory(params: SearchMemoryParams): Promise<SearchResult[]> {
|
|
269
|
-
const dbsToSearch = [
|
|
270
|
-
this.getDbName(params.agentName, 'private'), // Zone 1
|
|
271
|
-
this.getDbName(undefined, 'shared'), // Zone 2
|
|
272
|
-
];
|
|
273
|
-
|
|
274
|
-
// Si federation activée, interroger les autres noeuds
|
|
275
|
-
if (params.includeFederation) {
|
|
276
|
-
const remoteResults = await this.gossipEngine.queryRemote(params.query);
|
|
277
|
-
dbsToSearch.push(...remoteResults);
|
|
278
|
-
}
|
|
279
|
-
// ... reste du code existant
|
|
280
|
-
}
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
### 2.4 PostgreSQL Replication — Réalité Technique
|
|
284
|
-
|
|
285
|
-
**Pour 2 machines distantes, 3 options** :
|
|
286
|
-
|
|
287
|
-
| Option | Complexité | Performance | Recommandation |
|
|
288
|
-
|---|---|---|---|
|
|
289
|
-
| **A. Logical Replication PG** | 🔴 Haute | 🟢 Excellente | Si les 2 machines ont PG |
|
|
290
|
-
| **B. Application-level sync** | 🟡 Moyenne | 🟡 Bonne | ✅ **Recommandé** |
|
|
291
|
-
| **C. Shared remote PG** | 🟢 Simple | 🟡 Dépend réseau | Pour débuter |
|
|
292
|
-
|
|
293
|
-
**Recommandation** : **Option B** (application-level sync via GossipEngine).
|
|
294
|
-
|
|
295
|
-
Pourquoi :
|
|
296
|
-
- Pas besoin de config PG replication
|
|
297
|
-
- Marche avec n'importe quel hébergement PG
|
|
298
|
-
- Contrôle total sur quoi sync et quand
|
|
299
|
-
- Le code Overmind gère le sync, pas PostgreSQL
|
|
300
|
-
|
|
301
|
-
```typescript
|
|
302
|
-
// Flux de sync entre 2 machines :
|
|
303
|
-
//
|
|
304
|
-
// Machine A → stocke knowledge "Bitcoin pattern détecté"
|
|
305
|
-
// → GossipEngine.broadcastKnowledge(chunk)
|
|
306
|
-
// → HTTP POST vers Machine B /sync/knowledge
|
|
307
|
-
// → Machine B reçoit, insère dans overmind_federation
|
|
308
|
-
// → Machine B ACK
|
|
309
|
-
// → Machine A marque comme "synced"
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
---
|
|
313
|
-
|
|
314
|
-
## 📋 PHASE 3 — Noeud RPC & Communication Distante (2 semaines)
|
|
315
|
-
|
|
316
|
-
### 3.1 Architecture RPC Réelle
|
|
317
|
-
|
|
318
|
-
```
|
|
319
|
-
MACHINE A (Chez toi, Windows)
|
|
320
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
321
|
-
IP: 192.168.1.10 (ou IP publique avec port-forward)
|
|
322
|
-
|
|
323
|
-
Process 1: Overmind MCP Server (port 3099)
|
|
324
|
-
→ Écoute 0.0.0.0:3099 (pas 127.0.0.1 !)
|
|
325
|
-
→ HTTP + JSON-RPC 2.0
|
|
326
|
-
→ Auth: Bearer token
|
|
327
|
-
|
|
328
|
-
Process 2: Hermes Gateway (sniperbot)
|
|
329
|
-
→ Se connecte à localhost:3099
|
|
330
|
-
|
|
331
|
-
Process 3: PostgreSQL (port 5432)
|
|
332
|
-
→ Écoute 0.0.0.0:5432
|
|
333
|
-
→ Auth: password + pg_hba.conf pour IP distante
|
|
334
|
-
|
|
335
|
-
MACHINE B (Distant, Linux/VPS)
|
|
336
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
337
|
-
IP: xx.xx.xx.xx
|
|
338
|
-
|
|
339
|
-
Process 1: Overmind MCP Server (port 3099)
|
|
340
|
-
Process 2: Hermes Gateway (autres agents)
|
|
341
|
-
Process 3: PostgreSQL (port 5432)
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
### 3.2 Configuration Noeud
|
|
345
|
-
|
|
346
|
-
```yaml
|
|
347
|
-
# NOUVEAU FICHIER : overmind.config.yaml
|
|
348
|
-
|
|
349
|
-
node:
|
|
350
|
-
id: "node_alpha"
|
|
351
|
-
bind: "0.0.0.0:3099"
|
|
352
|
-
auth:
|
|
353
|
-
type: "bearer"
|
|
354
|
-
token: "${OVERMIND_NODE_TOKEN}" # env var
|
|
355
|
-
|
|
356
|
-
peers:
|
|
357
|
-
- id: "node_beta"
|
|
358
|
-
endpoint: "http://xx.xx.xx.xx:3099/mcp"
|
|
359
|
-
token: "${OVERMIND_PEER_BETA_TOKEN}"
|
|
360
|
-
sync:
|
|
361
|
-
knowledge: true # sync connaissances
|
|
362
|
-
runs: false # ne pas sync les runs (trop lourd)
|
|
363
|
-
interval_ms: 300000 # sync toutes les 5 min
|
|
364
|
-
|
|
365
|
-
memory:
|
|
366
|
-
local:
|
|
367
|
-
host: "127.0.0.1"
|
|
368
|
-
port: 5432
|
|
369
|
-
zones:
|
|
370
|
-
private: true # agent_<name> DB
|
|
371
|
-
shared: true # overmind_core DB
|
|
372
|
-
federation: true # overmind_federation DB
|
|
373
|
-
embedding:
|
|
374
|
-
model: "qwen-8b"
|
|
375
|
-
dimensions: 4096
|
|
376
|
-
|
|
377
|
-
agents:
|
|
378
|
-
- name: "sniperbot_analyst"
|
|
379
|
-
runner: "hermes"
|
|
380
|
-
memory_zone: ["private", "shared"]
|
|
381
|
-
- name: "federation_scanner"
|
|
382
|
-
runner: "hermes"
|
|
383
|
-
memory_zone: ["shared", "federation"] # agent dédié au partage
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
### 3.3 Comment le partage fonctionne RÉELLEMENT
|
|
387
|
-
|
|
388
|
-
**Scénario : 2 ordinateurs, 1 réseau**
|
|
389
|
-
|
|
390
|
-
```
|
|
391
|
-
Étape 1: DÉMARRAGE
|
|
392
|
-
Node A démarre → heartbeat vers Node B
|
|
393
|
-
Node B démarre → heartbeat vers Node A
|
|
394
|
-
Chacun déclare ses agents et capabilities
|
|
395
|
-
|
|
396
|
-
Étape 2: EXÉCUTION LOCALE
|
|
397
|
-
User sur Discord → "Analyse BTC"
|
|
398
|
-
Node A → sniperbot analyse → résultat stocké dans:
|
|
399
|
-
- agent_sniperbot (private) ✅
|
|
400
|
-
- overmind_core (shared) si info importante ✅
|
|
401
|
-
|
|
402
|
-
Étape 3: SYNC
|
|
403
|
-
Toutes les 5 min:
|
|
404
|
-
Node A → POST /sync/knowledge → Node B
|
|
405
|
-
"J'ai appris que BTC pattern X..."
|
|
406
|
-
Node B → reçoit → insère dans overmind_federation
|
|
407
|
-
Node B → POST /sync/knowledge → Node A
|
|
408
|
-
"J'ai découvert que ETH pattern Y..."
|
|
409
|
-
Node A → reçoit → insère dans overmind_federation
|
|
410
|
-
|
|
411
|
-
Étape 4: RECHERCHE CROSS-NODE
|
|
412
|
-
User → "Qu'est-ce qu'on sait sur DeFi ?"
|
|
413
|
-
Node A → searchMemory()
|
|
414
|
-
→ DB locale (agent + core) ✅
|
|
415
|
-
→ DB federation (sync de B) ✅
|
|
416
|
-
→ RPC query vers B en temps réel (optionnel)
|
|
417
|
-
Résultat = merge des 2 sources
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
**Pas besoin de** :
|
|
421
|
-
- ❌ Blockchain réelle (trop lent pour du RPC)
|
|
422
|
-
- ❌ IPFS (overkill pour 2 noeuds)
|
|
423
|
-
- ❌ WebSocket persistant (HTTP suffit)
|
|
424
|
-
- ❌ Docker/K8s (2 machines = config simple)
|
|
425
|
-
|
|
426
|
-
### 3.4 Sécurité
|
|
427
|
-
|
|
428
|
-
| Couche | Mécanisme |
|
|
429
|
-
|---|---|
|
|
430
|
-
| **Transport** | HTTPS (Let's Encrypt ou self-signed) |
|
|
431
|
-
| **Auth** | Bearer token par paire de noeuds |
|
|
432
|
-
| **Données** | Pas de clés API dans les syncs |
|
|
433
|
-
| **PG** | pg_hba.conf restrictif + password |
|
|
434
|
-
| **Memory** | Zone private JAMAIS sync |
|
|
435
|
-
|
|
436
|
-
---
|
|
437
|
-
|
|
438
|
-
## 📋 PHASE 4 — Agents Fédérés (2 semaines)
|
|
439
|
-
|
|
440
|
-
### 4.1 Federation Agent (Nouveau)
|
|
441
|
-
|
|
442
|
-
Un agent dédié à la communication inter-noeuds :
|
|
443
|
-
|
|
444
|
-
```typescript
|
|
445
|
-
// NOUVEAU : src/agents/FederationAgent.ts
|
|
446
|
-
// Rôle : passerelle entre noeuds
|
|
447
|
-
|
|
448
|
-
class FederationAgent {
|
|
449
|
-
// Push : découvertes locales → autres noeuds
|
|
450
|
-
async pushDiscoveries(): Promise<void> {
|
|
451
|
-
const recent = await memory.searchRecent({
|
|
452
|
-
zone: 'shared',
|
|
453
|
-
since: this.lastSyncTimestamp,
|
|
454
|
-
minScore: 0.7 // que les découvertes importantes
|
|
455
|
-
});
|
|
456
|
-
for (const peer of this.peers) {
|
|
457
|
-
await peer.syncKnowledge(recent);
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
// Pull : demander aux autres noeuds
|
|
462
|
-
async pullKnowledge(query: string): Promise<SearchResult[]> {
|
|
463
|
-
const results = await Promise.all(
|
|
464
|
-
this.peers.map(p => p.search(query))
|
|
465
|
-
);
|
|
466
|
-
return this.mergeAndDedup(results);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
// Discover : trouver de nouveaux noeuds
|
|
470
|
-
async discoverNodes(): Promise<RpcNode[]> {
|
|
471
|
-
// Pour l'instant: config statique
|
|
472
|
-
// Futur: DNS-based discovery ou DHT
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
### 4.2 Agent Mobility (Futur)
|
|
478
|
-
|
|
479
|
-
```typescript
|
|
480
|
-
// Un agent peut-il migrer entre noeuds ?
|
|
481
|
-
// Oui, si on sérialise son état :
|
|
482
|
-
|
|
483
|
-
interface AgentPackage {
|
|
484
|
-
name: string;
|
|
485
|
-
prompt: string;
|
|
486
|
-
config: object;
|
|
487
|
-
memory_snapshot: KnowledgeChunk[]; // top 100 connaissances
|
|
488
|
-
model: string;
|
|
489
|
-
runner: string;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
// Node A → Node B : "Je te délègue sniperbot pour 1h"
|
|
493
|
-
// Node B restaure l'agent localement avec son snapshot mémoire
|
|
494
|
-
```
|
|
495
|
-
|
|
496
|
-
---
|
|
497
|
-
|
|
498
|
-
## 📋 PHASE 5 — Émergence & AGI Signals (3-4 semaines)
|
|
499
|
-
|
|
500
|
-
### 5.1 Pattern Detection Engine
|
|
501
|
-
|
|
502
|
-
```typescript
|
|
503
|
-
// NOUVEAU : src/emergence/PatternDetector.ts
|
|
504
|
-
|
|
505
|
-
class PatternDetector {
|
|
506
|
-
// Surveille les connaissances cross-agents pour détecter
|
|
507
|
-
// des patterns émergents
|
|
508
|
-
|
|
509
|
-
async scanForEmergence(): Promise<EmergenceSignal[]> {
|
|
510
|
-
// 1. Collecter les connaissances récentes de tous les agents
|
|
511
|
-
const recentKnowledge = await this.gatherRecent();
|
|
512
|
-
|
|
513
|
-
// 2. Vector clustering — est-ce que des agents
|
|
514
|
-
// arrivent à des conclusions similaires indépendamment ?
|
|
515
|
-
const clusters = await this.clusterBySimilarity(recentKnowledge);
|
|
516
|
-
|
|
517
|
-
// 3. Convergence detection
|
|
518
|
-
// Si 3+ agents indépendants découvrent la même chose
|
|
519
|
-
// = signal d'émergence
|
|
520
|
-
return clusters
|
|
521
|
-
.filter(c => c.agentDiversity >= 3)
|
|
522
|
-
.map(c => ({
|
|
523
|
-
type: 'convergence',
|
|
524
|
-
topic: c.centroid,
|
|
525
|
-
agents: c.agentNames,
|
|
526
|
-
confidence: c.score,
|
|
527
|
-
timestamp: Date.now()
|
|
528
|
-
}));
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
### 5.2 AGI Signal Scoring
|
|
534
|
-
|
|
535
|
-
```typescript
|
|
536
|
-
interface AGISignal {
|
|
537
|
-
type: 'convergence' | 'novelty' | 'self_modification' | 'cross_domain';
|
|
538
|
-
confidence: number; // 0-1
|
|
539
|
-
agentCount: number; // combien d'agents contribuent
|
|
540
|
-
crossNode: boolean; // span across nodes ?
|
|
541
|
-
novelty: number; // jamais vu avant ?
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
// Score AGI = f(convergence, cross-domain, self-modification, cross-node)
|
|
545
|
-
function calculateAGIScore(signals: AGISignal[]): number {
|
|
546
|
-
const weights = {
|
|
547
|
-
convergence: 0.3,
|
|
548
|
-
cross_domain: 0.3,
|
|
549
|
-
self_modification: 0.2,
|
|
550
|
-
cross_node: 0.2
|
|
551
|
-
};
|
|
552
|
-
// ... scoring logic
|
|
553
|
-
}
|
|
554
|
-
```
|
|
555
|
-
|
|
556
|
-
---
|
|
557
|
-
|
|
558
|
-
## 📅 TIMELINE CONSOLIDÉ
|
|
559
|
-
|
|
560
|
-
| Phase | Durée | Livrables | Priorité |
|
|
561
|
-
|---|---|---|---|
|
|
562
|
-
| **Phase 1** | 2-3 sem | Config multi-source, RpcNode, GossipEngine | 🔴 Haute |
|
|
563
|
-
| **Phase 2** | 2-3 sem | 3 zones mémoire, sync engine | 🔴 Haute |
|
|
564
|
-
| **Phase 3** | 2 sem | Config YAML, auth, PG distant | 🔴 Haute |
|
|
565
|
-
| **Phase 4** | 2 sem | FederationAgent, agent mobility | 🟡 Moyenne |
|
|
566
|
-
| **Phase 5** | 3-4 sem | PatternDetector, AGIScoring | 🟢 Future |
|
|
567
|
-
|
|
568
|
-
**Total estimé** : 11-14 semaines pour le full stack.
|
|
569
|
-
|
|
570
|
-
**MVP (Phases 1-3)** : 6-8 semaines = 2 noeuds qui communiquent avec mémoire sync.
|
|
571
|
-
|
|
572
|
-
---
|
|
573
|
-
|
|
574
|
-
## ⚠️ PIÈGES IDENTIFIÉS
|
|
575
|
-
|
|
576
|
-
### Mémoire
|
|
577
|
-
1. **"overmind_core" est vide en pratique** — Personne n'y écrit. Il faut un mécanisme auto-push.
|
|
578
|
-
2. **Embedding Qwen 8B = 4096D** — Trop grand pour HNSW (>2000D). Le code fallback sur SeqScan. OK pour 2 noeuds mais pas scalable à 100+.
|
|
579
|
-
3. **Pas de garbage collection** — Les knowledge_chunks s'accumulent sans limite.
|
|
580
|
-
|
|
581
|
-
### RPC
|
|
582
|
-
4. **localhost seulement** — BridgeProxy hardcode `localhost:3099`. Faut rendre configurable.
|
|
583
|
-
5. **Pas d'auth** — Aucune sécurité sur le MCP server. N'importe qui peut interroger.
|
|
584
|
-
6. **Pas de retry distribué** — Si le noeud B est down, A ne sait pas retry.
|
|
585
|
-
|
|
586
|
-
### Réseau
|
|
587
|
-
7. **NAT/Firewall** — Si Machine B est derrière un NAT, faut port-forward ou VPN.
|
|
588
|
-
8. **Latence** — HTTP RPC sur Internet = 50-200ms par appel. Acceptable pour sync, trop lent pour inference.
|
|
589
|
-
9. **Split brain** — Si les 2 noeuds perdent connexion, ils divergent. Faut merge conflict resolution.
|
|
590
|
-
|
|
591
|
-
---
|
|
592
|
-
|
|
593
|
-
## 🎯 PROCHAINES ÉTAPES IMMÉDIATES
|
|
594
|
-
|
|
595
|
-
1. **Valider ce plan** — Feedback du chef
|
|
596
|
-
2. **Créer la branche git** `feature/network-refactor`
|
|
597
|
-
3. **Phase 1.1** — Refactor `PostgresMemoryProvider` pour accepter config dynamique
|
|
598
|
-
4. **Phase 1.2** — Créer `RpcNode.ts` avec config YAML
|
|
599
|
-
5. **Test local** — 2 instances Overmind sur la même machine, ports différents
|
|
600
|
-
6. **Test distant** — Déployer sur 2 machines réelles
|
|
601
|
-
|
|
602
|
-
---
|
|
603
|
-
|
|
604
|
-
*Ce plan est vivant. Il sera mis à jour au fur et à mesure de l'avancement.*
|
|
605
|
-
|
|
606
|
-
*— Sniperbot Analyst, Juin 2026*
|