hyperstack-core 1.3.0 → 1.5.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/SKILL.md CHANGED
@@ -1,49 +1,74 @@
1
1
  ---
2
- name: hyperstack
3
- description: "Typed graph memory for multi-agent coordination. Replace GOALS.md + DECISIONS.md with queryable cards and relations. Ask 'what blocks task X?' and get exact answers, not text blobs."
2
+ name: HyperStack — Memory Hub for AI Agents
3
+ description: "The Memory Hub for AI agents deterministic, typed, temporal graph memory with trust propagation, safety constraints, and decision replay. Ask 'what blocks deploy?' exact typed answer. Git-style branching. Episodic/semantic/working memory APIs. Decision replay with hindsight bias detection. Utility-weighted edges that self-improve from agent feedback. Agent identity + trust scoring. Time-travel to any past graph state. Works in Cursor, Claude Desktop, LangGraph, any MCP client. Self-hostable. $0 per operation at any scale."
4
4
  user-invocable: true
5
5
  homepage: https://cascadeai.dev/hyperstack
6
6
  metadata:
7
7
  openclaw:
8
- emoji: "🃏"
8
+ emoji: "🧠"
9
9
  requires:
10
10
  env:
11
11
  - HYPERSTACK_API_KEY
12
+ - HYPERSTACK_WORKSPACE
12
13
  primaryEnv: HYPERSTACK_API_KEY
13
14
  ---
14
15
 
15
- # HyperStack — Typed Graph Memory for Multi-Agent Coordination
16
+ # HyperStack — Memory Hub for AI Agents
16
17
 
17
18
  ## What this does
18
19
 
19
- Replaces markdown-file coordination (GOALS.md, DECISIONS.md, WORKING.md) with a typed knowledge graph that any agent can query.
20
+ HyperStack is the Memory Hub for AI agents. Typed graph memory with three distinct memory surfaces, decision replay, utility-weighted edges that self-improve from feedback, and full provenance on every card. The only memory layer where agents can verify what they know, trace why they know it, and coordinate without an LLM in the loop.
20
21
 
21
- **Before** (current OpenClaw multi-agent):
22
+ **The problem it solves:**
22
23
  ```
23
- # DECISIONS.md (append-only)
24
- - 2026-02-15: Use Clerk for auth (coder-agent)
25
- - 2026-02-16: Migration blocks production deploy (ops-agent)
24
+ # DECISIONS.md (what everyone uses today)
25
+ - 2026-02-15: Use Clerk for auth
26
+ - 2026-02-16: Migration blocks deploy
27
+ "What breaks if auth changes?" → grep → manual → fragile
26
28
  ```
27
- "What blocks deploy?" → `grep -r "blocks.*deploy" *.md` → manual, fragile
28
29
 
29
- **After** (HyperStack):
30
+ **What you get instead:**
30
31
  ```
31
- "What blocks deploy?" → hs_blockers deploy-prod → [migration-23] Auth migration to Clerk
32
+ "What breaks if auth changes?" hs_impact use-clerk [auth-api, deploy-prod, billing-v2]
33
+ "What blocks deploy?" → hs_blockers deploy-prod → [migration-23]
34
+ "What's related to stripe?" → hs_recommend use-stripe → scored list
35
+ "Anything about auth?" → hs_smart_search → auto-routed
36
+ "Fork memory for experiment" → hs_fork → branch workspace
37
+ "What changed in the branch?" → hs_diff → added/changed/deleted
38
+ "Trust this agent?" → hs_profile → trustScore: 0.84
39
+ "Why did we make this call?" → mode=replay → decision timeline + hindsight flags
40
+ "Show episodic memory" → memoryType=episodic → decay-scored event traces
41
+ "Did this card help agents?" → hs_feedback outcome=success → utility score updated
32
42
  ```
33
43
 
34
- Typed relations. Exact answers. Zero LLM cost.
44
+ Typed relations. Exact answers. Zero LLM cost. Works across Cursor, Claude Desktop, LangGraph, any MCP client simultaneously.
35
45
 
36
- ## Tools
46
+ ---
37
47
 
38
- ### hs_search
39
- Search the shared knowledge graph.
48
+ ## Tools (15 total)
49
+
50
+ ### hs_smart_search ✨ Recommended starting point
51
+ Agentic RAG — automatically routes to the best retrieval mode. Use this when unsure which tool to call.
40
52
  ```
41
- hs_search({ query: "authentication setup" })
53
+ hs_smart_search({ query: "what depends on the auth system?" })
54
+ → routed to: impact
55
+ → [auth-api] API Service — via: triggers
56
+ → [billing-v2] Billing v2 — via: depends-on
57
+
58
+ hs_smart_search({ query: "authentication setup" })
59
+ → routed to: search
60
+ → Found 3 memories
61
+
62
+ # Hint a starting slug for better routing
63
+ hs_smart_search({ query: "what breaks if this changes?", slug: "use-clerk" })
42
64
  ```
