Skip to main content

How it works

A Plexa Space is a single-process reactor. It owns a tick loop, a set of bodies, a brain, and a few caches.
Everything between steps 4 and 7 is the gate. The LLM never reaches an actuator without passing it.

Space

The orchestrator. Holds bodies, the brain, the tool registry, and the gates.
The reactor runs until you call space.stop().

BodyAdapter

A body is a class with one async method per tool. The static tools map is the contract the brain sees.
BodyAdapter and SCPBody are the same class with two names. Anything you can do in scp-protocol you can do here.

Tools are method calls, not HTTP

When the brain returns { target_body: "arm", tool: "move", parameters: { x: 1, y: 2 } }, Plexa looks up the body, calls body.invokeTool("move", { x: 1, y: 2 }), which calls arm.move({ x: 1, y: 2 }). Direct async method call. No serialization. No HTTP. The only HTTP in the picture is brain to LLM and (optionally) Plexa to a remote body.

Inprocess vs network bodies

By default a body is in-process. To run it in another process, declare transport on the class:
Plexa auto-wraps it in a NetworkBodyAdapter that polls /state and /events, POSTs /tool, and (if static tools is empty) calls /discover to fetch the schema.
The remote body just needs to expose those four endpoints. The Python adapter in the SCP repo does this.

The four jobs

Plexa does four things and refuses to do anything else. It does not plan. It does not reason. It does not own physics.

Decision authority

These three layers do not overlap. The brain proposes. Plexa gates. The body has the last word; if a reflex says no, the body refuses.