@vainplex/openclaw-cortex 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/openclaw.plugin.json +184 -2
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vainplex/openclaw-cortex
|
|
2
2
|
|
|
3
|
-
> Conversation intelligence layer for [OpenClaw](https://github.com/openclaw/openclaw) — automated thread tracking, decision extraction, boot context generation,
|
|
3
|
+
> Conversation intelligence layer for [OpenClaw](https://github.com/openclaw/openclaw) — automated thread tracking, decision extraction, boot context generation, pre-compaction snapshots, and trace analysis.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@vainplex/openclaw-cortex)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
- **🚀 Generates boot context** — assembles a dense `BOOTSTRAP.md` at session start so the agent has continuity
|
|
15
15
|
- **📸 Pre-compaction snapshots** — saves thread state + hot snapshot before memory compaction
|
|
16
16
|
- **📖 Structured narratives** — generates 24h activity summaries from threads + decisions
|
|
17
|
+
- **🔍 Trace Analyzer** — 3-stage pipeline that detects failure signals, classifies findings with LLM triage, and generates PII-redacted reports
|
|
17
18
|
|
|
18
19
|
Works **alongside** `memory-core` (OpenClaw's built-in memory) — doesn't replace it.
|
|
19
20
|
|
|
@@ -393,11 +394,108 @@ The LLM sees a conversation snippet (configurable batch size) and returns:
|
|
|
393
394
|
- Hook errors → caught and logged, never crashes the gateway
|
|
394
395
|
- LLM timeout/error → falls back to regex-only, no data loss
|
|
395
396
|
|
|
397
|
+
## Trace Analyzer (v0.4.0)
|
|
398
|
+
|
|
399
|
+
The Trace Analyzer is a **3-stage pipeline** that processes NATS event streams to detect failure patterns in AI agent conversations. It reconstructs conversation chains, runs signal detection, classifies findings with an optional LLM triage step, applies PII redaction, and generates structured reports.
|
|
400
|
+
|
|
401
|
+
### 3-Stage Pipeline
|
|
402
|
+
|
|
403
|
+
```
|
|
404
|
+
Stage 1: Ingest + Reconstruct
|
|
405
|
+
NATS events → normalize → chain reconstruction (gap-based splitting)
|
|
406
|
+
|
|
407
|
+
Stage 2: Signal Detection + Classification
|
|
408
|
+
chains → 7 signal detectors (multi-language) → LLM triage (optional) → classified findings
|
|
409
|
+
|
|
410
|
+
Stage 3: Redaction + Output
|
|
411
|
+
findings → PII redaction → report assembly → Markdown/JSON output
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### 7 Signal Detectors
|
|
415
|
+
|
|
416
|
+
| Signal ID | Detects | Default |
|
|
417
|
+
|-----------|---------|---------|
|
|
418
|
+
| `SIG-CORRECTION` | User correcting the agent after a wrong response | ✅ enabled |
|
|
419
|
+
| `SIG-TOOL-FAIL` | Tool/function call failures and error responses | ✅ enabled |
|
|
420
|
+
| `SIG-DOOM-LOOP` | Agent stuck in repetitive retry loops | ✅ enabled |
|
|
421
|
+
| `SIG-DISSATISFIED` | User expressing frustration or dissatisfaction | ✅ enabled |
|
|
422
|
+
| `SIG-REPEAT-FAIL` | Same failure pattern recurring across sessions | ✅ enabled |
|
|
423
|
+
| `SIG-HALLUCINATION` | Agent making claims contradicted by tool output | ✅ enabled |
|
|
424
|
+
| `SIG-UNVERIFIED-CLAIM` | Agent stating facts without tool verification | ❌ disabled |
|
|
425
|
+
|
|
426
|
+
Each detector supports **multi-language signal patterns** — the same 10 languages as the core pattern engine (EN, DE, FR, ES, PT, IT, ZH, JA, KO, RU).
|
|
427
|
+
|
|
428
|
+
### Configuration
|
|
429
|
+
|
|
430
|
+
Add a `traceAnalyzer` section to your external config (`~/.openclaw/plugins/openclaw-cortex/config.json`):
|
|
431
|
+
|
|
432
|
+
```json
|
|
433
|
+
{
|
|
434
|
+
"traceAnalyzer": {
|
|
435
|
+
"enabled": true,
|
|
436
|
+
"nats": {
|
|
437
|
+
"url": "nats://localhost:4222",
|
|
438
|
+
"stream": "openclaw-events",
|
|
439
|
+
"subjectPrefix": "openclaw.events"
|
|
440
|
+
},
|
|
441
|
+
"schedule": {
|
|
442
|
+
"enabled": true,
|
|
443
|
+
"intervalHours": 24
|
|
444
|
+
},
|
|
445
|
+
"signals": {
|
|
446
|
+
"SIG-UNVERIFIED-CLAIM": { "enabled": true, "severity": "medium" }
|
|
447
|
+
},
|
|
448
|
+
"llm": {
|
|
449
|
+
"enabled": true,
|
|
450
|
+
"endpoint": "http://localhost:11434/v1",
|
|
451
|
+
"model": "mistral:7b"
|
|
452
|
+
},
|
|
453
|
+
"output": {
|
|
454
|
+
"maxFindings": 200,
|
|
455
|
+
"reportPath": "./reports/trace-analysis.md"
|
|
456
|
+
},
|
|
457
|
+
"redactPatterns": ["\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b"]
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
| Setting | Default | Description |
|
|
463
|
+
|---------|---------|-------------|
|
|
464
|
+
| `enabled` | `false` | Master switch for trace analysis |
|
|
465
|
+
| `nats.url` | `nats://localhost:4222` | NATS server URL |
|
|
466
|
+
| `nats.stream` | `openclaw-events` | JetStream stream name |
|
|
467
|
+
| `schedule.enabled` | `false` | Enable scheduled analysis runs |
|
|
468
|
+
| `schedule.intervalHours` | `24` | Hours between runs |
|
|
469
|
+
| `chainGapMinutes` | `30` | Inactivity gap for chain boundary detection |
|
|
470
|
+
| `llm.enabled` | `false` | Enable LLM-powered finding classification |
|
|
471
|
+
| `llm.triage` | — | Optional fast/local model for pre-filtering |
|
|
472
|
+
| `output.maxFindings` | `200` | Maximum findings per report |
|
|
473
|
+
| `output.reportPath` | — | Custom report output path |
|
|
474
|
+
| `redactPatterns` | `[]` | Regex patterns for PII redaction |
|
|
475
|
+
|
|
476
|
+
### Programmatic API
|
|
477
|
+
|
|
478
|
+
The trace analyzer is fully exported for programmatic use:
|
|
479
|
+
|
|
480
|
+
```typescript
|
|
481
|
+
import {
|
|
482
|
+
TraceAnalyzer,
|
|
483
|
+
createNatsTraceSource,
|
|
484
|
+
reconstructChains,
|
|
485
|
+
detectAllSignals,
|
|
486
|
+
classifyFindings,
|
|
487
|
+
redactChain,
|
|
488
|
+
assembleReport,
|
|
489
|
+
generateOutputs,
|
|
490
|
+
resolveTraceAnalyzerConfig,
|
|
491
|
+
} from "@vainplex/openclaw-cortex";
|
|
492
|
+
```
|
|
493
|
+
|
|
396
494
|
## Development
|
|
397
495
|
|
|
398
496
|
```bash
|
|
399
497
|
npm install
|
|
400
|
-
npm test #
|
|
498
|
+
npm test # 850 tests
|
|
401
499
|
npm run typecheck # TypeScript strict mode
|
|
402
500
|
npm run build # Compile to dist/
|
|
403
501
|
```
|
|
@@ -409,7 +507,7 @@ npm run build # Compile to dist/
|
|
|
409
507
|
- LLM enhancement: async, batched, fire-and-forget (never blocks hooks)
|
|
410
508
|
- Atomic file writes via `.tmp` + rename
|
|
411
509
|
- Noise filter prevents garbage threads from polluting state
|
|
412
|
-
- Tested with
|
|
510
|
+
- Tested with 850 unit + integration tests
|
|
413
511
|
|
|
414
512
|
## Architecture
|
|
415
513
|
|
|
@@ -426,6 +524,6 @@ All plugins live in one monorepo: [alberthild/vainplex-openclaw](https://github.
|
|
|
426
524
|
| # | Plugin | Version | Description |
|
|
427
525
|
|---|--------|---------|-------------|
|
|
428
526
|
| 1 | [@vainplex/nats-eventstore](https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-nats-eventstore) | 0.2.1 | NATS JetStream event persistence + audit trail |
|
|
429
|
-
| 2 | **@vainplex/openclaw-cortex** | **0.
|
|
430
|
-
| 3 | [@vainplex/openclaw-knowledge-engine](https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-knowledge-engine) | 0.1.
|
|
431
|
-
| 4 | [@vainplex/openclaw-governance](https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-governance) | 0.3.
|
|
527
|
+
| 2 | **@vainplex/openclaw-cortex** | **0.4.0** | Conversation intelligence — threads, decisions, boot context, trace analysis, 10 languages (this plugin) |
|
|
528
|
+
| 3 | [@vainplex/openclaw-knowledge-engine](https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-knowledge-engine) | 0.1.4 | Real-time fact extraction from conversations |
|
|
529
|
+
| 4 | [@vainplex/openclaw-governance](https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-governance) | 0.3.2 | Policy-as-code — trust scoring, audit trail, production safeguards |
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,gBAAgB,CAAC;AAGrE,cAAc,+BAA+B,CAAC;AAE9C,QAAA,MAAM,MAAM;;;;;kBAOI,iBAAiB;CA8ChC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@ import { registerCortexHooks } from "./src/hooks.js";
|
|
|
2
2
|
import { resolveWorkspace } from "./src/config.js";
|
|
3
3
|
import { loadConfig } from "./src/config-loader.js";
|
|
4
4
|
import { loadJson, rebootDir } from "./src/storage.js";
|
|
5
|
+
// ---- Trace Analyzer public API re-export ----
|
|
6
|
+
export * from "./src/trace-analyzer/index.js";
|
|
5
7
|
const plugin = {
|
|
6
8
|
id: "openclaw-cortex",
|
|
7
9
|
name: "OpenClaw Cortex",
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|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AY,OAAO,EAAE;yBACtB,CAAC,IAAI,CAAC,IAAI,CAAC;qBACb,CAAC;gBACJ,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,EAAE,IAAI,EAAE,4CAA4C,EAAE,CAAC;gBAChE,CAAC;YACH,CAAC;SACF,CAAC,CAAC;QAEH,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACpC,CAAC;CACF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/openclaw.plugin.json
CHANGED
|
@@ -146,10 +146,11 @@
|
|
|
146
146
|
"enum": [
|
|
147
147
|
"en",
|
|
148
148
|
"de",
|
|
149
|
-
"both"
|
|
149
|
+
"both",
|
|
150
|
+
"all"
|
|
150
151
|
],
|
|
151
152
|
"default": "both",
|
|
152
|
-
"description": "Language for regex pattern matching: English, German, or
|
|
153
|
+
"description": "Language for regex pattern matching: English, German, both, or all 10 languages"
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
},
|
|
@@ -193,6 +194,187 @@
|
|
|
193
194
|
"description": "Number of messages to buffer before calling the LLM"
|
|
194
195
|
}
|
|
195
196
|
}
|
|
197
|
+
},
|
|
198
|
+
"traceAnalyzer": {
|
|
199
|
+
"type": "object",
|
|
200
|
+
"additionalProperties": false,
|
|
201
|
+
"description": "Trace Analyzer — 3-stage pipeline for detecting failure signals in NATS event streams",
|
|
202
|
+
"properties": {
|
|
203
|
+
"enabled": {
|
|
204
|
+
"type": "boolean",
|
|
205
|
+
"default": false,
|
|
206
|
+
"description": "Master switch for trace analysis"
|
|
207
|
+
},
|
|
208
|
+
"nats": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"additionalProperties": false,
|
|
211
|
+
"properties": {
|
|
212
|
+
"url": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"default": "nats://localhost:4222",
|
|
215
|
+
"description": "NATS server URL"
|
|
216
|
+
},
|
|
217
|
+
"stream": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"default": "openclaw-events",
|
|
220
|
+
"description": "JetStream stream name"
|
|
221
|
+
},
|
|
222
|
+
"subjectPrefix": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"default": "openclaw.events",
|
|
225
|
+
"description": "NATS subject prefix"
|
|
226
|
+
},
|
|
227
|
+
"credentials": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"description": "Optional NATS credentials file path"
|
|
230
|
+
},
|
|
231
|
+
"user": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"description": "Optional NATS user"
|
|
234
|
+
},
|
|
235
|
+
"password": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"description": "Optional NATS password"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"schedule": {
|
|
242
|
+
"type": "object",
|
|
243
|
+
"additionalProperties": false,
|
|
244
|
+
"properties": {
|
|
245
|
+
"enabled": {
|
|
246
|
+
"type": "boolean",
|
|
247
|
+
"default": false,
|
|
248
|
+
"description": "Enable scheduled analysis runs"
|
|
249
|
+
},
|
|
250
|
+
"intervalHours": {
|
|
251
|
+
"type": "integer",
|
|
252
|
+
"minimum": 1,
|
|
253
|
+
"maximum": 168,
|
|
254
|
+
"default": 24,
|
|
255
|
+
"description": "Hours between scheduled runs"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"chainGapMinutes": {
|
|
260
|
+
"type": "integer",
|
|
261
|
+
"minimum": 1,
|
|
262
|
+
"maximum": 120,
|
|
263
|
+
"default": 30,
|
|
264
|
+
"description": "Inactivity gap in minutes for chain boundary detection"
|
|
265
|
+
},
|
|
266
|
+
"signals": {
|
|
267
|
+
"type": "object",
|
|
268
|
+
"description": "Per-signal toggles and severity overrides",
|
|
269
|
+
"additionalProperties": {
|
|
270
|
+
"type": "object",
|
|
271
|
+
"properties": {
|
|
272
|
+
"enabled": {
|
|
273
|
+
"type": "boolean"
|
|
274
|
+
},
|
|
275
|
+
"severity": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"enum": ["low", "medium", "high", "critical"]
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"llm": {
|
|
283
|
+
"type": "object",
|
|
284
|
+
"additionalProperties": false,
|
|
285
|
+
"description": "LLM config for trace analysis finding classification",
|
|
286
|
+
"properties": {
|
|
287
|
+
"enabled": {
|
|
288
|
+
"type": "boolean",
|
|
289
|
+
"default": false,
|
|
290
|
+
"description": "Enable LLM-powered finding classification"
|
|
291
|
+
},
|
|
292
|
+
"endpoint": {
|
|
293
|
+
"type": "string",
|
|
294
|
+
"description": "OpenAI-compatible API endpoint"
|
|
295
|
+
},
|
|
296
|
+
"model": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"description": "Model identifier"
|
|
299
|
+
},
|
|
300
|
+
"apiKey": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"description": "API key (optional)"
|
|
303
|
+
},
|
|
304
|
+
"timeoutMs": {
|
|
305
|
+
"type": "integer",
|
|
306
|
+
"minimum": 1000,
|
|
307
|
+
"maximum": 120000,
|
|
308
|
+
"description": "Timeout per LLM call in milliseconds"
|
|
309
|
+
},
|
|
310
|
+
"triage": {
|
|
311
|
+
"type": "object",
|
|
312
|
+
"additionalProperties": false,
|
|
313
|
+
"description": "Optional fast/local triage model for pre-filtering",
|
|
314
|
+
"properties": {
|
|
315
|
+
"endpoint": {
|
|
316
|
+
"type": "string"
|
|
317
|
+
},
|
|
318
|
+
"model": {
|
|
319
|
+
"type": "string"
|
|
320
|
+
},
|
|
321
|
+
"apiKey": {
|
|
322
|
+
"type": "string"
|
|
323
|
+
},
|
|
324
|
+
"timeoutMs": {
|
|
325
|
+
"type": "integer",
|
|
326
|
+
"minimum": 1000,
|
|
327
|
+
"maximum": 60000
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
"output": {
|
|
334
|
+
"type": "object",
|
|
335
|
+
"additionalProperties": false,
|
|
336
|
+
"properties": {
|
|
337
|
+
"maxFindings": {
|
|
338
|
+
"type": "integer",
|
|
339
|
+
"minimum": 1,
|
|
340
|
+
"maximum": 1000,
|
|
341
|
+
"default": 200,
|
|
342
|
+
"description": "Maximum findings in a single report"
|
|
343
|
+
},
|
|
344
|
+
"reportPath": {
|
|
345
|
+
"type": "string",
|
|
346
|
+
"description": "Custom report output path"
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
"redactPatterns": {
|
|
351
|
+
"type": "array",
|
|
352
|
+
"items": { "type": "string" },
|
|
353
|
+
"default": [],
|
|
354
|
+
"description": "Regex patterns for PII redaction before LLM/disk writes"
|
|
355
|
+
},
|
|
356
|
+
"incrementalContextWindow": {
|
|
357
|
+
"type": "integer",
|
|
358
|
+
"minimum": 50,
|
|
359
|
+
"maximum": 5000,
|
|
360
|
+
"default": 500,
|
|
361
|
+
"description": "Context window size for incremental processing"
|
|
362
|
+
},
|
|
363
|
+
"fetchBatchSize": {
|
|
364
|
+
"type": "integer",
|
|
365
|
+
"minimum": 10,
|
|
366
|
+
"maximum": 5000,
|
|
367
|
+
"default": 500,
|
|
368
|
+
"description": "NATS consumer batch size for fetching events"
|
|
369
|
+
},
|
|
370
|
+
"maxEventsPerRun": {
|
|
371
|
+
"type": "integer",
|
|
372
|
+
"minimum": 100,
|
|
373
|
+
"maximum": 1000000,
|
|
374
|
+
"default": 100000,
|
|
375
|
+
"description": "Maximum events to process per run"
|
|
376
|
+
}
|
|
377
|
+
}
|
|
196
378
|
}
|
|
197
379
|
}
|
|
198
380
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vainplex/openclaw-cortex",
|
|
3
|
-
"version": "0.4.
|
|
4
|
-
"description": "OpenClaw plugin: conversation intelligence — thread tracking, decision extraction, boot context, pre-compaction snapshots",
|
|
3
|
+
"version": "0.4.1",
|
|
4
|
+
"description": "OpenClaw plugin: conversation intelligence — thread tracking, decision extraction, boot context, pre-compaction snapshots, trace analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -37,7 +37,10 @@
|
|
|
37
37
|
"memory",
|
|
38
38
|
"thread-tracking",
|
|
39
39
|
"boot-context",
|
|
40
|
-
"conversation-intelligence"
|
|
40
|
+
"conversation-intelligence",
|
|
41
|
+
"trace-analyzer",
|
|
42
|
+
"signal-detection",
|
|
43
|
+
"conversation-analysis"
|
|
41
44
|
],
|
|
42
45
|
"license": "MIT",
|
|
43
46
|
"repository": {
|
|
@@ -45,6 +48,6 @@
|
|
|
45
48
|
"url": "https://github.com/alberthild/vainplex-openclaw.git",
|
|
46
49
|
"directory": "packages/openclaw-cortex"
|
|
47
50
|
},
|
|
48
|
-
"homepage": "https://github.com/alberthild/openclaw-cortex
|
|
51
|
+
"homepage": "https://github.com/alberthild/vainplex-openclaw/tree/main/packages/openclaw-cortex",
|
|
49
52
|
"author": "Albert Hild <a.hild@vainplex.de>"
|
|
50
53
|
}
|