43
65
 
44
- ### hs_store
45
- Store a card in the graph. Auto-tags with your agent ID.
66
+ ---
67
+
68
+ ### hs_store
69
+ Store or update a card. Supports pinning, TTL scratchpad, trust/provenance, and agent identity stamping.
46
70
  ```
71
+ # Basic store
47
72
  hs_store({
48
73
  slug: "use-clerk",
49
74
  title: "Use Clerk for auth",
@@ -51,10 +76,49 @@ hs_store({
51
76
  type: "decision",
52
77
  links: "auth-api:triggers,alice:decided"
53
78
  })
79
+
80
+ # With trust/provenance
81
+ hs_store({
82
+ slug: "finding-clerk-pricing",
83
+ title: "Clerk pricing confirmed",
84
+ body: "Clerk free tier: 10k MAU. Verified on clerk.com/pricing",
85
+ type: "decision",
86
+ confidence: 0.95,
87
+ truthStratum: "confirmed",
88
+ verifiedBy: "tool:web_search"
89
+ })
90
+
91
+ # Pin — never pruned
92
+ hs_store({ slug: "core-arch", title: "Core Architecture", body: "...", pinned: true })
93
+
94
+ # Scratchpad with TTL — auto-deletes
95
+ hs_store({ slug: "scratch-001", title: "Working memory", body: "...",
96
+ type: "scratchpad", ttl: "2026-02-21T10:00:00Z" })
97
+ ```
98
+
99
+ **Trust/Provenance fields (all optional):**
100
+ | Field | Type | Values | Meaning |
101
+ |-------|------|--------|---------|
102
+ | `confidence` | float | 0.0–1.0 | Writer's self-reported certainty |
103
+ | `truthStratum` | string | `draft` \| `hypothesis` \| `confirmed` | Epistemic status |
104
+ | `verifiedBy` | string | any string | Who/what confirmed this |
105
+ | `verifiedAt` | datetime | — | Auto-set server-side |
106
+ | `sourceAgent` | string | — | Immutable after creation |
107
+
108
+ **Valid cardTypes:** `general`, `person`, `project`, `decision`, `preference`, `workflow`, `event`, `account`, `signal`, `scratchpad`
109
+
110
+ ---
111
+
112
+ ### hs_search
113
+ Hybrid semantic + keyword search across the graph.
114
+ ```
115
+ hs_search({ query: "authentication setup" })
54
116
  ```
55
117
 
118
+ ---
119
+
56
120
  ### hs_decide
57
- Record a decision with full provenance — who decided, what it affects, what it blocks.
121
+ Record a decision with full provenance.
58
122
  ```
59
123
  hs_decide({
60
124
  slug: "use-clerk",
@@ -65,54 +129,629 @@ hs_decide({
65
129
  })
66
130
  ```
67
131
 
132
+ ---
133
+
134
+ ### hs_commit
135
+ Commit a successful agent outcome as a permanent decision card, auto-linked via `decided` relation.
136
+ ```
137
+ hs_commit({
138
+ taskSlug: "task-auth-refactor",
139
+ outcome: "Successfully migrated all auth middleware to Clerk. Zero regressions.",
140
+ title: "Auth Refactor Completed",
141
+ keywords: ["clerk", "auth", "completed"]
142
+ })
143
+ → { committed: true, slug: "commit-task-auth-refactor-...", relation: "decided" }
144
+ ```
145
+
146
+ ---
147
+
148
+ ### hs_feedback ✨ NEW in v1.0.23
149
+ Report whether a set of cards helped an agent succeed or fail. Promotes winners, decays losers. Makes the graph self-improving over time.
150
+ ```
151
+ # Cards that were in context when the task succeeded
152
+ hs_feedback({
153
+ cardSlugs: ["use-clerk", "auth-api", "migration-23"],
154
+ outcome: "success",
155
+ taskId: "task-auth-refactor"
156
+ })
157
+ → { feedback: true, outcome: "success", cardsAffected: 3, edgesUpdated: 5 }
158
+
159
+ # Cards that were in context when the task failed
160
+ hs_feedback({
161
+ cardSlugs: ["wrong-approach"],
162
+ outcome: "failure",
163
+ taskId: "task-auth-refactor"
164
+ })
165
+ → { feedback: true, outcome: "failure", cardsAffected: 1, edgesUpdated: 2 }
166
+ ```
167
+
168
+ **How it works:** Each card's edges carry a `utilityScore`. On success, scores increase. On failure, scores decrease. Over time, cards that consistently help agents rank higher in `?sortBy=utility` queries. The graph learns what's actually useful.
169
+
170
+ **When to call it:** At the end of every agent task — win or lose. Even a few signals per day significantly improve retrieval quality.
171
+
172
+ ---
173
+
174
+ ### hs_prune
175
+ Remove stale cards not updated in N days that aren't referenced by other cards. Always dry-run first.
176
+ ```
177
+ # Preview — safe, no deletions
178
+ hs_prune({ days: 30, dry: true })
179
+ → { dryRun: true, wouldPrune: 3, skipped: 2, cards: [...], protected: [...] }
180
+
181
+ # Execute
182
+ hs_prune({ days: 30 })
183
+ → { pruned: 3, skipped: 2 }
184
+ ```
185
+
186
+ **Safety guarantees:** linked cards never pruned · pinned cards never pruned · TTL cards managed separately
187
+
188
+ ---
189
+
68
190
  ### hs_blockers
