Other

/brain-store-fallback

Fallback for failed brain_store: write memory to docs.local for replay. Triggers: null chunk, DB busy, close.

$ golems-cli skills install brain-store-fallback
fixtures
1 workflow

Updated 2 weeks ago

Use this skill whenever a brain_store call might not have durably written to BrainLayer.

Wave evidence: 72h-mine found BrainLayer DB-busy and MCP transport closures as the #2 severity-10 ecosystem pattern, with silent brain_store loss across six or more recent sessions. See pain-points/_consolidated.md.

Core Rule

If brain_store does not return a concrete chunk_id, do not report that the content was stored in BrainLayer.

Instead, write the exact original content to:

docs.local/decisions/<YYYY-MM-DD>-<slug>.md

Then report:

Queued to docs.local/decisions/<file> pending BrainLayer recovery.

Activation Signals

Activate on any Tier 1 hard failure:

  • Transport closed
  • -32000: Connection closed
  • apsw.ReadOnlyError
  • database is locked
  • Python exception text in the MCP error channel
  • brain_store returns null, undefined, or no chunk_id
  • Probe result includes TOOL_RETURNED_TEXT=no

Activate on any Tier 2 soft queue signal:

  • chunk_id: null
  • Response says queued, queue depth, deferred, or similar without a durable chunk id
  • The call takes longer than 25 seconds

Treat Tier 3 signals as advisory:

  • The latest brain_search also failed with a transport error
  • Other BrainLayer tools are returning connection failures

Tier 3 means be ready to fall back on the next brain_store; it does not by itself replace the primary brain_store attempt.

Fallback Contract

The fallback file is a local replay queue entry, not a BrainLayer ack.

Write YAML frontmatter followed by the exact original content:

---
intended_brain_store: true
importance: <1-10>
tags: [<original tags>]
timestamp: <ISO 8601>
reason: <transport_closed | db_busy | queued_null_chunk | readonly | unknown>
retry_attempted: false
chunk_id:
---
<original brain_store content, byte-for-byte>

Preserve all four brain_store semantics:

  • Content
  • Importance
  • Tags
  • Timestamp

Do not add fallback annotations to the body. Do not reformat the body. Do not drop tags or importance.

Workflows

/brain-store-fallback:replay