Skip to main content
The Agent SDK is a TypeScript base class, 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, and this.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 — and toOpenAI() 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
Either way you bring your own LLM: Telnyx Inference is wired in through the binding, and any OpenAI-compatible provider is one 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