Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate

Read the talk

The reliable agent stack: durable execution, stateful sessions, and control

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 272 seconds
The reliable agent stack: durable execution, stateful sessions, and control

Giselle van Dongen explains how Restate supports long-running agents through journal-based recovery, suspended approval waits, isolated session state, and communication with work already in progress.

From a talk by Giselle van Dongen

At a glance

Ideas worth remembering

  • Reliable agents require more than an agent loop: durable progress, consistent session state, distributed communication, and deliberate execution control address separate infrastructure problems.

  • The journal supports both failure recovery and intentional suspension. The search demo recovers progress after a tool error, while a durable promise preserves a human-approval wait without consuming serverless function execution time during suspension.

  • Session IDs isolate persistent state, and execution IDs make individual runs addressable. Together they let a controller preserve conversation history while signaling or cancelling ongoing work.

  • The controller's LLM chooses between adding context and replacing a run. Signaling does not establish that all prior work is retained, and cancellation through the call chain does not establish automatic reversal of completed external effects.

  • A shared LLM gateway creates a boundary for policy checks and flow control. The example's 300 simultaneous calls per department limits concurrency; it does not define a total spending cap.

  • Restate's distributed log and event loop coordinate state, timers, and service requests. Push-based invocation supports serverless activation and is presented as a latency advantage, but the reported 45-millisecond p99 for a 10-step workflow comes without benchmark conditions.

From question answering to persistent agents

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 123 seconds
From question answering to persistent agents

Giselle van Dongen begins with the infrastructure needed to run agents reliably in production. She describes three waves of interaction: a website that answers a question after a few seconds, an application that uses tools with a user's involvement, and persistent asynchronous agents that run inside an organization's infrastructure. In the third wave, agents become long-running processes with access to tools, other agents, and organizational context.

That progression changes what the surrounding system must do. Agent SDKs and memory help developers get started, but connecting distributed parts of an organization also requires infrastructure for retries and recovery. These mechanisms become necessary when a process holds state, runs for a long time, and crosses service boundaries. Van Dongen introduces Restate as an open-source durable foundation for backends, including agents, with ideas drawn from Apache Flink and the architects behind Meta's event infrastructure.

0:120:14
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:12 · section reference included

Four responsibilities beneath the agent

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 218 seconds
Four responsibilities beneath the agent

The foundation has four responsibilities. Durable execution lets an agent recover after a failure without losing a week's progress. Session management keeps state consistent while thousands of sessions run concurrently. Communication connects agents to other agents, MCP servers, and tools. Execution control lets an operator stop work that is stuck or should no longer continue. Recovery and cancellation therefore serve different purposes: one preserves wanted work through failure, while the other ends work deliberately.

Restate runs as a separate server in front of the agent service, resembling a proxy or message broker. It receives a request and pushes it to the service, opening a connection that van Dongen describes as the agent's lifeline. As the agent performs work, it sends events to Restate. Those events form a journal used to recover the process after failure. The intended programming experience is an ordinary function that can run durably, retain state, and continue over long periods.

The demonstration puts that foundation beneath a research agent connected to Slack. The scenario is a company making an agent available to its employees, so the infrastructure must support both the research process and the conversations around it.

2:492:51
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

2:49 · section reference included

A research workflow survives a failed search

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 379 seconds
A research workflow survives a failed search

Van Dongen asks the Slack agent what is new in AI, then opens Restate's UI to inspect the execution. The UI lists registered agents and active invocations. The research agent first calls an LLM as a planner and sends a list of proposed subtopics back through Slack. Approval unblocks the workflow and launches parallel research agents; a writer agent later produces the report. This separates planning, human authorization, research, and synthesis into distinct stages.

The execution journal makes progress and failures visible. Van Dongen has injected tool errors: a subagent calls an LLM, begins web searches, and encounters a search that fails because the API is down. She points to its retry and eventual successful completion. The journal supports recovery of the accumulated progress, allowing the failed operation to complete without restarting the entire research run. This example demonstrates recovery from a tool failure; it does not establish that every failure will eventually become recoverable.

5:035:06
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

5:03 · section reference included

Making a function step durable

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 459 seconds
Making a function step durable

In code, the basic application unit is an HTTP handler made durable through the Restate SDK. The deep research handler receives a Restate context as its first argument. That context represents the connection to the server: operations through it generate events sent to Restate. Durability is therefore introduced through the SDK operations used by the handler.

