Agent, that extends
StatefulActor with the primitives AI agents need
most: a persistent conversation history, durable scheduled tasks, and merge-patch
state — with no extra infrastructure to manage.
Agent ships as an export of @telnyx/edge-runtime, alongside StatefulActor. There
is no separate package to install.
The
Agent base class is in Beta. The API surface may change.What Agent adds to StatefulActor
State is durable and survives restarts — the same persistence guarantee that
StatefulActors provide. Everything
StatefulActor provides is inherited too,
including the embedded SQL database and
WebSocket termination.
Bring your own harness
The loop that makes an agent more than a single model call — build the prompt from history, call the model, run the tools it asks for, decide whether to continue or stop — is called a harness. The Agent SDK deliberately doesn’t ship one. It is the substrate a harness runs on: history, state, and timers stay durable underneath whatever loop you run, andthis.messages converts history to the format your stack
expects.
Two ways to wire one in:
- Roll your own.
process()is the harness: it calls inference through the pre-authenticated Telnyx API binding — no API key to manage — andtoOpenAI()produces exactly the payload it takes. → Roll Your Own Agent - Bring a framework as the harness. LangGraph, LangChain — anything that runs on Node — executes inside the actor, with the SDK as its durable memory and scheduler. → LangGraph Agent
baseURL
away. See Calling LLMs. And because the
substrate is harness-neutral, an opinionated first-party harness can slot in later
without changing anything you build now.
Where to go next
- Quickstart — a working agent in one file
- How Agents Run — the actor execution model in four properties
- Calling LLMs — both wiring patterns, side by side
- API reference — every method and override hook