69
- Check what blocks a task/card. Returns exact typed blockers, not fuzzy search results.
191
+ Exact typed blockers for a card.
70
192
  ```
71
193
  hs_blockers({ slug: "deploy-prod" })
72
194
  → "1 blocker: [migration-23] Auth migration to Clerk"
73
195
  ```
74
196
 
197
+ ---
198
+
75
199
  ### hs_graph
76
- Traverse the knowledge graph from a starting card. See connections, ownership, dependencies.
200
+ Forward graph traversal. Supports time-travel and utility-weighted sorting.
77
201
  ```
78
202
  hs_graph({ from: "auth-api", depth: 2 })
79
203
  → nodes: [auth-api, use-clerk, migration-23, alice]
80
- → edges: [auth-api→triggers→use-clerk, migration-23→blocks→deploy-prod]
204
+
205
+ # Time-travel — graph at any past moment
206
+ hs_graph({ from: "auth-api", depth: 2, at: "2026-02-15T03:00:00Z" })
207
+
208
+ # Utility-weighted — highest-value edges first
209
+ hs_graph({ from: "auth-api", depth: 2, weightBy: "utility" })
210
+
211
+ # Decision replay — what did agent know when this card was created?
212
+ hs_graph({ from: "use-clerk", mode: "replay" })
213
+ ```
214
+
215
+ ---
216
+
217
+ ### hs_impact
218
+ Reverse traversal — find everything that depends on a card.
81
219
  ```
220
+ hs_impact({ slug: "use-clerk" })
221
+ → "Impact of [use-clerk]: 3 cards depend on this
222
+ [auth-api] API Service — via: triggers
223
+ [billing-v2] Billing v2 — via: depends-on
224
+ [deploy-prod] Production Deploy — via: blocks"
225
+
226
+ # Filter by relation
227
+ hs_impact({ slug: "use-clerk", relation: "depends-on" })
228
+ ```
229
+
230
+ ---
231
+
232
+ ### hs_recommend
233
+ Co-citation scoring — find topically related cards without direct links.
234
+ ```
235
+ hs_recommend({ slug: "use-stripe" })
236
+ → "[billing-v2] Billing v2 — score: 4"
237
+ ```
238
+
239
+ ---
240
+
241
+ ### hs_fork
242
+ Fork a workspace into a branch for safe experimentation. All cards copied. Parent untouched.
243
+ ```
244
+ hs_fork({ branchName: "experiment-v2" })
245
+ → {
246
+ branchWorkspaceId: "clx...",
247
+ branchName: "experiment-v2",
248
+ cardsCopied: 24,
249
+ forkedAt: "2026-02-21T..."
250
+ }
251
+ ```
252
+
253
+ When to use: before risky changes, experiments, or testing new agent reasoning strategies.
254
+
255
+ ---
256
+
257
+ ### hs_diff
258
+ See exactly what changed between a branch and its parent. SQL-driven — deterministic, not fuzzy.
259
+ ```
260
+ hs_diff({ branchWorkspaceId: "clx..." })
261
+ → {
262
+ added: [{ slug: "new-approach", title: "..." }],
263
+ modified: [{ slug: "use-clerk", title: "..." }],
264
+ removed: []
265
+ }
266
+ ```
267
+
268
+ ---
269
+
270
+ ### hs_merge
271
+ Merge branch changes back to parent. Two strategies: `branch-wins` or `parent-wins`.
272
+ ```
273
+ # Branch wins — apply all branch changes to parent
274
+ hs_merge({ branchWorkspaceId: "clx...", strategy: "branch-wins" })
275
+ → { merged: 24, conflicts: 0, strategy: "branch-wins" }
276
+
277
+ # Parent wins — only copy cards that don't exist in parent
278
+ hs_merge({ branchWorkspaceId: "clx...", strategy: "parent-wins" })
279
+ → { merged: 3, conflicts: 21, strategy: "parent-wins" }
280
+ ```
281
+
282
+ ---
283
+
284
+ ### hs_discard
285
+ Discard a branch entirely. Deletes all branch cards and workspace. Parent untouched.
286
+ ```
287
+ hs_discard({ branchWorkspaceId: "clx..." })
288
+ → { discarded: true, branchWorkspaceId: "clx...", parentSlug: "default" }
289
+ ```
290
+
291
+ ---
292
+
293
+ ### hs_identify
294
+ Register this agent with a SHA256 fingerprint. Idempotent — safe to call every session.
295
+ ```
296
+ hs_identify({ agentSlug: "research-agent", displayName: "Research Agent" })
297
+ → {
298
+ registered: true,
299
+ agentSlug: "research-agent",
300
+ fingerprint: "sha256:a3f...",
301
+ trustScore: 0.5
302
+ }
303
+ ```
304
+
305
+ When to use: at the start of every agent session for full provenance tracking.
306
+
307
+ ---
308
+
309
+ ### hs_profile
310
+ Get an agent's trust score. Computed from verified card ratio + activity.
311
+ ```
312
+ hs_profile({ agentSlug: "research-agent" })
313
+ → {
314
+ agentSlug: "research-agent",
315
+ displayName: "Research Agent",
316
+ trustScore: 0.84,
317
+ fingerprint: "sha256:a3f...",
318
+ registeredAt: "...",
319
+ lastActiveAt: "..."
320
+ }
321
+ ```
322
+
323
+ **Trust formula:** `(verifiedCards/totalCards) × 0.7 + min(cardCount/100, 1.0) × 0.3`
324
+
325
+ ---
82
326
 
