diff --git a/README.md b/README.md index df73a94..c62d5a8 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ Works **alongside** `memory-core` (OpenClaw's built-in memory) β€” doesn't replace it. -## Demo +## 🎬 Demo -Try the interactive demo to see Cortex in action: +Try the interactive demo β€” it simulates a real bilingual dev conversation and shows every Cortex feature in action: ```bash git clone https://github.com/alberthild/openclaw-cortex.git @@ -27,38 +27,155 @@ cd openclaw-cortex && npm install npx tsx demo/demo.ts ``` -The demo simulates a bilingual (EN/DE) developer conversation and shows: +### What the demo shows -- **🧡 Thread Tracking** β€” 3 threads detected, 1 auto-closed via "done βœ…" -- **🎯 Decision Extraction** β€” 4 decisions found ("decided", "the plan is", "beschlossen") -- **πŸ˜€β†’πŸ”₯ Mood Detection** β€” tracks emotional arc from frustrated to excited -- **πŸ“Έ Pre-Compaction Snapshot** β€” saves full conversation state before memory loss -- **πŸ“‹ Boot Context** β€” generates a dense BOOTSTRAP.md briefing (~800 tokens) - -
-πŸ“Έ Sample output +A 13-message conversation between a developer (Albert) and an AI assistant (Claudia) covering 3 topics in English and German. Cortex processes every message in real-time: ``` -━━━ Phase 2: Thread Tracking Results ━━━ +πŸ‘€ Albert: Let's get back to the auth migration. We need to switch from JWT to OAuth2. +πŸ€– Claudia: I'll start with the token validation layer. The plan is to keep backward compatibility for 2 weeks. +πŸ‘€ Albert: Agreed. We decided to use Auth0 as the provider. +πŸ‘€ Albert: Also, jetzt zu dem Performance-Bug. Die API braucht 3 Sekunden fΓΌr simple Queries. +πŸ€– Claudia: Ich hab den Profiler laufen lassen. Das Problem ist der N+1 Query im User-Resolver. +πŸ‘€ Albert: Mist, das ist nervig. Wir brauchen das bis Freitag gefixt. +πŸ€– Claudia: Wir machen Batched DataLoader. +πŸ‘€ Albert: Beschlossen. Und wir warten auf den Review von Alexey bevor wir deployen. +πŸ€– Claudia: Auth migration is done βœ… All tests green, backward compat verified. +πŸ‘€ Albert: Nice! Perfekt gelaufen. πŸš€ +πŸ‘€ Albert: Now about the Kubernetes cluster β€” we need to plan the migration from Docker Compose. +πŸ€– Claudia: I'll draft an architecture doc. Waiting for the cost estimate from Hetzner first. +πŸ‘€ Albert: Guter Fortschritt heute. Lass uns morgen mit dem K8s-Plan weitermachen. +``` - Found 3 threads (2 open, 1 closed) +
+🧡 Thread Tracking β€” 3 threads detected, 1 auto-closed - β—‹ 🟠 the auth migration β†’ closed (detected "done βœ…") - ● 🟑 dem Performance-Bug β†’ open, mood: frustrated - ● 🟑 the Kubernetes cluster β†’ open, waiting for Hetzner estimate +``` +Found 3 threads (2 open, 1 closed) -━━━ Phase 3: Decision Extraction ━━━ + β—‹ 🟠 the auth migration + Status: closed ← detected "done βœ…" as closure signal + Priority: high + Mood: neutral - Extracted 4 decisions: + ● 🟑 dem Performance-Bug + Status: open + Priority: medium + Mood: neutral - 🎯 The plan is to keep backward compatibility for 2 weeks [medium] - 🎯 We decided to use Auth0 as the provider [medium] - 🎯 Wir machen Batched DataLoader [medium] - 🎯 Beschlossen β€” warten auf Review von Alexey [high: deploy] + ● 🟑 the Kubernetes cluster + Status: open + Priority: medium + Mood: neutral + Waiting for: cost estimate from Hetzner ```
+
+🎯 Decision Extraction β€” 4 decisions found across 2 languages + +``` + 🎯 The plan is to keep backward compatibility for 2 weeks + Impact: medium | Who: claudia + + 🎯 We decided to use Auth0 as the provider + Impact: medium | Who: albert + + 🎯 Wir machen Batched DataLoader + Impact: medium | Who: claudia + + 🎯 Beschlossen. Und wir warten auf den Review von Alexey bevor wir deployen. + Impact: high | Who: albert +``` + +Trigger patterns: `"the plan is"`, `"we decided"`, `"wir machen"`, `"beschlossen"` + +
+ +
+πŸ”₯ Mood Detection β€” session mood tracked from patterns + +``` + Session mood: πŸ”₯ excited + (Detected from "Nice!", "Perfekt gelaufen", "πŸš€") +``` + +Supported moods: `frustrated` 😀 Β· `excited` πŸ”₯ Β· `tense` ⚑ Β· `productive` πŸ”§ Β· `exploratory` πŸ”¬ Β· `neutral` 😐 + +
+ +
+πŸ“Έ Pre-Compaction Snapshot β€” saves state before memory loss + +``` + Success: yes + Messages snapshotted: 13 + Warnings: none + + Hot Snapshot (memory/reboot/hot-snapshot.md): + # Hot Snapshot β€” 2026-02-17 + ## Last conversation before compaction + + **Recent messages:** + - [user] Let's get back to the auth migration... + - [assistant] I'll start with the token validation layer... + - [user] Agreed. We decided to use Auth0 as the provider. + - [user] Also, jetzt zu dem Performance-Bug... + - ... +``` + +
+ +
+πŸ“‹ Boot Context (BOOTSTRAP.md) β€” ~786 tokens, ready for next session + +```markdown +# Context Briefing +Generated: 2026-02-17 | Local: 12:30 + +## ⚑ State +Mode: Afternoon β€” execution mode +Last session mood: excited πŸ”₯ + +## πŸ“– Narrative (last 24h) +**Completed:** +- βœ… the auth migration: Topic detected from albert + +**Open:** +- 🟑 dem Performance-Bug: Topic detected from albert +- 🟑 the Kubernetes cluster: Topic detected from albert + +**Decisions:** +- 🎯 The plan is to keep backward compatibility for 2 weeks (claudia) +- 🎯 We decided to use Auth0 as the provider (albert) +- 🎯 Wir machen Batched DataLoader (claudia) +- 🎯 Beschlossen. Warten auf Review von Alexey (albert) +``` + +Total: 3,143 chars Β· ~786 tokens Β· regenerated every session start + +
+ +
+πŸ“ Generated Files + +``` +{workspace}/ +β”œβ”€β”€ BOOTSTRAP.md 3,143 bytes +└── memory/reboot/ + β”œβ”€β”€ threads.json 1,354 bytes + β”œβ”€β”€ decisions.json 1,619 bytes + β”œβ”€β”€ narrative.md 866 bytes + └── hot-snapshot.md 1,199 bytes +``` + +All plain JSON + Markdown. No database, no external dependencies. + +
+ +> πŸ“ Full raw output: [`demo/SAMPLE-OUTPUT.md`](demo/SAMPLE-OUTPUT.md) + ## Install ```bash diff --git a/package-lock.json b/package-lock.json index db8c50e..79940a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@vainplex/openclaw-cortex", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@vainplex/openclaw-cortex", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "devDependencies": { "@types/node": "^22.0.0", diff --git a/package.json b/package.json index b20bb42..831b8dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vainplex/openclaw-cortex", - "version": "0.1.1", + "version": "0.1.2", "description": "OpenClaw plugin: conversation intelligence β€” thread tracking, decision extraction, boot context, pre-compaction snapshots", "type": "module", "main": "dist/index.js", @@ -27,7 +27,8 @@ "openclaw": { "extensions": [ "./dist/index.js" - ] + ], + "id": "openclaw-cortex" }, "keywords": [ "openclaw",