What problem does it solve?
In Golem, an agent is normally uniquely identified by its constructor parameters, so calling get with the same values always returns the same agent. This Skill explains how to use phantom agents in Rust to create multiple distinct, durable agent instances that share identical constructor parameters by appending a phantom UUID to the agent identity.
Core Features & Use Cases
- Phantom Instance Creation: Use the generated client methods new_phantom and get_phantom to create or reconnect to independent agent instances with random or specific UUIDs.
- Phantom ID Introspection: Query an agent's own phantom ID from inside the agent via the BaseAgent trait's phantom_id method.
- HTTP-Mounted Phantom Agents: Set phantom_agent = true on an HTTP-mounted agent so every incoming request is handled by a fresh instance.
- Use Case: Imagine a chat application where each user session needs its own Counter agent with the same configuration. Use new_phantom to spawn an isolated instance per session, store the returned UUID, and reconnect later with get_phantom.
Quick Start
Show me how to create and reconnect to phantom agent instances in Rust using new_phantom and get_phantom with the Golem agent client.