83
327
  ### hs_my_cards
84
328
  List all cards created by this agent.
85
329
  ```
86
330
  hs_my_cards()
87
- → "3 cards by agent researcher: [finding-clerk-pricing] [finding-auth0-limits] [finding-nextauth-deprecated]"
331
+ → "3 cards by agent researcher: [finding-clerk-pricing] [finding-auth0-limits]"
332
+ ```
333
+
334
+ ---
335
+
336
+ ### hs_ingest
337
+ Auto-extract cards from raw text. Zero LLM cost (regex-based).
338
+ ```
339
+ hs_ingest({ text: "We're using Next.js 14 and PostgreSQL. Alice decided to use Clerk for auth." })
340
+ → "✅ Created 3 cards from 78 chars"
341
+ ```
342
+
343
+ ---
344
+
345
+ ### hs_inbox
346
+ Check for cards directed at this agent by other agents.
347
+ ```
348
+ hs_inbox({})
349
+ → "Inbox for cursor-mcp: 1 card(s)"
350
+ ```
351
+
352
+ ---
353
+
354
+ ### hs_stats (Pro+)
355
+ Token savings and memory usage stats.
356
+ ```
357
+ hs_stats()
358
+ → "Cards: 24 | Tokens stored: 246 | Saving: 94% — $2.07/mo"
88
359
  ```
89
360
 