The planner's LLM call is a Python function wrapped in restate.run. Van Dongen presents this wrapper as the boundary that makes the step durable. By expressing work as durable steps, the process can recover its progress even if failure occurs two hours or two months later. Her claim concerns recovery to the recorded execution point; the example does not specify how an external provider call is handled if failure occurs between its completion and recording its result.

6:587:00
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

6:58 · section reference included

Waiting for a human without keeping a function running

Durable execution also supports intentional pauses. A human approval might take weeks or a month, during which the service may restart or be redeployed. The research process must preserve its place across those events. Restate represents the wait with a durable promise stored in the journal, creating a suspension point that can outlive the active function execution.

After requesting the button click, the process suspends while waiting. Van Dongen says that on serverless infrastructure this consumes no function execution time during the wait. When the response arrives, the promise unblocks and the process continues where it left off. The stated benefit is avoiding an active serverless function for the duration of human deliberation; it is not a claim that storing and operating the durable wait has no infrastructure cost.

8:118:13
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

8:11 · section reference included

Modeling a session as a stateful actor

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 679 seconds
Modeling a session as a stateful actor

A sequence of durable steps resembles a workflow, but van Dongen argues that an agent often fits a persistent stateful entity better. It has memory and remains available for interaction over time. In the Slack example, a user should be able to add context while research is underway, rather than wait 10 minutes for completion before sending a follow-up.

Restate's virtual object supplies that model. It behaves like a stateful actor with a unique identifier, such as a session ID, isolated key-value state, and handlers that execute durable functions for the session. Message history is one example of the stored state. The demo's session controller uses its Restate context to retrieve chat history and perform recoverable operations against the session store.

Isolation between sessions is only part of the consistency problem. Two messages in the same Slack conversation could otherwise start agents that overwrite each other's session state. In the controller example, Restate permits one execution at a time and queues a second behind it. This preserves orderly state updates within a session while allowing many separate sessions to run concurrently. The tradeoff is that a later execution for that session waits for the current one.

9:139:15
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

9:13 · section reference included

Sending context to work already in progress

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 812 seconds
Sending context to work already in progress

An execution also has its own unique identifier. Other processes can use it to retrieve the output, cancel the execution, or signal it with additional state. This gives the session controller a way to communicate with a research run that is already active, instead of treating every incoming message as an unrelated request.

The controller implements an application decision on top of that communication mechanism. If a run is ongoing, it asks an LLM whether the new input is relevant to the current agent loop. Relevant input is injected through a signal; input judged unrelated causes cancellation and a new run. Restate provides the control primitives, while the LLM determines which path this application takes. The talk does not establish the classifier's accuracy or explain how ambiguous follow-ups are handled.

For the live example, van Dongen asks again what is new in AI and adds a request to focus on frontier models once the plan arrives. The controller calls an LLM to classify the input, and she describes the new message being injected into the research loop. The research agent takes that context into account and starts over again. The account leaves the scope of that repetition unclear: signaling reaches the ongoing loop, but it does not establish exactly which planning or research work is repeated.

11:2611:28
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

11:26 · section reference included

Cancelling through the call chain

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 837 seconds
Cancelling through the call chain

Van Dongen next changes the request to research AI policy. She describes the coordinator cancelling the current run and starting another for the new topic. Cancellation propagates as a signal through the call chain: if the agent has spawned subagents, those are cancelled before the controller itself. This unwinds the active stack and gives agents an opportunity to roll back. The explanation does not establish that completed external side effects are automatically reversed, so ending execution and undoing its effects remain distinct concerns.

13:4913:51
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

13:49 · section reference included

Moving model calls into a shared gateway

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 993 seconds
Moving model calls into a shared gateway

The final application example addresses a requirement that appears after deployment: a new model is good but expensive, and research costs begin to rise. Van Dongen uses this scenario to explain why the durable programming model should allow the application to evolve. An LLM call initially implemented as an inline Python step can move into its own handler when it needs more centralized control.

That handler becomes an LLM gateway. It can perform a policy check before making the model call, and other agents use Restate's distributed communication primitives to invoke it. Flow control can then constrain access to the shared service: her example allows a department to run 300 gateway calls at the same time. This is a concurrency limit, rather than a stated total-spend budget. It supplies a place to enforce policy and bound simultaneous work without embedding the same controls in every agent.

Van Dongen presents the broader foundation as supporting recovery from advanced infrastructure failures, including network partitions and zombie failures, while providing tools for customization as requirements grow. These are stated reliability capabilities; this part of the presentation does not show their failure-detection or recovery protocols.

14:3414:37
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

