Downcity
Remote Agent

Example: Client / Server Pattern

One process exposes an Agent service and another process calls it through RemoteAgent

Example: Client / Server Pattern

This pattern usually looks like:

  • the server process owns the local Agent
  • the server calls agent.start({ http: { ... } })
  • the client process creates RemoteAgent

The biggest advantage is a clean separation of responsibilities:

  • the server maintains execution context
  • the client only sends requests and consumes results

This is a good fit for:

  • frontend and backend separation
  • a local daemon plus caller process
  • multiple callers sharing one agent service