361
+ ---
362
+
363
+ ## The Memory Hub — Three Memory Surfaces
364
+
365
+ HyperStack exposes three distinct memory APIs backed by the same typed graph. Each has different retention behaviour and decay rules.
366
+
367
+ ### Episodic Memory — what happened and when
368
+ ```
369
+ GET /api/cards?workspace=X&memoryType=episodic
370
+ ```
371
+ - **Cards:** stack=general OR cardType=event — event traces, agent actions
372
+ - **Sort:** createdAt DESC (most recent first)
373
+ - **Retention:** 30-day soft decay
374
+ - 0–7 days → decayScore: 1.0 (fresh)
375
+ - 8–30 days → linear decay to 0.2
376
+ - >30 days → decayScore: 0.1 (stale, not deleted)
377
+ - **Agent bonus:** if sourceAgent is set, decay is halved — useful memories survive longer
378
+ - **Extra fields per card:** `decayScore`, `daysSinceCreated`, `isStale`
379
+ - **Metadata:** `segment: "episodic"`, `retentionPolicy: "30-day-decay"`, `staleCount`
380
+
381
+ ### Semantic Memory — facts and knowledge that never age
382
+ ```
383
+ GET /api/cards?workspace=X&memoryType=semantic
384
+ ```
385
+ - **Cards:** cardType IN (decision, person, project, workflow, preference, account)
386
+ - **Sort:** updatedAt DESC
387
+ - **Retention:** permanent — no decay, no expiry
388
+ - **Extra fields per card:** `confidence`, `truth_stratum`, `verified_by`, `verified_at`, `isVerified`
389
+ - **Metadata:** `segment: "semantic"`, `retentionPolicy: "permanent"`
390
+
391
+ ### Working Memory — active scratchpad, TTL-based
392
+ ```
393
+ GET /api/cards?workspace=X&memoryType=working
394
+ GET /api/cards?workspace=X&memoryType=working&includeExpired=true
395
+ ```
396
+ - **Cards:** ttl IS NOT NULL
397
+ - **Sort:** updatedAt DESC
398
+ - **Retention:** TTL-based auto-expiry. Default hides expired cards.
399
+ - **Agent bonus:** if sourceAgent is set, effective TTL extended 1.5x. Signalled as `ttlExtended: true`.
400
+ - **Extra fields per card:** `ttl`, `expiresAt`, `isExpired`, `ttlExtended`
401
+ - **Metadata:** `segment: "working"`, `retentionPolicy: "ttl-based"`, `expiredCount`
402
+ - TTL formats: `"30m"` · `"24h"` · `"7d"` · `"2w"` · raw milliseconds
403
+
404
+ ---
405
+
406
+ ## Decision Replay
407
+
408
+ Reconstruct exactly what the agent knew when a decision was made. Flags cards that didn't exist at decision time — potential hindsight bias in retrospective analysis.
409
+
410
+ ```
411
+ hs_graph({ from: "use-clerk", mode: "replay" })
412
+ ```
413
+
414
+ Response shape:
415
+ ```json
416
+ {
417
+ "mode": "replay",
418
+ "root": "use-clerk",
419
+ "anchorTime": "2026-02-19T20:59:00Z",
420
+ "knownAtDecision": 1,
421
+ "unknownAtDecision": 1,
422
+ "timeline": [
423
+ {
424
+ "slug": "use-clerk",
425
+ "timing": "decision",
426
+ "modifiedAfterDecision": false
427
+ },
428
+ {
429
+ "slug": "blocker-clerk-migration",
430
+ "timing": "after_decision",
431
+ "modifiedAfterDecision": true
432
+ }
433
+ ],
434
+ "narrative": [
435
+ "Decision: [Use Clerk for Auth] made at 2026-02-19T20:59:00Z",
436
+ "Agent knew 1 of 2 connected cards at decision time.",
437
+ "1 card(s) did not exist when this decision was made: [blocker-clerk-migration]",
438
+ "⚠️ 1 card(s) were modified after the decision (potential hindsight): [blocker-clerk-migration]"
439
+ ]
440
+ }
441
+ ```
442
+
443
+ **Timing values:** `decision` · `prior_knowledge` · `same_day` · `just_before` · `after_decision`
444
+
445
+ **Use cases:** Compliance audits · agent debugging · post-mortems · "what did the agent actually know when it made this call?"
446
+
447
+ ---
448
+
449
+ ## Utility-Weighted Edges
450
+
451
+ Every edge carries a `utilityScore` that updates from agent feedback. Cards that consistently help agents succeed rank higher. Cards that appear in failed tasks decay.
452
+
453
+ ```
454
+ # Retrieve most useful cards first
455
+ GET /api/cards?workspace=X&sortBy=utility
456
+
457
+ # Only high-utility cards
458
+ GET /api/cards?workspace=X&minUtility=0.7
459
+
460
+ # Graph traversal weighted by utility
461
+ GET /api/graph?from=auth-api&weightBy=utility
462
+ ```
463
+
464
+ Feed the loop with `hs_feedback` at the end of every task. The graph gets smarter with every session.
465
+
466
+ ---
467
+
468
+ ## Git-Style Memory Branching
469
+
470
+ Branch your memory workspace like a Git repo. Experiment safely without corrupting live memory.
471
+
472
+ ```
473
+ # 1. Fork before an experiment
474
+ hs_fork({ branchName: "try-new-routing" })
475
+
476
+ # 2. Make changes in the branch
477
+ hs_store({ slug: "new-approach", title: "...", ... })
478
+
479
+ # 3. See what changed
480
+ hs_diff({ branchWorkspaceId: "clx..." })
481
+
482
+ # 4a. Merge if it worked
483
+ hs_merge({ branchWorkspaceId: "clx...", strategy: "branch-wins" })
484
+
485
+ # 4b. Or discard if it didn't
486
+ hs_discard({ branchWorkspaceId: "clx..." })
487
+ ```
488
+
489
+ **Branching requires Pro plan or above.**
490
+
491
+ ---
492
+
493
+ ## Agent Identity + Trust
494
+
495
+ Register agents for full provenance tracking and trust scoring.
496
+
497
+ ```
498
+ # Register at session start (idempotent)
499
+ hs_identify({ agentSlug: "research-agent" })
500
+
501
+ # All subsequent hs_store calls auto-stamp sourceAgent
502
+ hs_store({ slug: "finding-001", ... }) # → auto-linked to research-agent
503
+
504
+ # Check trust score
505
+ hs_profile({ agentSlug: "research-agent" })
506
+ → trustScore: 0.84
507
+ ```
508
+
509
+ **Recommended:** Set `HYPERSTACK_AGENT_SLUG` env var for zero-config auto-identification.
510
+
511
+ ---
512
+
513
+ ## The Ten Graph Modes
514
+
515
+ | Mode | How to use | Question answered |
516
+ |------|------------|-------------------|
517
+ | Smart | `hs_smart_search` | Ask anything — auto-routes |
518
+ | Forward | `hs_graph` | What does this card connect to? |
519
+ | Impact | `hs_impact` | What depends on this? What breaks? |
520
+ | Recommend | `hs_recommend` | What's topically related? |
521
+ | Time-travel | `hs_graph` with `at=` | What did the graph look like then? |
522
+ | Replay | `hs_graph` with `mode=replay` | What did the agent know at decision time? |
523
+ | Utility | `?sortBy=utility` or `?weightBy=utility` | Which cards/edges are most useful? |
524
+ | Prune | `hs_prune` | What stale memory is safe to remove? |
525
+ | Branch diff | `hs_diff` | What changed in this branch? |
526
+ | Trust | `hs_profile` | How trustworthy is this agent? |
527
+
528
+ ---
529
+
530
+ ## Trust & Provenance
531
+
532
+ Every card carries epistemic metadata.
533
+
534
+ ```
535
+ # Store a finding with low confidence
536
+ hs_store({ slug: "finding-latency", body: "p99 latency ~200ms under load",
537
+ confidence: 0.6, truthStratum: "hypothesis" })
538
+
539
+ # After human verification
540
+ hs_store({ slug: "finding-latency", confidence: 0.95,
541
+ truthStratum: "confirmed", verifiedBy: "human:deeq" })
542
+ # → verifiedAt auto-set server-side
543
+ ```
544
+
545
+ **Key rules:**
546
+ - `confidence` is self-reported — display only, never use as hard guardrail
547
+ - `confirmed` = trusted working truth for this workspace, not objective truth
548
+ - `sourceAgent` is immutable — set on creation, never changes
549
+ - `verifiedAt` is server-set — not writable by clients
550
+
551
+ ---
552
+
553
+ ## Full Memory Lifecycle
554
+
555
+ | Memory type | Tool | Behaviour |
556
+ |-------------|------|-----------|
557
+ | Long-term facts | `hs_store` | Permanent, searchable, graph-linked |
558
+ | Working memory | `hs_store` with `ttl=` | Auto-expires after TTL |
559
+ | Outcomes / learning | `hs_commit` | Commits result as decided card |
560
+ | Utility feedback | `hs_feedback` | Promotes useful cards, decays useless ones |
561
+ | Stale cleanup | `hs_prune` | Removes unused cards, preserves graph integrity |
562
+ | Protected facts | `hs_store` with `pinned=true` | Never pruned |
563
+ | Branch experiment | `hs_fork` → `hs_diff` → `hs_merge` / `hs_discard` | Safe experimentation |
564
+ | Episodic view | `memoryType=episodic` | Time-decayed event traces |
565
+ | Semantic view | `memoryType=semantic` | Permanent facts + provenance |
566
+ | Working view | `memoryType=working` | TTL-based scratchpad surface |
567
+
568
+ ---
569
+
90
570
  ## Multi-Agent Setup
