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.

Recording frame at 123 seconds
Recording frame at 123 seconds

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.

0:120:42
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 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.

Recording frame at 218 seconds
Recording frame at 218 seconds

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.

How it fits togetherThe journal is the recovery path

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.

2:423:12
Suggest correction

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

2:42 · section reference included

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.

8:128:42
Suggest correction

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

8:12 · section reference included

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.

Recording frame at 680 seconds
Recording frame at 680 seconds

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.

9:129:42
Suggest correction

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

9:12 · section reference included

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.

Recording frame at 813 seconds
Recording frame at 813 seconds

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.

How it fits togetherRouting a follow-up into an active session

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.

11:2711:57
Suggest correction

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

11:27 · section reference included

Move shared model controls into a gateway

Production requirements rarely stop changing after the first deployment. If a newly adopted model is good but expensive, an inline LLM call offers no convenient place for organization-wide controls. Restate’s programming model allows that call to move from a local Python step into a separate handler without changing the broader durable-execution model.

Recording frame at 994 seconds
Recording frame at 994 seconds

That handler becomes an LLM gateway. It can run a policy check before calling the provider, while agents invoke it through Restate’s distributed communication primitives. Flow control can then limit one department to 300 simultaneous calls. This bounds concurrency rather than total spending, but it creates one enforceable location for policy and capacity controls instead of duplicating them across every agent.

Van Dongen also presents the foundation as able to recover from infrastructure failures such as network partitions and zombie failures. Those capabilities are stated here rather than demonstrated; the demo’s directly observable recovery case is the failed web-search retry.

14:5715:27
Suggest correction

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

14:57 · section reference included

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.

Recording frame at 1060 seconds
Recording frame at 1060 seconds

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.

How it fits togetherFrom journal event to durable effect

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.

16:5717:27
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

Resources

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]