14:34 · section reference included

The distributed log underneath the programming model

Selected presentation frame from Every step you take, every call you make: the reliable agent stack — Giselle van Dongen, Restate at 1060 seconds
The distributed log underneath the programming model

Inside Restate, an event-driven distributed log persists journal events between clients and services. An event loop receives service events and responds according to their type: it persists state in an embedded store, sets a timer, or sends a request to another agent. These operations connect the execution journal to the application's state, waiting points, and distributed calls. Van Dongen describes the log design as an iteration on Meta's core event infrastructure, generalized into an open-source system.

A central architectural choice is pushing invocations to services. Van Dongen contrasts this with workflow workers polling a server for tasks and attributes lower latency to the push model. She gives an example of 45 milliseconds at p99 for a 10-step workflow. The presentation supplies no benchmark conditions, so that number is an illustrative reported result rather than a general latency guarantee. Pushing also suits serverless functions, which wake when a request arrives.

The server packages the state store and UI in a single binary. Van Dongen describes a highly available deployment as running multiple instances and snapshotting to object storage. This reduces the number of separate infrastructure components the developer must assemble, although her overview does not detail replication, coordination, or restoration behavior.

16:5717:00
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

16:57 · section reference included

Integration and deployment choices

Van Dongen closes with the ways developers can adopt the foundation. She reports six SDKs and integrations with popular agent frameworks. Custom agents can also use an LLM SDK directly and wrap selected steps in Restate's SDK constructs. The integration approach leaves the agent implementation flexible while introducing durable boundaries around its work.

Deployment options include open-source self-hosting, a bring-your-own-cloud offering that deploys Restate into the customer's cloud account, and a managed cloud offering. Van Dongen identifies keeping data inside that account as a benefit of the bring-your-own-cloud option. These choices concern where the Restate layer operates; the presentation does not describe data handling by external tools or model providers.

She ends by pointing attendees to the publicly available demo code and Restate repository, mentioning roles across engineering and marketing, including in the Bay Area, and inviting questions outside the conference hall. The presentation concludes with thanks and closing music.

19:2119:24
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

19:21 · section reference included