91
571
 
92
- Each agent gets its own ID. Cards are auto-tagged so you can see who created what.
572
+ Each agent gets its own ID. Cards auto-tagged for full traceability.
93
573
 
94
574
  Recommended roles:
95
- - **coordinator**: Routes tasks, monitors blockers (`hs_blockers`, `hs_graph`, `hs_decide`)
96
- - **researcher**: Investigates, stores findings (`hs_search`, `hs_store`)
97
- - **builder**: Implements, records tech decisions (`hs_store`, `hs_decide`, `hs_blockers`)
575
+ - **coordinator** `hs_blockers`, `hs_impact`, `hs_graph`, `hs_decide`, `hs_fork`, `hs_merge`
576
+ - **researcher** `hs_search`, `hs_recommend`, `hs_store`, `hs_ingest`, `hs_identify`
577
+ - **builder** `hs_store`, `hs_decide`, `hs_commit`, `hs_blockers`, `hs_fork`, `hs_feedback`
578
+ - **memory-agent** — `hs_prune`, `hs_stats`, `hs_smart_search`, `hs_diff`, `hs_discard`, `hs_feedback`
579
+
580
+ ---
581
+
582
+ ## When to use each tool
583
+
584
+ | Moment | Tool |
585
+ |--------|------|
586
+ | Start of session | `hs_identify` → `hs_smart_search` |
587
+ | Not sure which mode | `hs_smart_search` — auto-routes |
588
+ | New project / onboarding | `hs_ingest` to auto-populate |
589
+ | Decision made | `hs_decide` with rationale and links |
590
+ | Task completed | `hs_commit` + `hs_feedback outcome=success` |
591
+ | Task failed | `hs_feedback outcome=failure` |
592
+ | Task blocked | `hs_store` with `blocks` relation |
593
+ | Before starting work | `hs_blockers` to check dependencies |
594
+ | Before changing a card | `hs_impact` to check blast radius |
595
+ | Before risky experiment | `hs_fork` → work in branch → `hs_merge` or `hs_discard` |
596
+ | Discovery | `hs_recommend` — find related context |
597
+ | Working memory | `hs_store` with `ttl=` |
598
+ | Periodic cleanup | `hs_prune dry=true` → inspect → execute |
599
+ | Debug a bad decision | `hs_graph` with `at=` timestamp |
600
+ | Audit a decision | `hs_graph` with `mode=replay` |
601
+ | Cross-agent signal | `hs_store` with `targetAgent` → `hs_inbox` |
602
+ | Check agent trust | `hs_profile` |
603
+ | Check efficiency | `hs_stats` |
604
+
605
+ ---
98
606
 
