Edge & Device Services

New in Psyclone AIOS v2.3 — shipped 19 November 2026.

Edge & Device Services are the front door of a Psyclone system for everything outside it: a browser, a phone app, a sensor, a webhook, another program. You declare a service in the psySpec like a small module — its posts say what incoming data becomes, its triggers say what is sent back out — and bind it to a port with HTTP, WebSocket, UDP or TCP. The service does all the network work, so no module ever opens or manages a socket.

Why it matters

Real-time AI systems increasingly start and end outside the server: audio from a phone, telemetry from a device in the field, a dashboard in a browser. Until now that meant writing and maintaining a bridge process for every kind of client. Services replace the bridge with a few lines of spec, and the messages they produce are ordinary Psyclone messages — routed, stored, recorded and monitored like everything else.

They are also designed to keep the system in charge. A client never sets a message type: it names one of the service’s posts, exactly as a module does, and the service applies the type declared in the spec. The spec alone decides what can enter the system, clients never need internal type ids, and the type hierarchy can be reorganised without touching a single client.

How it works

  • HTTP ingestion: a service with a post and no trigger accepts uploads, telemetry and webhooks and answers at once, so a sender never waits for processing.
  • HTTP request/reply: with a post and a trigger, the request is posted and the first matching reply becomes the HTTP response; no reply within the timeout returns 504 instead of leaving the client hanging.
  • File hosting: serve a web UI or files from a directory, with paths that cannot escape the root.
  • WebSocket and UDP streams: independent flows in both directions — audio up, playout and status down. UDP replies leave from the service’s own port, which is what NAT and mobile networks let back through, and a device keeps its identity when it moves from Wi-Fi to 4G.
  • Compact packed messages: clients may send the new packed form of a message — about a third of the bytes — and get answers in the same form. A byte-exact Kotlin/Android codec ships with CMSDK, alongside the C++ and Python libraries.

How to use it

One service can serve WebSocket and UDP on the same port as its HTTP interface. Modules trigger on the posted types and post the reply types; replies go back to the client they came from:

<service name="Phone">
  <post name="AudioFrame" type="Phone.Audio.Frame" />
  <trigger name="Playout"  type="Phone.Playout.Chunk" />
</service>
<interface name="PhoneTCP" port="18600" protocol="HTTP" service="Phone" />
<interface name="PhoneUDP" port="18600" ip="UDP" protocol="Message" service="Phone" />
val m = DataMessage().setString("PsyPost", "AudioFrame")   // the post's NAME, never a type
    .setString("PsyDevice", "phone-1").setData("audio", opusFrame)
val bytes = m.toPackedBytes()                                 // ~3x smaller than toBytes()
socket.send(DatagramPacket(bytes, bytes.size, InetSocketAddress(host, 18600)))
  • Declare the service and its interface in the psySpec; give each kind of incoming data its own named post.
  • Write clients against post names and trigger names only, in Kotlin, Python, C++ or plain browser JavaScript.
  • Watch the service and its traffic in PsyProbe 2.0 like any other component.

When to use it / when not

  • Use it for phones, browsers, sensors, webhooks and edge devices that need to feed or follow a live system with low latency.
  • Use it for small request/reply APIs in front of a system, with a guaranteed answer or timeout.
  • Not a delivery guarantee: services deliver what arrives and do not retransmit. Sequence numbers, acknowledgements and resending belong in modules, where they stay measurable and replayable.
  • Not yet: built-in authentication for custom services (<authentication> is parse-only) and custom Telnet services — expose services on trusted networks or behind your own gateway.

Read the docs


Edge & Device Services is one of the two headline 2.3 capabilities. See also PsyProbe 2.0 for watching and steering a live system, Heterogeneous Compute for spreading a system over machines, or return to the Psyclone AIOS overview.