golem-stateless-agent-rust

Creates ephemeral stateless agents in Rust Golem projects with fresh instances per invocation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When building request-handler style services on Golem, the default durable agent model persists state across calls, which is unnecessary overhead for pure functions, transformers, and stateless HTTP endpoints. This Skill guides you through creating ephemeral agents that get a fresh instance for every invocation, with no shared state, no replay, and no persistence.

Core Features & Use Cases

  • Ephemeral Agent Definition: Add the ephemeral flag to the #[agent_definition] attribute to make every invocation start from a clean new() call.
  • HTTP Endpoint Mounting: Combine ephemeral agents with mount and route attributes like #[post] to build stateless REST APIs, converters, and proxies.
  • Decision Guidance: Clear criteria for when ephemeral agents fit (stateless transformers, validators, webhook forwarders) versus when durable agents are required (counters, sagas, workflows).
  • Use Case: Imagine building a case-conversion HTTP API where each request is independent. An ephemeral agent mounted at /api/convert/{name} handles to-upper and to-lower requests without persisting anything between calls.

Quick Start

Ask the AI to create an ephemeral stateless agent in a Rust Golem project that handles HTTP requests without persisting state between invocations.

Frequently Asked Questions about golem-stateless-agent-rust

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

FAQPage Schema
How do I create a stateless agent in a Rust Golem project?

Add the ephemeral flag to the agent_definition attribute, like #[agent_definition(ephemeral)], on your agent trait. Each invocation then calls new() to create a fresh instance, executes the method, and discards the instance entirely.

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

Durable agents persist state across calls and replay their oplog for recovery, so a counter increments 1, 2, 3. Ephemeral agents reset state every call, so the same counter returns 1, 1, 1, and their oplog is never replayed.

Can ephemeral Golem agents handle HTTP endpoints?

Yes, ephemeral agents support HTTP mounting via the mount parameter and route attributes like #[post]. This makes them a natural fit for stateless REST APIs, converters, proxies, and webhook receivers.

When should I not use ephemeral agents in Golem?

Avoid ephemeral agents for counters, shopping carts, workflow orchestrators, sagas, or any logic where one call depends on a previous call. Those cases need durable agents with oplog-based recovery and persistent state.

Do ephemeral agents still record an oplog in Golem?

Yes, an oplog is still recorded lazily, so you can inspect what an ephemeral agent did via golem agent oplog. However, it is never used for replay or automatic recovery on failure.