99
607
  ## Setup
100
608
 
101
- 1. Get free API key: https://cascadeai.dev/hyperstack
102
- 2. Set `HYPERSTACK_API_KEY=hs_your_key` in your OpenClaw env
103
- 3. Tools are available immediately
609
+ ### MCP (Claude Desktop / Cursor / VS Code / Windsurf)
610
+ ```json
611
+ {
612
+ "mcpServers": {
613
+ "hyperstack": {
614
+ "command": "npx",
615
+ "args": ["-y", "hyperstack-mcp"],
616
+ "env": {
617
+ "HYPERSTACK_API_KEY": "hs_your_key",
618
+ "HYPERSTACK_WORKSPACE": "my-project",
619
+ "HYPERSTACK_AGENT_SLUG": "cursor-agent"
620
+ }
621
+ }
622
+ }
623
+ }
624
+ ```
625
+
626
+ ### Python SDK
627
+ ```bash
628
+ pip install hyperstack-py
629
+ ```
630
+ ```python
631
+ from hyperstack import HyperStack
632
+ hs = HyperStack(api_key="hs_...", workspace="my-project")
633
+ hs.identify(agent_slug="my-agent")
634
+ branch = hs.fork(branch_name="experiment")
635
+ hs.diff(branch_workspace_id=branch["branchWorkspaceId"])
636
+ hs.merge(branch_workspace_id=branch["branchWorkspaceId"], strategy="branch-wins")
637
+ ```
638
+
639
+ ### LangGraph
640
+ ```bash
641
+ pip install hyperstack-langgraph
642
+ ```
643
+ ```python
644
+ from hyperstack_langgraph import HyperStackMemory
645
+ memory = HyperStackMemory(api_key="hs_...", workspace="my-project")
646
+ ```
647
+
648
+ ### Self-Hosted
649
+ ```bash
650
+ # With OpenAI embeddings
651
+ docker run -d -p 3000:3000 \
652
+ -e DATABASE_URL=postgresql://... \
653
+ -e JWT_SECRET=your-secret \
654
+ -e OPENAI_API_KEY=sk-... \
655
+ ghcr.io/deeqyaqub1-cmd/hyperstack:latest
104
656
 
105
- Free: 10 cards, keyword search.
106
- Pro ($29/mo): 100 cards, graph traversal, semantic search, time-travel debugging.
657
+ # Fully local Ollama embeddings
658
+ docker run -d -p 3000:3000 \
659
+ -e DATABASE_URL=postgresql://... \
660
+ -e JWT_SECRET=your-secret \
661
+ -e EMBEDDING_BASE_URL=http://host.docker.internal:11434 \
662
+ -e EMBEDDING_MODEL=nomic-embed-text \
663
+ ghcr.io/deeqyaqub1-cmd/hyperstack:latest
664
+
665
+ # Keyword only — no embeddings needed
666
+ docker run -d -p 3000:3000 \
667
+ -e DATABASE_URL=postgresql://... \
668
+ -e JWT_SECRET=your-secret \
669
+ ghcr.io/deeqyaqub1-cmd/hyperstack:latest
670
+ ```
671
+ Set `HYPERSTACK_BASE_URL=http://localhost:3000` in your SDK config.
107
672
 
108
- ## When to use
673
+ Full guide: https://github.com/deeqyaqub1-cmd/hyperstack-core/blob/main/SELF_HOSTING.md
109
674
 
110
- - **Start of session**: `hs_search` for relevant context
111
- - **Decision made**: `hs_decide` with rationale and links
112
- - **Task blocked**: `hs_store` with `blocks` relation
113
- - **Before starting work**: `hs_blockers` to check dependencies
114
- - **New finding**: `hs_store` as context card
675
+ ---
115
676
 
