What problem does it solve?
Building distributed agent systems in Golem requires agents to communicate with each other, but managing remote procedure calls, client lifecycles, and cross-component dependencies manually is error-prone and can lead to resource leaks or deadlocks.
Core Features & Use Cases
- Scoped Client Pattern: Use
<AgentName>Client::scoped(...) to obtain a client that is automatically dropped when the callback returns, preventing resource leaks.
- Manual Client Management: Use
<AgentName>Client::get(...) with an explicit drop() call when you need full control over the client lifecycle.
- Cross-Component RPC: Call agents defined in other components after running
golem build, which generates bridge SDK code from dependencies declared in golem.yaml.
- Use Case: A task-manager agent needs to update a counter agent and read back the result. Use
CounterClient::scoped("my-counter", ...) to increment the counter and await the returned value in a single blocking call.
Quick Start
Ask the AI to show how to call another Golem agent from a MoonBit agent using the scoped client pattern and await the result.