Read the complete timestamped transcript
  1. 0:12

    Hi everyone. This talk will be about how

  2. 0:14

    to run agents reliably in production. It

  3. 0:17

    will not be about the eile part, but it

  4. 0:19

    will be about all the other things you

  5. 0:22

    need to get going in order to run agents

  6. 0:24

    resiliently. So the infrastructure layer

  7. 0:27

    basically. I want to set the scene with

  8. 0:30

    this uh quote of Andre Apathy of last

  9. 0:32

    week. It describes that the way we

  10. 0:34

    interact with agents and LLMs has been

  11. 0:37

    evolving in three waves. The first wave

  12. 0:40

    was an LLM being something like a

  13. 0:42

    website where we go to we ask it a

  14. 0:44

    question, it thinks for a few seconds

  15. 0:47

    and then gives us a response. The second

  16. 0:49

    wave was going towards agents. It was an

  17. 0:52

    app that we download to our computer. It

  18. 0:54

    has some tools at its disposal and it

  19. 0:57

    can do some work with our interaction.

  20. 1:00

    Now the third wave will be going more

  21. 1:02

    and more towards persistent and

  22. 1:04

    asynchronous entities. So agents being

  23. 1:07

    longunning processes in our

  24. 1:09

    infrastructure with access to tools and

  25. 1:12

    other agents around the organization and

  26. 1:14

    context.

  27. 1:17

    And so as our use cases are evolving

  28. 1:19

    more and more from single agents to

  29. 1:21

    agentic platforms that connect parts

  30. 1:24

    around uh the organization our

  31. 1:26

    infrastructure layer should also evolve

  32. 1:28

    with that. So when we look at the types

  33. 1:31

    of tools that are currently out there to

  34. 1:33

    implement agents, a lot of innovation

  35. 1:35

    has been done on sites such as agent

  36. 1:37

    SDKs and memory. And agent SDKs are

  37. 1:41

    really cool to implement PC's and get

  38. 1:44

    started quickly, but they don't

  39. 1:46

    necessarily help with like connecting

  40. 1:47

    the distributed bits around an

  41. 1:49

    organization.

  42. 1:51

    And if you want to implement more

  43. 1:53

    complex agentic systems, you actually

  44. 1:56

    need all of those things. So that is the

  45. 1:58

    layer that you see below here where um

  46. 2:01

    you have to deploy extra infrastructure.

  47. 2:03

    Uh you need to write things like retry

  48. 2:05

    logic, recovery logic and all of that is

  49. 2:08

    actually pretty complex to get right but

  50. 2:11

    completely necessary to run longunning

  51. 2:13

    stateful and distributed processes in

  52. 2:15

    production.

  53. 2:17

    So today I want to talk about an

  54. 2:19

    open-source framework called restate.

  55. 2:21

    And you can see it a bit as a flexible

  56. 2:23

    durable foundation that lets you build

  57. 2:26

    any backend. So it's not specific for

  58. 2:28

    agents but a as agents are also just a

  59. 2:32

    type of a backend uh it also works well

  60. 2:34

    for them. The ideas behind restate come

  61. 2:37

    from Apache Flink which is a popular

  62. 2:40

    distributed stream processing engine and

  63. 2:42

    also from some of the exarchitects

  64. 2:45

    behind Meta Score event infra.

  65. 2:49

    So what are the ingredients in restate?

  66. 2:51

    Basically four parts. First of all, it

  67. 2:54

    makes sure that a single run of an agent

  68. 2:56

    is resilient. This is called durable

  69. 2:59

    execution in the industry. Think about

  70. 3:02

    things like when an agent runs for a

  71. 3:04

    week and then crashes. We want to be

  72. 3:06

    able to bring it back and let it

  73. 3:08

    continue exactly at the point where it

  74. 3:10

    failed. We don't want it to start over

  75. 3:12

    from the beginning.

  76. 3:14

    Another um area here is running many

  77. 3:18

    concurrent sessions in parallel. Imagine

  78. 3:20

    running thousands of concurrent agent

  79. 3:22

    sessions at the same time and needing

  80. 3:24

    needing to make sure that state is

  81. 3:26

    always consistent and that different

  82. 3:28

    agents don't interfere with each other.

  83. 3:31

    And then going more towards things like

  84. 3:33

    communication between agents, between

  85. 3:35

    agents and MCP servers and other tools.

  86. 3:38

    And finally also control, making sure

  87. 3:40

    that when an agent for example uh is

  88. 3:43

    doing um something you don't want it to

  89. 3:45

    continue or when it's stuck being able

  90. 3:47

    to actually cancel or kill the

  91. 3:48

    execution.

  92. 3:51

    So the way that you can think of it is

  93. 3:53

    as follows. Restate is basically a

  94. 3:55

    server which runs in front of your agent

  95. 3:58

    service. So as a separate component it

  96. 4:00

    sits there a bit like a like a message

  97. 4:02

    broker or a proxy and when there's a

  98. 4:05

    request for your agent restate proxies

  99. 4:07

    the request to the service and pushes it

  100. 4:10

    to the service basically and from that

  101. 4:12

    moment there's a connection open

  102. 4:15

    connection between restate and the agent

  103. 4:17

    and that connection will basically be a

  104. 4:19

    bit like a lifeline for the agent. So as

  105. 4:21

    the agent is doing stuff, it sends

  106. 4:24

    events over to restate and restate will

  107. 4:27

    use that journal of events to recover

  108. 4:29

    the process after a failure.

  109. 4:33

    So from a slightly higher level um

  110. 4:35

    explanation, you could say that it's

  111. 4:37

    turning a normal function in your

  112. 4:39

    application into something that is long

  113. 4:41

    running, durable, and stateful without

  114. 4:44

    having to do um a lot of the complex

  115. 4:46

    things you otherwise need to do for

  116. 4:48

    this. So my talk today will be mainly a

  117. 4:51

    demo. So I'll be showing you um a

  118. 4:54

    research agent that is connected to

  119. 4:55

    Slack. Imagine we are like working at

  120. 4:58

    some company and we want to make an

  121. 5:00

    Slack agent available to all of our

  122. 5:02

    employees.

  123. 5:03

    So if I go here into Slack then can I

  124. 5:06

    can here in this channel for example ask

  125. 5:09

    what is new in AI.

  126. 5:12

    Now let's have a look at what it's doing

  127. 5:14

    under the hood. So if I go back here, I

  128. 5:17

    have here the restate uh UI. This is a

  129. 5:20

    bit like a cockpit for your agents. So

  130. 5:22

    you can see a registry of all the agents

  131. 5:25

    that are currently registered and you

  132. 5:27

    can also see for example which execution

  133. 5:29

    is currently happening. So here is the

  134. 5:32

    deep research agent that I spinned up a

  135. 5:34

    few seconds ago. We can see what it's

  136. 5:37

    currently doing. Now it called first an

  137. 5:39

    LLM and then it sent me an answer via

  138. 5:42

    Slack. This first LLM call was a planner

  139. 5:45

    agent. So what it did is it planned the

  140. 5:48

    research and sent me um a list of

  141. 5:50

    subtopics that it wants to research.

  142. 5:53

    Now if I press here approve then this

  143. 5:56

    will unblock the workflow and will spin

  144. 5:58

    up a set of parallel research agents. So

  145. 6:02

    this is basically like the classical

  146. 6:03

    deep research workflow, right? You have

  147. 6:05

    a planner then a set of subress research

  148. 6:08

    agents and then finally someone uh who

  149. 6:11

    writes a report on this like a writer

  150. 6:13

    agent

  151. 6:15

    and so this journal you see here on the

  152. 6:17

    left that is basically the events that

  153. 6:19

    get sent from the agent to the restate

  154. 6:21

    server and if this now crashes at some

  155. 6:24

    point this journal is what will be used

  156. 6:27

    to uh recover the execution to the point

  157. 6:29

    where it failed. I don't know if uh

  158. 6:31

    there were some errors. I injected a bit

  159. 6:34

    of like tool errors in here. Yeah, here

  160. 6:36

    you can for example see that um the sub

  161. 6:39

    agent first did an LLM call then started

  162. 6:42

    doing some web searches and eventually

  163. 6:44

    uh one of the web searches didn't go

  164. 6:46

    through because the API was down and

  165. 6:48

    then you see here on the right how it

  166. 6:50

    got retrieded and eventually completed

  167. 6:52

    successfully. So instead of starting

  168. 6:54

    over, it uses the journal to recover the

  169. 6:57

    progress.

  170. 6:58

    Let's now have a look at what this looks

  171. 7:00

    like in code.

  172. 7:02

    So the basic unit of how you implement

  173. 7:06

    applications in restate is by writing

  174. 7:07

    HTTP handlers and those handlers become

  175. 7:10

    durable by using the restate SDK. So

  176. 7:13

    here in this case we have here our deep

  177. 7:16

    research handler and here as a first

  178. 7:18

    argument we have a restate object

  179. 7:20

    context and the way you can imagine that

  180. 7:22

    is basically as that uh connection to

  181. 7:25

    that restate server. whenever I do an

  182. 7:28

    action on this uh restate object, it

  183. 7:30

    will lead to an event being sent to

  184. 7:32

    restate. So for example, when I did that

  185. 7:36

    planner LLM call, what actually happened

  186. 7:39

    under the hood was it executed here this

  187. 7:41

    Python function. This is just a simple

  188. 7:44

    light um light lm like

  189. 7:48

    LLM call and the way I made it durable

  190. 7:51

    is by wrapping it in restate.run.

  191. 7:54

    So what happens is by doing these

  192. 7:56

    durable steps if this fails somewhere

  193. 7:59

    here two hours or two months later it

  194. 8:02

    will recover to exactly that point.

  195. 8:05

    So that's the idea of durable execution.

  196. 8:07

    You're always able to recover a process

  197. 8:09

    to where it was. You can also use that

  198. 8:11

    for other things not necessarily for

  199. 8:13

    failure recovery. For example, imagine

  200. 8:16

    we want to ask a human to approve

  201. 8:17

    something and this approval might take

  202. 8:20

    weeks or a month. this process needs to

  203. 8:23

    be able to um to survive restarts and

  204. 8:27

    redeploys uh over those kind of long

  205. 8:29

    periods of time and so with durable

  206. 8:32

    execution you can actually also uh

  207. 8:34

    suspend a function and let bring it back

  208. 8:38

    when it's able to make progress. So in

  209. 8:40

    the case of a human approval what we do

  210. 8:42

    here is basically we we create a durable

  211. 8:44

    promise which lives in that journal a

  212. 8:47

    bit like a suspension point. Then we ask

  213. 8:51

    uh a human to click that button in

  214. 8:53

    select as I showed in the beginning and

  215. 8:56

    while we are waiting this process

  216. 8:57

    actually suspends. So if it's running on

  217. 8:59

    serverless this is not using uh

  218. 9:02

    execution uh time on our functions.

  219. 9:06

    Once the response comes in this then

  220. 9:08

    gets unblocked and can continue where it

  221. 9:10

    left off. So what we see here is a bit

  222. 9:13

    like a workflow. It's a set of steps

  223. 9:15

    that get executed durably. But when we

  224. 9:18

    think about agents and also the way that

  225. 9:20

    Karpathy described it in the tweet, it's

  226. 9:22

    more like a persistent stateful entity

  227. 9:24

    that lives for a longer period of time

  228. 9:27

    that has some memory. Um, so a workflow

  229. 9:30

    is not the nicest way to model this kind

  230. 9:32

    of thing. So the way that we can model

  231. 9:36

    this in restate is by using something

  232. 9:38

    called a virtual object. So imagine in

  233. 9:41

    the use case that I'm showing this slack

  234. 9:43

    research agent. Imagine that I don't

  235. 9:45

    want to wait for 10 minutes to give it

  236. 9:48

    some follow-up context or maybe I think

  237. 9:51

    about something else that I should have

  238. 9:52

    told it. Um I want to actually be able

  239. 9:54

    to interact with it, not wait till that

  240. 9:56

    research is finished before I can send a

  241. 9:59

    follow-up.

  242. 10:00

    And so this is basically what a virtual

  243. 10:03

    object in restate is. It's a bit like a

  244. 10:05

    stateful actor. It has a unique ID, for

  245. 10:07

    example, a session ID. It has uh some

  246. 10:10

    key value states that is isolated for

  247. 10:14

    that specific session that you can write

  248. 10:16

    to. Uh imagine for example your history

  249. 10:18

    of messages and it also has like a set

  250. 10:21

    of handlers that can execute durable

  251. 10:25

    functions uh for this session. So here

  252. 10:28

    the way I implemented this use case that

  253. 10:30

    I mentioned of interacting with a

  254. 10:33

    running process is as follows. This is a

  255. 10:37

    um a bit a session controller. Again, it

  256. 10:40

    has like this restate object context at

  257. 10:42

    its disposal to do things in a

  258. 10:45

    recoverable way. Uh it can write to this

  259. 10:48

    session store. Here it I'm retrieving

  260. 10:50

    the chat history.

  261. 10:52

    And one thing that's interesting there

  262. 10:54

    is that in order to run these kind of

  263. 10:56

    sessions in very high uh paralyzed ways,

  264. 10:59

    so thousands of sessions at the same

  265. 11:01

    time, we need to make sure that agents

  266. 11:04

    do not interfere with each other.

  267. 11:06

    Imagine I'm sending two messages on

  268. 11:08

    Slack and now two agents are actually

  269. 11:10

    overwriting each other each other's

  270. 11:12

    session state. To prevent that, this

  271. 11:15

    will guarantee that only one execution

  272. 11:18

    is running at a time. So a second

  273. 11:19

    execution will be cued behind the

  274. 11:22

    current one.

  275. 11:26

    Then let's have a look at how we

  276. 11:28

    implement this like interacting with

  277. 11:30

    another execution. So an execution in

  278. 11:32

    reset has a unique identifier and you

  279. 11:35

    can use that identifier to connect to it

  280. 11:38

    from other processes. for example, to

  281. 11:40

    retrieve uh the output, but also to

  282. 11:43

    cancel it or maybe to signal it being

  283. 11:46

    injecting a bit of state into an already

  284. 11:49

    running agent loop. And so this is like

  285. 11:52

    a very flexible type of um uh

  286. 11:56

    capabilities that you can do to

  287. 11:57

    implement things like for example

  288. 12:00

    signaling an already ongoing agent loop.

  289. 12:02

    So what we do here is if there is a

  290. 12:04

    current execution ongoing then we will

  291. 12:07

    ask an LLM is this like something that

  292. 12:10

    is relevant for the current agent loop.

  293. 12:13

    If that is the case inject this via a

  294. 12:16

    signal if it's not really relevant for

  295. 12:19

    what we're currently doing then cancel

  296. 12:21

    what you're currently doing and start

  297. 12:22

    over again with this new information.

  298. 12:26

    And so this goes a little bit further

  299. 12:28

    than workflows. it goes a bit more

  300. 12:29

    towards like writing persistent stateful

  301. 12:32

    entities that can interact with each

  302. 12:34

    other and have memory at uh their

  303. 12:36

    disposal. So let me show you uh how this

  304. 12:40

    works. So here if I now ask again what

  305. 12:42

    is new in AI and I wait a few seconds

  306. 12:46

    then it should respond again with a

  307. 12:48

    plan. Um and then I can say for example

  308. 12:51

    some extra info focus on frontier models

  309. 12:55

    let's say.

  310. 12:59

    So once I have the plan I will inject

  311. 13:02

    that bit of extra state.

  312. 13:06

    Now let's look at the UI of what this is

  313. 13:09

    now doing. So here I have that

  314. 13:10

    controller which I just showed. It

  315. 13:13

    started calling an LLM to classify uh

  316. 13:16

    this new input.

  317. 13:19

    Once this comes back, it will probably

  318. 13:21

    decide that it should signal it because

  319. 13:23

    it's it's still relevant to the research

  320. 13:25

    it's currently doing. So this inject

  321. 13:28

    that new message into the ongoing agent

  322. 13:30

    loop. So let me show you in the deep

  323. 13:32

    research agent again. Um so first it

  324. 13:35

    called an LLM then asked us then we

  325. 13:38

    injected this uh new message of focus on

  326. 13:41

    frontier models and then it uh took that

  327. 13:44

    into account and started over again.

  328. 13:47

    Here

  329. 13:49

    I can now for example also say something

  330. 13:51

    like uh forget about that

  331. 13:57

    research AI policy.

  332. 14:00

    And if I send this then the coord

  333. 14:02

    coordinator will um decide to cancel the

  334. 14:05

    ongoing run and start a new one that

  335. 14:08

    will

  336. 14:10

    research this new topic. And so this

  337. 14:12

    cancellation is basically like a signal

  338. 14:14

    that gets um sent down the stack of or

  339. 14:19

    the call chain. So if my agent was

  340. 14:21

    already spinning up sub agents first

  341. 14:23

    those sub aents would be cancelled then

  342. 14:25

    uh the controller itself and like that

  343. 14:28

    it would basically rewind the stack and

  344. 14:30

    give agents also the ability to roll

  345. 14:32

    back.

  346. 14:34

    Okay. Okay, so this went a bit more into

  347. 14:36

    the direction of like stateful

  348. 14:37

    persistent entities that we can interact

  349. 14:40

    with over longer periods of time. Now

  350. 14:42

    the last part of the demo that I want to

  351. 14:44

    show is um going more towards like being

  352. 14:47

    able to write highly customized

  353. 14:49

    applications. Imagine that we deploy

  354. 14:51

    this in production but then a few months

  355. 14:54

    later a new model provider brings out a

  356. 14:56

    new model for example fabulous and even

  357. 14:59

    though the model is very good it's also

  358. 15:01

    very expensive and we notice that this

  359. 15:03

    research agent is actually starting to

  360. 15:05

    cost a lot. These kind of uh things that

  361. 15:08

    pop up halfway through a project require

  362. 15:12

    you to then deploy a a lot of new extra

  363. 15:15

    infra or like find a good way to solve

  364. 15:17

    this. This is the kind of things that

  365. 15:18

    Restate really excels at. It doesn't

  366. 15:21

    really peg you into a specific way of

  367. 15:23

    how you should write your application.

  368. 15:25

    It basically gives you like a durable

  369. 15:27

    programming model that lets you

  370. 15:29

    implement an application in the way that

  371. 15:31

    fits for you and also extend it if

  372. 15:34

    necessary. So first I showed this um LLM

  373. 15:39

    call in the first example as an inline

  374. 15:41

    step. It was just a Python function that

  375. 15:44

    got persisted. But imagine this use case

  376. 15:47

    that we want to actually have a bit more

  377. 15:49

    control over those LLM calls. For

  378. 15:51

    example, what you can do is then pull

  379. 15:53

    this out into its own handler.

  380. 15:56

    And this handler can now do things like

  381. 15:58

    for example a policy check and then uh

  382. 16:01

    do the LLM call. And the other agents

  383. 16:04

    instead of doing this LLM call inline

  384. 16:06

    can now use restates like distributed

  385. 16:09

    communication primitives to actually

  386. 16:11

    just call this LLM gateway instead of

  387. 16:14

    doing it as an inline step. And this

  388. 16:18

    service fabric that lets you communicate

  389. 16:20

    between agents also gives you some um

  390. 16:23

    things like flow control. So we can for

  391. 16:25

    example say one department is only

  392. 16:28

    allowed to run 300 calls to this LLM

  393. 16:31

    gateway at the same time. So the reason

  394. 16:34

    why I showed this was just to show you a

  395. 16:36

    bit like that. Uh it's basically just a

  396. 16:38

    a resilient foundation. It makes sure

  397. 16:40

    that your process can uh recover from

  398. 16:43

    even a more advanced types of

  399. 16:45

    infrastructure failures, things like

  400. 16:47

    network partitions and zombie failures.

  401. 16:50

    And um it gives you like tooling to

  402. 16:53

    extend and customize as your use case

  403. 16:55

    grows.

  404. 16:57

    Let's go back to the slides to have a

  405. 17:00

    little more of an idea of how this thing

  406. 17:03

    is actually implemented on the inside

  407. 17:05

    because it's actually a pretty

  408. 17:06

    interesting um design or architecture.

  409. 17:11

    So the way it's implemented is basically

  410. 17:13

    by having a a event-driven distributed

  411. 17:16

    log implementation.

  412. 17:19

    So inside the box you basically on one

  413. 17:20

    side have the clients on the other side

  414. 17:22

    the services and inside the box is a log

  415. 17:26

    which persists all those journal events

  416. 17:28

    and an event loop and that event loop

  417. 17:30

    basically gets the events from the

  418. 17:32

    service based on what the event is. It

  419. 17:35

    either persists some state in the

  420. 17:37

    embedded state store or it sets a timer

  421. 17:40

    or it sends a request to another agent.

  422. 17:42

    And by doing that you basically have a

  423. 17:45

    durable um foundation for whatever an

  424. 17:48

    application is doing.

  425. 17:50

    The design of this distributed log is

  426. 17:53

    heavily inspired by the way that the

  427. 17:56

    core event infra layer at meta works. Uh

  428. 17:59

    it's basically like an iteration on top

  429. 18:02

    of that. Um and some of those architects

  430. 18:04

    are now have designed that for restate

  431. 18:07

    as an more generic solution that is

  432. 18:10

    available in open source. There are two

  433. 18:12

    important things related to this

  434. 18:14

    architecture that make it interesting.

  435. 18:16

    The first one is that it works as a push

  436. 18:18

    model. So whereas most workflow

  437. 18:21

    orchestrators actually pull for new

  438. 18:23

    tasks um for pull from the workflow

  439. 18:26

    server, restate actually pushes the

  440. 18:29

    invocations and the benefit you get from

  441. 18:32

    that is that it has a much lower

  442. 18:33

    latency. So you can use these kind of

  443. 18:36

    workflow guarantees in functions around

  444. 18:38

    your application and uh have like a

  445. 18:41

    latencies of for example 45 milliseconds

  446. 18:44

    p99 for like a 10-step workflow.

  447. 18:48

    Pushing invocations also works very well

  448. 18:50

    for serverless because they require you

  449. 18:53

    to basically uh send the request and

  450. 18:56

    wake up the function. So this design

  451. 18:59

    that I show here includes everything you

  452. 19:02

    need. It includes uh as well that state

  453. 19:05

    store where we were embedding the state

  454. 19:07

    as the UI. It's a single binary so it's

  455. 19:10

    pretty easy to operate as well to run it

  456. 19:13

    in like a highly available way. You just

  457. 19:15

    spin it up multiple times and let it

  458. 19:17

    snapshot to object storage.

  459. 19:21

    So restate has six different SDKs. We

  460. 19:24

    also have integrations for most of the

  461. 19:26

    popular agent frameworks out there. And

  462. 19:30

    of course, because it's just like a

  463. 19:32

    flexible layer, you can also just use

  464. 19:34

    any LLM SDK and implement custom agents

  465. 19:37

    by just wrapping some steps into uh

  466. 19:40

    these SDK constructs. So, it's open

  467. 19:42

    source. You can self-host it. We also

  468. 19:44

    have a BYOC offering where we deploy

  469. 19:47

    restate in your cloud account and uh

  470. 19:51

    that gives you the benefit that data

  471. 19:52

    doesn't leave your cloud account.

  472. 19:54

    Otherwise, there's also a managed cloud

  473. 19:56

    offering.

  474. 19:58

    This was mainly what I wanted to show.

  475. 20:01

    If you want to explore the code a bit

  476. 20:02

    further, there is here this the GitHub

  477. 20:04

    repo. It's publicly available. If you

  478. 20:07

    like the project, then have a look at

  479. 20:09

    the restate repo itself. We are hiring

  480. 20:12

    across the board for all sorts of roles

  481. 20:14

    going from engineering to marketing,

  482. 20:16

    especially also here in the Bay Area.

  483. 20:18

    So, if you're interested in that, uh,

  484. 20:20

    then definitely check out our careers

  485. 20:22

    page. and I will be outside in front of

  486. 20:25

    the conference hall here if you want to

  487. 20:27

    ask any questions or learn more about

  488. 20:29

    restate. Thank you very much.

  489. 20:47

    >> [music]