What problem does it solve?
Scala developers building Golem agents need a code-first way to expose agent methods over HTTP without manually wiring routing infrastructure, including correct path variable mapping, response status codes, and deployment configuration.
Core Features & Use Cases
- Code-First Route Definitions: Add a
mount parameter to @agentDefinition and annotate trait methods with @endpoint(method, path) to define REST routes directly in Scala code.
- Return Type to HTTP Mapping: Automatically maps
Future[Unit], Future[Option[T]], Future[Either[E, T]], and UnstructuredBinary to appropriate HTTP status codes and response bodies.
- Phantom Agents: Enable
phantomAgent = true to create a new agent instance per HTTP request for fully parallel request processing.
- Use Case: You have a Scala task-management Golem agent and want to expose
GET /tasks, POST /tasks, and GET /tasks/{id} as a REST API under a mounted base path, then deploy it via an httpApi section in golem.yaml.
Quick Start
Add HTTP endpoints to my Scala Golem agent by mounting it at a base path and exposing its methods as a REST API.