Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate
Read the talk
Every step you take, every call you make: the reliable agent stack
Giselle van Dongen shows how Restate gives long-running agents journal-based recovery, suspended human approvals, isolated session state, midflight signals, cancellation, and shared infrastructure controls.
From a talk by Giselle van Dongen
At a glance
Ideas worth remembering
Reliable agent infrastructure separates four concerns: recoverable execution, consistent concurrent sessions, distributed communication, and deliberate execution control.
Journaled durable steps preserve completed progress through failures, and durable promises use the same mechanism to suspend human-approval waits across restarts and redeployments.
Virtual objects isolate state by session key and serialize updates within a session; execution IDs separately make active runs retrievable, signalable, and cancellable.
Signaling can amend work already in progress, while cancellation unwinds active subagents and controllers. Completed external side effects still require application-specific compensation.
Moving inline model calls into a shared gateway creates one place for policy checks and concurrency limits, such as the example limit of 300 simultaneous calls per department.
The distributed log and event loop connect journal events to state updates, timers, and service requests; push-based dispatch is intended to reduce latency and wake serverless functions directly.
Persistent agents change the infrastructure problem
A question-answering model can finish in seconds. A tool-using application may stay active for a session. The next step is harder: persistent, asynchronous agents that remain in an organization’s infrastructure, use tools and context, and communicate with other agents. Once work becomes long-running, stateful, and distributed, the surrounding infrastructure must survive failures and connect components that no single agent SDK owns.
Agent SDKs and memory can accelerate a proof of concept, but production systems still need retries, recovery, state consistency, communication, and operational control. Restate is presented as an open-source foundation for those backend concerns rather than an agent framework. Its ideas draw on Apache Flink and work by architects associated with Meta’s event infrastructure.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Four jobs underneath the agent loop
The infrastructure layer has four distinct jobs. Durable execution preserves a run through failure instead of restarting a week-long task. Session consistency lets thousands of conversations proceed without corrupting one another’s state. Distributed communication connects agents, MCP servers, and tools. Execution control stops work that is stuck or no longer wanted. Recovery preserves desired work; cancellation deliberately ends it.
Restate runs as a separate server in front of the agent service, acting somewhat like a proxy or message broker. It pushes an invocation to the service and keeps an open connection that van Dongen calls a “lifeline.” As the service works, operations emit events to Restate. Those events form a journal from which the execution can be reconstructed after a failure.
What relationship does that journal create between an ordinary request and a recoverable agent run? The flow below makes the persistence boundary visible: application work produces journal entries before later recovery depends on them.
The result is intended to feel like an ordinary application function while gaining long-running execution and state. The demonstration applies that model to a Slack research agent available to employees inside a company.
A request targets the agent service through Restate.
Restate pushes work to the agent service, records events emitted through the open connection, and uses those persisted events to resume after failure.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A research run survives a failed search
The concrete example begins when a user asks Slack, “What is new in AI?” Restate’s UI shows the corresponding execution. A planner first calls an LLM and returns proposed research subtopics. Clicking Approve unblocks the workflow, launches parallel research agents, and eventually hands their output to a writer agent. Planning, authorization, parallel research, and synthesis are separate stages of one durable run.
An injected failure makes the recovery mechanism observable. One subagent completes an LLM call, begins web searches, and encounters a search API outage. The failed search retries and later completes successfully. The surrounding research does not restart because the journal already records the run’s progress; recovery returns to the failed operation rather than discarding earlier work.
In code, the application unit is an HTTP handler using the Restate SDK. Its Restate object context represents the connection to the server, and operations performed through that context create journal events. The planner’s Python LLM function becomes a durable step when wrapped in restate.run. If the process fails much later, the journal supplies the recorded execution point from which it can continue.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A month-long wait without a month-long function
Durability also handles intentional inactivity. A human approval may take weeks or a month, spanning service restarts and redeployments. Keeping a conventional function active for that entire period would tie the workflow’s lifetime to one process invocation.
Restate instead creates a durable promise in the journal. The promise marks a suspension point; Slack presents the approval button, and the function suspends while it waits. On serverless infrastructure, van Dongen says the suspended process consumes no function execution time. When approval arrives, the promise resolves and execution resumes where it stopped. The claim concerns serverless execution time during the wait, not the absence of storage or platform operating costs.
This works well for a sequence of durable steps, but a persistent agent needs more than a workflow-shaped history. It also needs an identity, memory, and a way to accept new input while work is already underway.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Virtual objects turn sessions into stateful actors
Restate models that persistent entity as a virtual object, similar to a stateful actor. Each object has a unique key such as a session ID, isolated key-value state such as message history, and handlers that can run durable functions for the session. A user can therefore add context while research is underway instead of waiting ten minutes for the first run to finish.
Isolation alone does not prevent two messages in the same session from racing. If both handlers updated the same conversation state concurrently, one could overwrite the other. The session controller prevents this by allowing one execution at a time for a given object key; another execution waits in a queue behind it. Separate sessions can still run concurrently, but serialization within one session trades some per-session latency for consistent updates.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Signal relevant context; cancel a new direction
A session ID addresses persistent conversation state. A separate execution ID addresses one active run. Other processes can use that execution ID to retrieve output, send a signal containing new state, or cancel the run. Together, the two identities let a controller remember the conversation while directly contacting the particular research execution already in flight.
The application adds an LLM classifier on top of those control primitives. When a new Slack message arrives, the classifier asks whether it is relevant to the current research. Relevant context is sent as a signal; unrelated context causes cancellation followed by a new run. Restate supplies addressability and control, while the classifier makes the application-level routing decision.
The first follow-up—“focus on frontier models”—stays within the original “What is new in AI?” assignment. The controller classifies it as relevant and injects it into the active loop. The UI then shows the message entering the research execution, which takes the added focus into account and starts its work again. The talk does not evaluate classifier accuracy or establish precisely how much prior research is reused after this signal.
The second follow-up changes the assignment: “Forget about that. Research AI policy.” The coordinator cancels the existing run and starts a new one. Cancellation travels through the call chain, stopping spawned subagents before the controller unwinds. This can give application code an opportunity to roll back, but stopping execution does not by itself reverse external effects that have already completed.
What decides whether a live run is amended or replaced? The comparison below separates the classifier’s semantic choice from Restate’s execution mechanisms.
Additional context arrives while research is active.
The controller classifies new input, then either signals the addressed execution or cancels its call chain and starts a replacement.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The distributed log underneath the programming model
Under the SDK, Restate uses an event-driven distributed log between clients and services. The log persists journal events, while an event loop interprets them. Depending on the event, it may update an embedded state store, set a timer, or send a request to another agent. The same substrate therefore backs recorded function steps, session state, suspension points, and distributed calls.
What turns the journal into actual application behavior? The diagram shows the event loop dispatching persisted events into three different effects rather than treating the log as passive history.
A notable architectural choice is push-based invocation. Van Dongen contrasts it with workflow workers polling a server for new tasks: Restate sends the request directly to the target service, which also fits serverless functions that wake on incoming requests. She reports 45 milliseconds at p99 for a 10-step workflow, but supplies no benchmark setup, workload, or deployment conditions, so the figure should be read as a reported example rather than a general latency guarantee.
The server packages the state store and UI in one binary. A highly available deployment is described as multiple instances snapshotting to object storage, although the talk does not detail replication, coordination, or restoration. Adoption options include six SDKs, integrations with popular agent frameworks, direct use with arbitrary LLM SDKs, open-source self-hosting, deployment into a customer’s cloud account, and a managed cloud. Keeping Restate in the customer account can keep this layer’s data there; external tools and model providers remain separate data paths.
The closing lesson is narrower than “use a workflow engine for every agent.” Persistent agents need recoverable steps, addressable sessions, communication with live work, and a reliable way to stop it. Putting those mechanics beneath the agent loop lets the application evolve—from an inline LLM call to a governed gateway—without rebuilding retries, state management, and control each time.
Submit requests through the Restate layer.
The distributed log persists events; the event loop interprets them and applies the corresponding state, timing, or communication operation.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
Related talks
- Building Durable, Production-Ready Agents with OpenAI SDK and Temporal
A complementary implementation-focused workshop on persisted LLM calls, event-sourced recovery, state management, and exposing durable workflow activities as agent tools.
- Breaking the Chain: Agent Continuations for Resumable AI Workflows
Explores another mechanism for capturing nested agent and tool state so executions can suspend for approval, recover after failure, and resume without keeping loops active.
- Two Roads to Durable Agents: Replay vs. Snapshot — Eric Allam, Co-founder, Trigger.dev
Compares replay-based durability like the journal model discussed here with snapshot-based preservation of complete stateful execution environments.
Read the complete timestamped transcript
- 0:12
Hi everyone. This talk will be about how
- 0:14
to run agents reliably in production. It
- 0:17
will not be about the eile part, but it
- 0:19
will be about all the other things you
- 0:22
need to get going in order to run agents
- 0:24
resiliently. So the infrastructure layer
- 0:27
basically. I want to set the scene with
- 0:30
this uh quote of Andre Apathy of last
- 0:32
week. It describes that the way we
- 0:34
interact with agents and LLMs has been
- 0:37
evolving in three waves. The first wave
- 0:40
was an LLM being something like a
- 0:42
website where we go to we ask it a
- 0:44
question, it thinks for a few seconds
- 0:47
and then gives us a response. The second
- 0:49
wave was going towards agents. It was an
- 0:52
app that we download to our computer. It
- 0:54
has some tools at its disposal and it
- 0:57
can do some work with our interaction.
- 1:00
Now the third wave will be going more
- 1:02
and more towards persistent and
- 1:04
asynchronous entities. So agents being
- 1:07
longunning processes in our
- 1:09
infrastructure with access to tools and
- 1:12
other agents around the organization and
- 1:14
context.
- 1:17
And so as our use cases are evolving
- 1:19
more and more from single agents to
- 1:21
agentic platforms that connect parts
- 1:24
around uh the organization our
- 1:26
infrastructure layer should also evolve
- 1:28
with that. So when we look at the types
- 1:31
of tools that are currently out there to
- 1:33
implement agents, a lot of innovation
- 1:35
has been done on sites such as agent
- 1:37
SDKs and memory. And agent SDKs are
- 1:41
really cool to implement PC's and get
- 1:44
started quickly, but they don't
- 1:46
necessarily help with like connecting
- 1:47
the distributed bits around an
- 1:49
organization.
- 1:51
And if you want to implement more
- 1:53
complex agentic systems, you actually
- 1:56
need all of those things. So that is the
- 1:58
layer that you see below here where um
- 2:01
you have to deploy extra infrastructure.
- 2:03
Uh you need to write things like retry
- 2:05
logic, recovery logic and all of that is
- 2:08
actually pretty complex to get right but
- 2:11
completely necessary to run longunning
- 2:13
stateful and distributed processes in
- 2:15
production.
- 2:17
So today I want to talk about an
- 2:19
open-source framework called restate.
- 2:21
And you can see it a bit as a flexible
- 2:23
durable foundation that lets you build
- 2:26
any backend. So it's not specific for
- 2:28
agents but a as agents are also just a
- 2:32
type of a backend uh it also works well
- 2:34
for them. The ideas behind restate come
- 2:37
from Apache Flink which is a popular
- 2:40
distributed stream processing engine and
- 2:42
also from some of the exarchitects
- 2:45
behind Meta Score event infra.
- 2:49
So what are the ingredients in restate?
- 2:51
Basically four parts. First of all, it
- 2:54
makes sure that a single run of an agent
- 2:56
is resilient. This is called durable
- 2:59
execution in the industry. Think about
- 3:02
things like when an agent runs for a
- 3:04
week and then crashes. We want to be
- 3:06
able to bring it back and let it
- 3:08
continue exactly at the point where it
- 3:10
failed. We don't want it to start over
- 3:12
from the beginning.
- 3:14
Another um area here is running many
- 3:18
concurrent sessions in parallel. Imagine
- 3:20
running thousands of concurrent agent
- 3:22
sessions at the same time and needing
- 3:24
needing to make sure that state is
- 3:26
always consistent and that different
- 3:28
agents don't interfere with each other.
- 3:31
And then going more towards things like
- 3:33
communication between agents, between
- 3:35
agents and MCP servers and other tools.
- 3:38
And finally also control, making sure
- 3:40
that when an agent for example uh is
- 3:43
doing um something you don't want it to
- 3:45
continue or when it's stuck being able
- 3:47
to actually cancel or kill the
- 3:48
execution.
- 3:51
So the way that you can think of it is
- 3:53
as follows. Restate is basically a
- 3:55
server which runs in front of your agent
- 3:58
service. So as a separate component it
- 4:00
sits there a bit like a like a message
- 4:02
broker or a proxy and when there's a
- 4:05
request for your agent restate proxies
- 4:07
the request to the service and pushes it
- 4:10
to the service basically and from that
- 4:12
moment there's a connection open
- 4:15
connection between restate and the agent
- 4:17
and that connection will basically be a
- 4:19
bit like a lifeline for the agent. So as
- 4:21
the agent is doing stuff, it sends
- 4:24
events over to restate and restate will
- 4:27
use that journal of events to recover
- 4:29
the process after a failure.
- 4:33
So from a slightly higher level um
- 4:35
explanation, you could say that it's
- 4:37
turning a normal function in your
- 4:39
application into something that is long
- 4:41
running, durable, and stateful without
- 4:44
having to do um a lot of the complex
- 4:46
things you otherwise need to do for
- 4:48
this. So my talk today will be mainly a
- 4:51
demo. So I'll be showing you um a
- 4:54
research agent that is connected to
- 4:55
Slack. Imagine we are like working at
- 4:58
some company and we want to make an
- 5:00
Slack agent available to all of our
- 5:02
employees.
- 5:03
So if I go here into Slack then can I
- 5:06
can here in this channel for example ask
- 5:09
what is new in AI.
- 5:12
Now let's have a look at what it's doing
- 5:14
under the hood. So if I go back here, I
- 5:17
have here the restate uh UI. This is a
- 5:20
bit like a cockpit for your agents. So
- 5:22
you can see a registry of all the agents
- 5:25
that are currently registered and you
- 5:27
can also see for example which execution
- 5:29
is currently happening. So here is the
- 5:32
deep research agent that I spinned up a
- 5:34
few seconds ago. We can see what it's
- 5:37
currently doing. Now it called first an
- 5:39
LLM and then it sent me an answer via
- 5:42
Slack. This first LLM call was a planner
- 5:45
agent. So what it did is it planned the
- 5:48
research and sent me um a list of
- 5:50
subtopics that it wants to research.
- 5:53
Now if I press here approve then this
- 5:56
will unblock the workflow and will spin
- 5:58
up a set of parallel research agents. So
- 6:02
this is basically like the classical
- 6:03
deep research workflow, right? You have
- 6:05
a planner then a set of subress research
- 6:08
agents and then finally someone uh who
- 6:11
writes a report on this like a writer
- 6:13
agent
- 6:15
and so this journal you see here on the
- 6:17
left that is basically the events that
- 6:19
get sent from the agent to the restate
- 6:21
server and if this now crashes at some
- 6:24
point this journal is what will be used
- 6:27
to uh recover the execution to the point
- 6:29
where it failed. I don't know if uh
- 6:31
there were some errors. I injected a bit
- 6:34
of like tool errors in here. Yeah, here
- 6:36
you can for example see that um the sub
- 6:39
agent first did an LLM call then started
- 6:42
doing some web searches and eventually
- 6:44
uh one of the web searches didn't go
- 6:46
through because the API was down and
- 6:48
then you see here on the right how it
- 6:50
got retrieded and eventually completed
- 6:52
successfully. So instead of starting
- 6:54
over, it uses the journal to recover the
- 6:57
progress.
- 6:58
Let's now have a look at what this looks
- 7:00
like in code.
- 7:02
So the basic unit of how you implement
- 7:06
applications in restate is by writing
- 7:07
HTTP handlers and those handlers become
- 7:10
durable by using the restate SDK. So
- 7:13
here in this case we have here our deep
- 7:16
research handler and here as a first
- 7:18
argument we have a restate object
- 7:20
context and the way you can imagine that
- 7:22
is basically as that uh connection to
- 7:25
that restate server. whenever I do an
- 7:28
action on this uh restate object, it
- 7:30
will lead to an event being sent to
- 7:32
restate. So for example, when I did that
- 7:36
planner LLM call, what actually happened
- 7:39
under the hood was it executed here this
- 7:41
Python function. This is just a simple
- 7:44
light um light lm like
- 7:48
LLM call and the way I made it durable
- 7:51
is by wrapping it in restate.run.
- 7:54
So what happens is by doing these
- 7:56
durable steps if this fails somewhere
- 7:59
here two hours or two months later it
- 8:02
will recover to exactly that point.
- 8:05
So that's the idea of durable execution.
- 8:07
You're always able to recover a process
- 8:09
to where it was. You can also use that
- 8:11
for other things not necessarily for
- 8:13
failure recovery. For example, imagine
- 8:16
we want to ask a human to approve
- 8:17
something and this approval might take
- 8:20
weeks or a month. this process needs to
- 8:23
be able to um to survive restarts and
- 8:27
redeploys uh over those kind of long
- 8:29
periods of time and so with durable
- 8:32
execution you can actually also uh
- 8:34
suspend a function and let bring it back
- 8:38
when it's able to make progress. So in
- 8:40
the case of a human approval what we do
- 8:42
here is basically we we create a durable
- 8:44
promise which lives in that journal a
- 8:47
bit like a suspension point. Then we ask
- 8:51
uh a human to click that button in
- 8:53
select as I showed in the beginning and
- 8:56
while we are waiting this process
- 8:57
actually suspends. So if it's running on
- 8:59
serverless this is not using uh
- 9:02
execution uh time on our functions.
- 9:06
Once the response comes in this then
- 9:08
gets unblocked and can continue where it
- 9:10
left off. So what we see here is a bit
- 9:13
like a workflow. It's a set of steps
- 9:15
that get executed durably. But when we
- 9:18
think about agents and also the way that
- 9:20
Karpathy described it in the tweet, it's
- 9:22
more like a persistent stateful entity
- 9:24
that lives for a longer period of time
- 9:27
that has some memory. Um, so a workflow
- 9:30
is not the nicest way to model this kind
- 9:32
of thing. So the way that we can model
- 9:36
this in restate is by using something
- 9:38
called a virtual object. So imagine in
- 9:41
the use case that I'm showing this slack
- 9:43
research agent. Imagine that I don't
- 9:45
want to wait for 10 minutes to give it
- 9:48
some follow-up context or maybe I think
- 9:51
about something else that I should have
- 9:52
told it. Um I want to actually be able
- 9:54
to interact with it, not wait till that
- 9:56
research is finished before I can send a
- 9:59
follow-up.
- 10:00
And so this is basically what a virtual
- 10:03
object in restate is. It's a bit like a
- 10:05
stateful actor. It has a unique ID, for
- 10:07
example, a session ID. It has uh some
- 10:10
key value states that is isolated for
- 10:14
that specific session that you can write
- 10:16
to. Uh imagine for example your history
- 10:18
of messages and it also has like a set
- 10:21
of handlers that can execute durable
- 10:25
functions uh for this session. So here
- 10:28
the way I implemented this use case that
- 10:30
I mentioned of interacting with a
- 10:33
running process is as follows. This is a
- 10:37
um a bit a session controller. Again, it
- 10:40
has like this restate object context at
- 10:42
its disposal to do things in a
- 10:45
recoverable way. Uh it can write to this
- 10:48
session store. Here it I'm retrieving
- 10:50
the chat history.
- 10:52
And one thing that's interesting there
- 10:54
is that in order to run these kind of
- 10:56
sessions in very high uh paralyzed ways,
- 10:59
so thousands of sessions at the same
- 11:01
time, we need to make sure that agents
- 11:04
do not interfere with each other.
- 11:06
Imagine I'm sending two messages on
- 11:08
Slack and now two agents are actually
- 11:10
overwriting each other each other's
- 11:12
session state. To prevent that, this
- 11:15
will guarantee that only one execution
- 11:18
is running at a time. So a second
- 11:19
execution will be cued behind the
- 11:22
current one.
- 11:26
Then let's have a look at how we
- 11:28
implement this like interacting with
- 11:30
another execution. So an execution in
- 11:32
reset has a unique identifier and you
- 11:35
can use that identifier to connect to it
- 11:38
from other processes. for example, to
- 11:40
retrieve uh the output, but also to
- 11:43
cancel it or maybe to signal it being
- 11:46
injecting a bit of state into an already
- 11:49
running agent loop. And so this is like
- 11:52
a very flexible type of um uh
- 11:56
capabilities that you can do to
- 11:57
implement things like for example
- 12:00
signaling an already ongoing agent loop.
- 12:02
So what we do here is if there is a
- 12:04
current execution ongoing then we will
- 12:07
ask an LLM is this like something that
- 12:10
is relevant for the current agent loop.
- 12:13
If that is the case inject this via a
- 12:16
signal if it's not really relevant for
- 12:19
what we're currently doing then cancel
- 12:21
what you're currently doing and start
- 12:22
over again with this new information.
- 12:26
And so this goes a little bit further
- 12:28
than workflows. it goes a bit more
- 12:29
towards like writing persistent stateful
- 12:32
entities that can interact with each
- 12:34
other and have memory at uh their
- 12:36
disposal. So let me show you uh how this
- 12:40
works. So here if I now ask again what
- 12:42
is new in AI and I wait a few seconds
- 12:46
then it should respond again with a
- 12:48
plan. Um and then I can say for example
- 12:51
some extra info focus on frontier models
- 12:55
let's say.
- 12:59
So once I have the plan I will inject
- 13:02
that bit of extra state.
- 13:06
Now let's look at the UI of what this is
- 13:09
now doing. So here I have that
- 13:10
controller which I just showed. It
- 13:13
started calling an LLM to classify uh
- 13:16
this new input.
- 13:19
Once this comes back, it will probably
- 13:21
decide that it should signal it because
- 13:23
it's it's still relevant to the research
- 13:25
it's currently doing. So this inject
- 13:28
that new message into the ongoing agent
- 13:30
loop. So let me show you in the deep
- 13:32
research agent again. Um so first it
- 13:35
called an LLM then asked us then we
- 13:38
injected this uh new message of focus on
- 13:41
frontier models and then it uh took that
- 13:44
into account and started over again.
- 13:47
Here
- 13:49
I can now for example also say something
- 13:51
like uh forget about that
- 13:57
research AI policy.
- 14:00
And if I send this then the coord
- 14:02
coordinator will um decide to cancel the
- 14:05
ongoing run and start a new one that
- 14:08
will
- 14:10
research this new topic. And so this
- 14:12
cancellation is basically like a signal
- 14:14
that gets um sent down the stack of or
- 14:19
the call chain. So if my agent was
- 14:21
already spinning up sub agents first
- 14:23
those sub aents would be cancelled then
- 14:25
uh the controller itself and like that
- 14:28
it would basically rewind the stack and
- 14:30
give agents also the ability to roll
- 14:32
back.
- 14:34
Okay. Okay, so this went a bit more into
- 14:36
the direction of like stateful
- 14:37
persistent entities that we can interact
- 14:40
with over longer periods of time. Now
- 14:42
the last part of the demo that I want to
- 14:44
show is um going more towards like being
- 14:47
able to write highly customized
- 14:49
applications. Imagine that we deploy
- 14:51
this in production but then a few months
- 14:54
later a new model provider brings out a
- 14:56
new model for example fabulous and even
- 14:59
though the model is very good it's also
- 15:01
very expensive and we notice that this
- 15:03
research agent is actually starting to
- 15:05
cost a lot. These kind of uh things that
- 15:08
pop up halfway through a project require
- 15:12
you to then deploy a a lot of new extra
- 15:15
infra or like find a good way to solve
- 15:17
this. This is the kind of things that
- 15:18
Restate really excels at. It doesn't
- 15:21
really peg you into a specific way of
- 15:23
how you should write your application.
- 15:25
It basically gives you like a durable
- 15:27
programming model that lets you
- 15:29
implement an application in the way that
- 15:31
fits for you and also extend it if
- 15:34
necessary. So first I showed this um LLM
- 15:39
call in the first example as an inline
- 15:41
step. It was just a Python function that
- 15:44
got persisted. But imagine this use case
- 15:47
that we want to actually have a bit more
- 15:49
control over those LLM calls. For
- 15:51
example, what you can do is then pull
- 15:53
this out into its own handler.
- 15:56
And this handler can now do things like
- 15:58
for example a policy check and then uh
- 16:01
do the LLM call. And the other agents
- 16:04
instead of doing this LLM call inline
- 16:06
can now use restates like distributed
- 16:09
communication primitives to actually
- 16:11
just call this LLM gateway instead of
- 16:14
doing it as an inline step. And this
- 16:18
service fabric that lets you communicate
- 16:20
between agents also gives you some um
- 16:23
things like flow control. So we can for
- 16:25
example say one department is only
- 16:28
allowed to run 300 calls to this LLM
- 16:31
gateway at the same time. So the reason
- 16:34
why I showed this was just to show you a
- 16:36
bit like that. Uh it's basically just a
- 16:38
a resilient foundation. It makes sure
- 16:40
that your process can uh recover from
- 16:43
even a more advanced types of
- 16:45
infrastructure failures, things like
- 16:47
network partitions and zombie failures.
- 16:50
And um it gives you like tooling to
- 16:53
extend and customize as your use case
- 16:55
grows.
- 16:57
Let's go back to the slides to have a
- 17:00
little more of an idea of how this thing
- 17:03
is actually implemented on the inside
- 17:05
because it's actually a pretty
- 17:06
interesting um design or architecture.
- 17:11
So the way it's implemented is basically
- 17:13
by having a a event-driven distributed
- 17:16
log implementation.
- 17:19
So inside the box you basically on one
- 17:20
side have the clients on the other side
- 17:22
the services and inside the box is a log
- 17:26
which persists all those journal events
- 17:28
and an event loop and that event loop
- 17:30
basically gets the events from the
- 17:32
service based on what the event is. It
- 17:35
either persists some state in the
- 17:37
embedded state store or it sets a timer
- 17:40
or it sends a request to another agent.
- 17:42
And by doing that you basically have a
- 17:45
durable um foundation for whatever an
- 17:48
application is doing.
- 17:50
The design of this distributed log is
- 17:53
heavily inspired by the way that the
- 17:56
core event infra layer at meta works. Uh
- 17:59
it's basically like an iteration on top
- 18:02
of that. Um and some of those architects
- 18:04
are now have designed that for restate
- 18:07
as an more generic solution that is
- 18:10
available in open source. There are two
- 18:12
important things related to this
- 18:14
architecture that make it interesting.
- 18:16
The first one is that it works as a push
- 18:18
model. So whereas most workflow
- 18:21
orchestrators actually pull for new
- 18:23
tasks um for pull from the workflow
- 18:26
server, restate actually pushes the
- 18:29
invocations and the benefit you get from
- 18:32
that is that it has a much lower
- 18:33
latency. So you can use these kind of
- 18:36
workflow guarantees in functions around
- 18:38
your application and uh have like a
- 18:41
latencies of for example 45 milliseconds
- 18:44
p99 for like a 10-step workflow.
- 18:48
Pushing invocations also works very well
- 18:50
for serverless because they require you
- 18:53
to basically uh send the request and
- 18:56
wake up the function. So this design
- 18:59
that I show here includes everything you
- 19:02
need. It includes uh as well that state
- 19:05
store where we were embedding the state
- 19:07
as the UI. It's a single binary so it's
- 19:10
pretty easy to operate as well to run it
- 19:13
in like a highly available way. You just
- 19:15
spin it up multiple times and let it
- 19:17
snapshot to object storage.
- 19:21
So restate has six different SDKs. We
- 19:24
also have integrations for most of the
- 19:26
popular agent frameworks out there. And
- 19:30
of course, because it's just like a
- 19:32
flexible layer, you can also just use
- 19:34
any LLM SDK and implement custom agents
- 19:37
by just wrapping some steps into uh
- 19:40
these SDK constructs. So, it's open
- 19:42
source. You can self-host it. We also
- 19:44
have a BYOC offering where we deploy
- 19:47
restate in your cloud account and uh
- 19:51
that gives you the benefit that data
- 19:52
doesn't leave your cloud account.
- 19:54
Otherwise, there's also a managed cloud
- 19:56
offering.
- 19:58
This was mainly what I wanted to show.
- 20:01
If you want to explore the code a bit
- 20:02
further, there is here this the GitHub
- 20:04
repo. It's publicly available. If you
- 20:07
like the project, then have a look at
- 20:09
the restate repo itself. We are hiring
- 20:12
across the board for all sorts of roles
- 20:14
going from engineering to marketing,
- 20:16
especially also here in the Bay Area.
- 20:18
So, if you're interested in that, uh,
- 20:20
then definitely check out our careers
- 20:22
page. and I will be outside in front of
- 20:25
the conference hall here if you want to
- 20:27
ask any questions or learn more about
- 20:29
restate. Thank you very much.
- 20:47
>> [music]