golem-configure-durability-moonbit

Configure durable, ephemeral, or snapshot-based persistence modes for MoonBit Golem agents.

1.5k|212|Updated Nov 24, 2023
One-click install
npx skills add https://github.com/golemcloud/golem --skill golem-configure-durability-moonbit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golem-configure-durability-moonbit
Source: https://github.com/golemcloud/golem/tree/main/golem-skills/skills/moonbit/golem-configure-durability-moonbit
Command: npx skills add https://github.com/golemcloud/golem --skill golem-configure-durability-moonbit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Choosing the wrong persistence mode for a Golem agent leads to unnecessary oplog overhead, slow recovery from failures, or lost state. This Skill guides you through selecting and configuring durable, ephemeral, or snapshot-based durability for MoonBit agents so persistence behavior matches your workload.

Core Features & Use Cases

  • Durable Agents (Default): State persists across invocations and failures via automatic oplog recording and replay, with no extra code required.
  • Periodic Snapshots: Add #derive.agent(snapshotting="every_n(10)") so recovery starts from the latest snapshot instead of replaying the full oplog, ideal for long-running agents with heartbeats or polling loops.
  • Ephemeral Agents: Use #derive.agent("ephemeral") for stateless, per-invocation handlers where persistence is not needed.
  • Use Case: You have a long-running workflow orchestrator whose oplog has grown so large that recovery is slow. This Skill shows you to keep durable mode but enable periodic snapshots, then rebuild with golem build.

Quick Start

Ask the AI to switch my MoonBit Golem agent to ephemeral mode or add periodic snapshots, then rebuild the project with golem build.

Frequently Asked Questions about golem-configure-durability-moonbit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a Golem agent ephemeral in MoonBit?

Change the agent annotation from #derive.agent to #derive.agent("ephemeral") on your struct, then rebuild with golem build. Ephemeral agents discard state after each invocation and call new() to create a fresh instance per call.

How do I reduce oplog replay time for long-running Golem agents?

Keep the agent durable but enable periodic snapshots with #derive.agent(snapshotting="every_n(10)"). Recovery then starts from the latest snapshot instead of replaying the full oplog, which helps agents with heartbeats, polling, or recurring tasks.

What is the difference between durable and ephemeral agents in Golem?

Durable agents persist state across invocations and failures by recording every side effect in an oplog that is replayed on recovery. Ephemeral agents discard state after each invocation, skip oplog replay, and suit stateless request handlers or pure computations.

Can I disable oplog writes for a durable Golem agent?

No, durable agents cannot opt out of oplog writes because the oplog is how durability works. If oplog volume or replay cost is a concern, use durable mode with periodic snapshots instead of trying to skip persistence.

Why does my MoonBit agent not reflect durability changes after editing?

You must rebuild with golem build after changing the #derive.agent annotation so derived files are regenerated. Never edit generated files like golem_reexports.mbt, golem_agents.mbt, or golem_derive.mbt directly.