116
677
  ## Data safety
117
678
 
118
- NEVER store passwords, API keys, tokens, PII, or credentials. Cards should be safe in a data breach. Always confirm with user before storing.
679
+ NEVER store passwords, API keys, tokens, PII, or credentials in cards. Cards should be safe in a data breach. Always confirm with user before storing sensitive information.
680
+
681
+ ---
682
+
683
+ ## Pricing
684
+
685
+ | Plan | Price | Cards | Features |
686
+ |------|-------|-------|---------|
687
+ | Free | $0 | 10 | Search only |
688
+ | Pro | $29/mo | 100 | All modes + branching + identity + Memory Hub |
689
+ | Team | $59/mo | 500 | All modes + webhooks + agent tokens |
690
+ | Business | $149/mo | 2,000 | All modes + SSO + 20 members |
691
+ | Self-hosted | $0 | Unlimited | Full feature parity |
692
+
693
+ Get your free API key: https://cascadeai.dev/hyperstack
694
+
695
+ ---
696
+
697
+ ## Changelog
698
+
699
+ ### v1.0.23 (Feb 21, 2026)
700
+
701
+ #### ✨ Memory Hub Segmentation — 3 new memory surfaces
702
+ - `?memoryType=episodic` — event traces with 30-day soft decay. Agent-used cards decay at half rate.
703
+ - `?memoryType=semantic` — permanent facts/entities. No decay. Returns confidence + provenance fields.
704
+ - `?memoryType=working` — TTL-based scratchpad. Expired cards hidden by default. Agent-used cards get 1.5x TTL extension.
705
+ - All three surfaces backed by same Card table — zero schema changes, zero storage cost
706
+
707
+ #### ✨ Decision Replay — audit what agents knew at decision time
708
+ - `mode=replay` on graph endpoint — reconstructs graph state at decision timestamp
709
+ - `modifiedAfterDecision` flag — detects cards created AFTER decision (potential hindsight bias)
710
+ - Plain English `narrative` array — audit-ready output for compliance
711
+
712
+ #### ✨ Utility-Weighted Edges — self-improving graph
713
+ - `hs_feedback` — report success/failure after every agent task
714
+ - `?sortBy=utility` — retrieve most useful cards first
715
+ - `?minUtility=0.7` — filter to high-utility cards
716
+ - `?weightBy=utility` — graph traversal prioritises highest-value edges
717
+
718
+ #### 🐛 Routing fixes
719
+ - Fork, diff, merge, discard — routing was broken in production, now fully fixed and tested
720
+ - Agent identity register/profile — plan gate was blocking PRO users, now fixed
721
+ - V2 Agent/AgentACL snake_case fields corrected throughout
722
+
723
+ #### 📦 SDK
724
+ - `hyperstack-mcp` → v1.9.2 (15 tools, was 14)
725
+ - Docker image rebuilt: `ghcr.io/deeqyaqub1-cmd/hyperstack:latest` (Phase 3+4 now included)
726
+
727
+ ### v1.1.0 (Feb 20, 2026)
728
+
729
+ #### ✨ Git-Style Memory Branching — 4 new tools
730
+ - `hs_fork`, `hs_diff`, `hs_merge`, `hs_discard`
731
+
732
+ #### ✨ Agent Identity + Trust Scoring — 2 new tools
733
+ - `hs_identify`, `hs_profile`
734
+ - Trust formula: `(verifiedCards/total)×0.7 + min(cardCount/100,1.0)×0.3`
735
+
736
+ #### ✨ Self-Hosting via Docker
737
+ - `ghcr.io/deeqyaqub1-cmd/hyperstack:latest`
738
+
739
+ #### 📦 SDK
740
+ - `hyperstack-mcp` → v1.9.0 (14 tools)
741
+ - `hyperstack-py` → v1.4.0
742
+ - `hyperstack-langgraph` → v1.4.0
743
+
744
+ ### v1.0.20 (Feb 20, 2026)
745
+ - Trust/Provenance fields on every card: `confidence`, `truthStratum`, `verifiedBy`, `verifiedAt`, `sourceAgent`
746
+
747
+ ### v1.0.19 (Feb 20, 2026)
748
+ - `hs_prune`, `hs_commit`, `pinned` field, `scratchpad` cardType + TTL
749
+
750
+ ### v1.0.18 (Feb 20, 2026)
751
+ - `hs_smart_search` — agentic RAG routing
752
+
753
+ ### v1.0.16 (Feb 19, 2026)
754
+ - `hs_impact`, `hs_recommend`
755
+
756
+ ### v1.0.13–v1.0.15
757
+ - Core: `hs_search`, `hs_store`, `hs_decide`, `hs_blockers`, `hs_graph`, `hs_my_cards`, `hs_ingest`, `hs_inbox`, `hs_stats`