HomeVideos

OpenAI + @Temporalio : Building Durable, Production Ready Agents - Cornelia Davis, Temporal

Now Playing

OpenAI + @Temporalio : Building Durable, Production Ready Agents - Cornelia Davis, Temporal

Transcript

1908 segments

0:21

I'll introduce myself in in just a

0:23

moment, but I'd like to get to know a

0:24

little bit about you. So, you know, you

0:26

can see that there's there's two brands

0:29

up on the screen here. There's OpenAI

0:32

agents SDK in particular, and there's

0:35

Temporal. I work for Temporal. I'll tell

0:37

you more about myself in just a second.

0:39

Um, I'm curious, how many folks are

0:42

using the OpenAI agents SDK today?

0:46

Okay, about a quarter of you. um

0:51

any other um a agentic frameworks?

0:56

Okay, about the same set of you. So,

0:58

it's it looks like there's a hand quite

1:00

a number of you who are not using an

1:02

agent framework just yet. So, I'll teach

1:05

you a little bit about that. Okay, next

1:07

question. How many folks are doing

1:09

anything with temporal?

1:12

Not very many. Awesome. I'm gonna get to

1:15

teach you some stuff. Um, okay, cool.

1:19

So, uh, we're going to talk today about

1:21

both those technologies. I'm going to

1:23

talk about them each independently, but

1:25

I'm going to spend a lot of time on them

1:27

together. Uh, spoiler, we actually have

1:30

an integration between the two products

1:32

that Temporal and OpenAI worked on

1:34

together. Um, and so, and and you'll see

1:38

it's it's really quite sweet. So, let me

1:41

very briefly introduce myself. My name

1:43

is Cornelia Davis. I'm a developer

1:45

advocate here at Temporal. Um I have

1:48

spent a lot of time I think the bulk of

1:50

my career has been spent in this

1:51

distributed system space. So I was super

1:54

fortunate to be at Pivotal um working on

1:57

Cloud Foundry from the early 2010s. So I

2:00

was really there during the kind of

2:01

movement toward micros service

2:03

architectures, distributed systems,

2:06

those types of things. Um any Cloud

2:08

Foundry folks in the room? Oh, just a

2:12

few. Um, so for those of you who don't

2:14

know Cloud Foundry, Cloud Foundry was um

2:17

the early the early container technology

2:20

out on the market. It was incubated as a

2:23

open- source project at VMware and it

2:26

used um uh container images, Linux

2:28

containers, container orchestration,

2:31

eventual consistency, all of that stuff

2:34

before Docker even existed and well

2:37

before Kubernetes existed. So I was very

2:40

very fortunate that I was there at the

2:42

beginning of that movement o over toward

2:45

platforms that supported this more agile

2:47

distributed systems way of doing things

2:49

and because I spent so much time in the

2:51

microservices world I also wrote this

2:53

book. Okay. So what we're going to talk

2:57

about today is we're going to talk about

2:59

the open agent a uh open AI agents SDK.

3:03

Then I'm going to give you a temporal

3:05

overview. I'm going to do lots of demos

3:07

and I'm going to show you the repos. If

3:09

you want to if you want to follow along,

3:11

you can go ahead and grab the repos.

3:14

Both of my demos I actually changed this

3:16

morning so they're sitting in branches

3:19

instead of in the main branches, but I

3:20

will make that very clear as well. Going

3:23

to do lots of demos there and then I'm

3:25

going to do uh move over to the

3:27

combination of the OpenAI agents SDK and

3:30

temporal together and we'll do more

3:32

demos there as well. And then I'm going

3:34

to talk a little bit about orchestrating

3:36

agents kind of in the general sense.

3:39

So this here is a notebook that we're

3:42

I'm not going to use today. And so I

3:46

decided I just ran this workshop earlier

3:48

this week and I decided that for the AIE

3:51

crowd it was way too basic. That said,

3:54

if you're interested, you can go there.

3:57

It will take you through. It's it's set

3:58

up with Jupyter notebooks. You can run

4:00

it in code spaces on GitHub and you can

4:04

run your first OpenAI agents SDK agent.

4:07

Then you can run your first 101 temporal

4:10

a uh not agent but temporal application.

4:13

Then you can move all the way through

4:15

the agenda that way. But it's pretty

4:17

basic and I decided that for this crowd

4:19

I wanted to do something more advanced.

4:22

So we're not going to use that today. Um

4:24

and I just crafted some of these demos

4:26

this morning. Okay. So without further

4:29

ado, this is going to be the shortest

4:30

part of the presentation is I'm going to

4:32

give you an intro to the OpenAI agents

4:34

SDK. This was launched in I think around

4:37

the May time frame or so. Um and I I'm

4:42

not going to read you these slides and

4:44

oh just so you know where we're going. I

4:46

am going to use some slides because I'm

4:47

one of those people where I think the

4:49

pictures really help. I've got lots of

4:51

diagrams in here, but we are going to

4:54

spend a lot of time stepping through the

4:56

code as well. I don't think I need to

4:58

define what an agent is. I will tell you

5:00

that that for me personally the

5:03

distinction that I make between Genai

5:06

applications and then when they get to

5:08

agents is when we give the LLM's agency

5:11

when the LLMs are the ones that are

5:12

deciding on the flow of the application.

5:14

That to me is what what an agent is. And

5:18

these frameworks like the OpenAI agents

5:20

SDK are designed to make it easier for

5:23

you to get started with those. And in

5:25

fact, we'll see that really we'll see a

5:28

contrast on that with the two major

5:30

demos that I'm going to show you today.

5:32

It's available um in both Python and

5:35

Typescript.

5:37

And here is the most basic application.

5:40

So what you see here is that we've

5:42

defined an agent. We've given it a name

5:45

and we've given it instructions and it's

5:47

taken defaults for the rest of it. Other

5:50

things things that are defaulted are

5:51

things like the model itself. I don't

5:54

know what the default is right now. And

5:56

then all you can all you need to do

5:58

after that is you basically need to run

6:00

it. And anytime you see that runner.run,

6:03

what that corresponds to is an agentic

6:06

loop. And we'll talk about the agentic

6:08

loop several times throughout the

6:10

presentation. Every time you see one of

6:12

those runner.runs, it's its own agentic

6:14

loop. And when we get to the

6:16

orchestration stuff later on, you'll see

6:18

why I make that distinction.

6:21

It also as as I said this is really

6:23

simple here but it has a lot of other

6:25

options that you can put in place into

6:27

the agent configurations that that drive

6:31

how the agentic loop works. You can have

6:34

handoffs. We will talk about those. So

6:36

I'll clarify that later. But you could

6:38

put guard rails in place. You can you

6:40

can add tools. And we're going to see

6:42

both of my examples are heavy duty on

6:45

LLM agency and it deciding which tools

6:48

to use. So, I'm going to show you tools.

6:50

So, there's a lot more that you can do

6:52

in here, and I'll show you examples of

6:54

that as we go along. And really, this is

6:57

the picture of what I'm talking about is

7:00

that every one of those runner.runs

7:02

basically has a loop that is constantly

7:04

going back to the LLM. And after the LLM

7:07

call, it decides to do things. And if

7:10

the LLM, for example, has said, I want

7:12

you to invoke some tools, it will go

7:14

ahead and invoke those tools. And then

7:16

it'll take the output from the tools and

7:18

route it back to the LLM and keep going.

7:21

And the LLM gets to decide when it's

7:23

done following the system instructions

7:26

and we'll see that. Okay. So that is the

7:30

basic um you know agent framework

7:33

overview and there's lots of a agent

7:36

frameworks out there. Okay. Since very

7:39

few of you know know temporal I'm going

7:41

to slow down a little bit here and tell

7:43

you more about temporal. So, Temporal is

7:46

an open-source project. It's been around

7:48

for about five or six years. So, yes, it

7:52

well predates the Gen AI boom that we're

7:55

in. It's designed for distributed

7:58

systems and what are AI applications if

8:02

not distributed systems? So, it turns

8:04

out that temporal is beautifully suited

8:06

for these this category of AI of use

8:09

cases. Now, it's used in a lot of nonAI

8:13

use cases. So, for example, every snap

8:18

Snapchat goes through Temporal. Every

8:20

Airbnb booking goes through Temporal.

8:23

Pizza Hut, Taco Bell orders go through

8:25

Temporal. Um, there's lots of other ones

8:28

that I'm not remembering. OpenAI Codeex

8:31

runs on Temporal. So, now we start

8:34

moving into the AI use cases. Codeex

8:36

runs on Temporal. OpenAI's image gen

8:39

runs on temporal. Those are the two I

8:41

can tell you about. Those are the two

8:42

that are publicly known. Um, so we've

8:45

got lots of others out there, lovable

8:47

runs on on temporal. So we're definitely

8:50

making, you know, inroads, lots lots of

8:52

use in the AI space. So I've told you

8:55

who's using it, but let me tell you what

8:58

it is. What it is is distributed systems

9:03

as a backing service. So I think

9:06

everybody's familiar with the notion of

9:08

Reddus as a backing service or Kafka as

9:11

a backing service or a database as a

9:13

backing service. So I've got my

9:15

applications that are running and I use

9:17

these back-end services to serve, you

9:19

know, to play a part of my application.

9:22

Temporal is a backing service. What it

9:25

delivers is distributed systems

9:27

durability.

9:28

And I'll make that clearer as we go

9:31

through the presentation. What that

9:33

means is that you as the developer get

9:36

to program the happy path. You get to

9:39

program your business logic. And the

9:42

business logic that we're going to

9:43

program today are AI agents. So you get

9:46

to say, you know what, what I want to do

9:49

is I want to call an LLM. Then I want to

9:52

take the output from the LLM and I might

9:53

want to invoke some other APIs and then

9:56

I want to loop back to the LLM. And you

9:59

don't have to build the logic in there

10:00

that says what happens if the LLM is

10:03

rate limited. What happens if my

10:05

downstream API is down for a moment?

10:08

What happens if my application crash

10:11

crashes? You don't have to program any

10:14

of that. We do it for you. And I'll show

10:16

you a few pictures on how this works in

10:18

just a moment.

10:20

So there's a a temporal service that is

10:23

the backing service. And the way that

10:25

you connect to the backing service is

10:26

through an SDK. And so the SDK sits

10:30

alongside your business logic. So you

10:32

get to program your business logic. And

10:35

the way that you craft your business

10:36

logic, you put wrappers around certain

10:39

functions. And that allows the SDK to

10:42

say, "Oh, hang on. You're making a a

10:45

downstream API call. I'm going to step

10:48

in and I'm going to provide you some

10:50

service. So I'm going to provide you

10:53

retries. If that downstream service uh

10:56

succeeds, I'm going to record that for

10:58

you. I'm going to record the answer for

11:00

you so that in in the event that

11:03

something happens and we need to go

11:05

through the flow again, I can just get

11:07

the the result that you called before.

11:10

What that means is, for example, if you

11:12

have used temporal to lend durability to

11:15

your agents, when you're on the 1,350

11:19

second turn to the LLM and your

11:22

application crashes, no sweat. We have

11:25

kept track of every single LLM call and

11:28

return and you will not be reburning

11:31

those tokens. That's what it means.

11:33

That's what durability means in this

11:35

space. We support um we formally support

11:40

seven different programming languages,

11:42

but Apple just a couple of weeks ago um

11:45

released a Swift SDK as well. So there's

11:48

support in just about any language.

11:50

There's also experimental stuff out

11:51

there in Closure, those types of things.

11:54

I said it's an open- source project. The

11:57

vast majority of it is MIT licensed. Um

12:00

there's a little bit of Apache 2 left

12:02

over from in the Java SDK. So very very

12:05

permissive licenses and um those of you

12:08

who don't know the history uh temporal

12:11

was a fork of a project that was created

12:15

out of Uber called Cadence. Anybody know

12:17

Cadence? Yeah. Okay. So a few people

12:19

know Cadence. So Cadence pretty much

12:22

every application running at Uber runs

12:24

on Cadence and it's because they can

12:26

program the happy path and all the

12:28

durability is just taken care of for

12:29

you. So that's kind of the overview of

12:32

what temporal is. So there's really kind

12:36

of I'm going to talk about two

12:37

foundational abstractions. There's a

12:39

handful of others as well, but the two

12:42

foundational abstractions that you need

12:44

to know about as a developer is you need

12:46

to know about an activity. And an

12:48

activity is just a chunk of work. This

12:52

is work that either is going to make

12:54

external calls. So it's work that might

12:57

fail. It's like a lot of work that might

13:00

fail. or if you are doing a lot of work

13:03

that you don't want to have to redo in

13:05

the event that something goes wrong, you

13:07

might want to put that in an activity as

13:09

well. So, it's things like withdrawing

13:12

from an account, depositing into an

13:14

account. We'll get to the AI use cases

13:16

in just a moment. So, those are

13:18

activities you wrap that Oh, and I

13:20

didn't mention it, but the SDKs are not

13:23

just thin wrappers that are sitting on

13:26

top of a REST API. These are SDKs where

13:29

as you can imagine be let uh delivering

13:33

durability across distributed systems

13:35

means that all of those algorithms that

13:37

you thought that you had to implement

13:40

like worry about concurrency and and and

13:43

um uh quorum and all of that stuff

13:46

that's all implemented in temporal and

13:48

so our SDKs have a lot of that logic is

13:51

in the SDK. The service is mostly

13:55

persistence for that. So there's a lot

13:57

of intelligence in the SDK.

14:00

So these activities, if you've said,

14:02

look, here's my work. Here's a heavyduty

14:05

piece of work or something that's going

14:06

external. Let's put an activity

14:09

decorator on that. Then the SDK says,

14:11

oh, okay, I'm going to give you some

14:13

special behavior. Then you orchestrate

14:16

those activities together into your

14:19

business logic. And what we call those

14:21

orchestrations is workflows.

14:24

Okay? So, and you'll see that what

14:27

happens when you put activities and

14:29

workflows together, that's where the

14:31

magic really happens. There is some

14:33

level of magic in the activities and in

14:35

fact, we're just starting to release

14:38

what we call standalone activities. So,

14:40

you'll be able to use activities without

14:41

workflows and get some of those

14:43

durability benefits there as well. So,

14:45

there's all sorts of evolution that's

14:47

happening. But the type of magic that

14:49

I'm talking about when you um bring

14:53

workflows and activities together is

14:55

that I overlaid

14:57

um a bunch of icons on here. So I

15:00

overlaid these little retry icons. So

15:04

what you do is you specify in your

15:05

workflow logic you specify the um retry

15:10

uh configuration. So you can decide are

15:13

you going to do exponential backoffs?

15:15

Are you going to do unlimited retries?

15:17

Are you going to top out at five

15:19

retries? Are you going to have a maximum

15:22

window between retries? You get to

15:24

configure all of that. And as soon as

15:26

you do that and you orchestrate these

15:27

things together, now you get retries.

15:30

And you'll see the code in just a minute

15:33

simply by calling these activities. I

15:36

don't have to implement the retry logic.

15:38

I don't have to implement any of this

15:40

other logic. It just happens for me. So

15:43

I get retries. I also get these little

15:46

cues. So what looks to you like a single

15:50

process application I'm calling this

15:52

then I'm calling this and I'm calling

15:54

this every single time you call into an

15:57

activity every time you come back from

15:59

an activity to the main workflow all of

16:02

that is facilitated over cues so that

16:05

what looks like just a single monolithic

16:08

application is already turns into a

16:10

distributed system. So you can go and

16:13

deploy a whole bunch of instances of

16:15

those and you can basically scale by

16:17

just deploying more instances of it. You

16:20

don't have to manage and I you don't

16:22

have to manage Kafka cues any of that

16:24

stuff. It's all built in. I spoke with

16:26

somebody this week here at AI Engineers

16:29

um who's who's a an open source user

16:32

actually a customer of ours and I asked

16:34

him it's a relatively small startup and

16:37

I said you know why did you pick

16:38

temporal and he said because we tried to

16:41

build all of this with Kafka cues and we

16:43

ended up spending all of our time doing

16:45

operations on Kafka and spending 25% of

16:49

our time on the business logic when we

16:51

switched over to temporal we're spending

16:54

75% of our time on business logic and

16:56

they're using temporal cloud. I didn't

16:58

mention our business model is that we

17:00

have it that that that service we offer

17:03

that as SAS. So they're using temporal

17:05

cloud. So they basically shifted from

17:08

2575

17:10

to 7525 by moving over here. No longer

17:13

have to manage Kafka cues or red reddus

17:16

or anything like that. And speaking of

17:18

Reddus, you see in the upper right hand

17:20

corner you see state management. And so

17:23

one of the things that we do as well is

17:24

we keep track of where you are in the e

17:27

execution of your application. We do

17:29

that by recording the state. Again,

17:31

every time you're making calls to an

17:33

activity and coming back, we record

17:35

that. It's basically event sourcing.

17:38

That's what we're doing. It's not only

17:40

event- driven architectures, but we're

17:42

doing event sourcing as a service. So

17:45

you you get to do that. So, we store all

17:47

of that state so that if something goes

17:49

wrong, and I'm going to demo that, we're

17:51

going to see things going wrong, um, it

17:54

will pick up where it left off because

17:56

we will just run run through the event

17:58

history and pick up where we left off.

18:02

So, those little icons that I showed

18:04

overlaid on the logical diagram, I'll

18:06

get to your question one second.

18:08

Actually, all of those services live up

18:10

here in the service. So, they're all

18:12

durable. So it's not that they're living

18:15

in the process, but they're living here

18:17

in the service. You have a question?

18:19

>> Not sure it's relevant. So a lot of the

18:22

agents I have, they handle streaming

18:25

data.

18:26

So I wanted to see if help with that.

18:29

>> Oh, great question. So yeah, so the

18:31

question was a lot of the agents that

18:33

I'm building are doing streaming. Do you

18:35

do streaming? And the answer right now

18:37

is a very simple no, we don't. But it is

18:40

one of the things. and my colleague at

18:42

the back, Johan, um is uh head of AI

18:46

engineering. Um so chat with him, chat

18:50

with either of us. It is one of the two

18:52

top priority things that we're working

18:54

on right now. Um the other one is large

18:56

payload storage. If I don't have a

18:58

chance to to talk about it here during

19:01

the workshop, come find one of us. We

19:03

can tell you about that. You can imagine

19:04

what large payload storage is. is that

19:07

you're doing LLMs, you're gonna you're

19:08

gonna passing big stuff around. Instead

19:11

of passing it around by value, pass it

19:13

by reference. That's what large payload

19:14

storage is. That's Johan.

19:16

>> I'll just mention there are a bunch of

19:18

people using workarounds.

19:20

>> True.

19:21

>> Screening in production today at scale.

19:24

So happy to talk about that, but there's

19:25

going to be more integrated solution

19:28

coming.

19:29

>> Yeah. So I ju I'm just going to repeat

19:31

what Johan said in case you you couldn't

19:33

hear it. So we do have customers that

19:35

have built streaming support on top of

19:38

temporal, but what we're doing is

19:40

building it in natively. So, yep. So,

19:43

you can do it today. It's just a little

19:45

bit more work. It's not the happy path.

19:47

So, okay. Um, so with that, uh, I want

19:52

to give you a demo. So, this is going to

19:54

be my first demo that I move over here.

19:56

Let's see if I can get my screen back.

19:58

Okay. So, if you want to follow along,

20:01

the first thing I'm going to do is I'm

20:02

going to come over here and I am going

20:04

to let me increase the font size. Um, so

20:09

I'm going to point you to two

20:10

repositories. This is actually the

20:12

second repository, but what I have up on

20:14

the screen right now is that if you want

20:17

to get started with temporal, super

20:19

simple, you don't have to use temporal

20:21

cloud. You can just run a temporal

20:23

service. So, the backing service, you

20:26

can just run it locally on your machine.

20:28

So you can do it by curling this. You

20:30

can homebrew install it as well. Um and

20:33

then to run that local server, you can

20:35

just say temporal server start dev. And

20:38

now you've got a temporal service that's

20:40

running locally. And all of my um

20:42

applications here are just connecting to

20:44

my local host. Um and we we'll see the

20:47

UI in just a moment. Um I'll come back

20:50

to this uh repository in just a moment.

20:53

The repo that I'm going to demo for you

20:55

is this one. And um sorry I don't know

20:59

how to uh increase the font size but you

21:01

can see that the org and the repository

21:04

here is the org is temporal io. That's

21:08

also where you'll find all of the open

21:10

source for temporal. Um and then we have

21:13

something called the AI cookbook and

21:16

that's one of the examples. I I I

21:19

actually extended the example just this

21:20

morning, but um and you're going to find

21:23

that um in the the branch that we're

21:27

going to demo here today is called the

21:29

agentic loop de branch. So if you want

21:33

to, you know, go back and take a look at

21:35

this later on um yourself, that's what

21:37

we're going to be looking at. Okay. So

21:40

with that, let me get to my right

21:44

terminal.

21:46

And um so this is where I'm going to run

21:50

it, but I want to show you the code

21:52

first.

21:54

Okay. So am I in the right uh

21:59

one? OpenAI. Nope. This is the wrong

22:01

one. My other cursor. Here we go. So

22:04

this is the agentic loop. So I'm doing

22:06

two demos throughout today.

22:10

And so what you see here on the left

22:12

hand side, let me make it just one tick

22:14

bigger is that remember that I talked

22:17

about activities and I talked about

22:20

workflows. So that's the first thing I'm

22:22

going to do is I'm going to show you the

22:23

activities. Remember we had withdraw and

22:26

and and uh and deposit, you know, that

22:29

type of thing. Here, of course, what

22:31

we're doing is an agentic loop. So my

22:33

activities are going to be um call the

22:38

OpenAI API, not the agents SDK yet, just

22:42

the OpenAI a um API and invoke some

22:45

tools. So these are my two activities.

22:47

So let's look at the first one and

22:49

you'll see how simple it is. I promised

22:52

you the happy path. It really is that.

22:55

So here is my call to the OpenAI

22:58

responses API. Okay, it is exactly what

23:01

you would expect. I'm passing in the

23:03

model. I'm passing in some instructions.

23:06

Um, the user input is going to come in

23:09

my tools, which I'll show you in just a

23:11

moment. And then I've got some timeouts

23:13

that I can configure there. That's for

23:14

the OpenAI.

23:16

What I've done is I've wrapped that in a

23:18

function. It takes in that request. So,

23:21

all of those parameters came from a

23:23

request that I'm passing in. And you'll

23:25

see how I invoke this in just a moment.

23:27

And here is that annotation. Now the

23:30

different SDKs have different

23:32

approaches. TypeScript for example

23:34

doesn't require a bunch of annotations.

23:36

It just figures it out. It knows where

23:39

the activities are. Java has um

23:42

annotations. Those types of things. But

23:43

this is Python. So you can see here that

23:46

we just have an activity decorator. So

23:48

by just having that decorator, so you

23:50

can see it's not complicated at all. All

23:53

you need to do as a developer is say,

23:55

"Here's a a bunch of work that I want to

23:57

do that I want to kind of encapsulate

24:00

into a step." And you just put an you

24:03

put it in a function. You put an

24:04

activity decorator on that.

24:07

So, I'll come back to the tool invoker

24:09

in just a minute because there's

24:10

something interesting that's going on

24:12

here. So, now if we go to the workflow,

24:14

the workflow is also pretty darn

24:17

straightforward. So what I have here is

24:21

I have my workflow definition. You can

24:23

see it's a class. The reason it's a

24:25

class is because there when you create a

24:28

workflow you create the application main

24:30

what I call the application main and

24:32

that's what has the workflow.run on it.

24:36

But this workflow also I'm not going to

24:38

cover these abstractions today but we

24:40

have a handful of other abstractions

24:41

like signals.

24:44

So for a running workflow, you can

24:46

signal into it and we also have an

24:49

abstraction called an update. It's a

24:51

special kind of a signal. And we also

24:53

have the analog which is queries.

24:56

So those things are added to this

24:59

workflow class as just functions that

25:01

are annotated with signal update or

25:04

query. So that's why we've got a class

25:06

for the the the workflow. And if we take

25:10

a look at what the logic is in here, you

25:12

can see that I have a while true. So

25:15

this simple application is just that

25:19

same picture that I showed you earlier

25:21

where I said the LLM is we're just

25:23

looping on the LLM. And if the LLM makes

25:26

the decision to do so, we're going to

25:28

call tools. That's the whole

25:30

application. But you're going to see

25:32

that I'm doing a couple of interesting

25:34

things with temporal here. So in order

25:37

to invoke the LLM, I execute that

25:39

activity. So you can see that I'm

25:41

passing in my model. Um the instructions

25:44

here, I I won't show it to you, but you

25:46

can see it all in the repository. The

25:48

helpful agent system instruction

25:50

basically just says you're a helpful

25:52

agent. If if you if the user says

25:55

something and you think you should be

25:56

using a tool, let me know. You know,

25:59

choose a tool. Otherwise, respond in

26:01

haikus. You'll see that in just a

26:03

moment. Like haikus are like the fooar

26:05

of the AI world, right? Ever we're all

26:08

we're all going to write agents. It's

26:09

the hello world of of the agentic space.

26:12

So we're going to respond in haikus. Um

26:16

and that's it. So we're doing this at a

26:18

while true. And I've got a couple of

26:19

print statements there. You're you're

26:20

going to see how this runs in just a

26:22

moment.

26:24

Simplifying assumption here. I'm making

26:26

the assumption that it's only calling

26:27

one tool at a time. So I'm grabbing the

26:29

output of that. And then I just take a

26:31

look at it and say, is it a function

26:33

call? And if it if it is a function

26:36

call, then I'm going to handle that

26:38

function call. I'll show you that code

26:39

in just a second. And then I'm going to

26:41

take the output from that function call

26:43

and I'm going to add it to the

26:44

conversation history. So I'm not doing

26:46

any fancy context engineering here. None

26:49

of that. I'm just basically tacking onto

26:51

the end of the conversation history.

26:53

Okay.

26:55

Now, handling the function call is

26:58

really straightforward as well. So the

27:00

first thing that I'm doing is I'm adding

27:02

the response from the LLM. So there's

27:05

we're going to by the time we're done

27:06

with this function call, we're going to

27:08

have added two things to the

27:10

conversation history. We're going to

27:12

have added the response from the LLM

27:14

which says please make a function call

27:17

and then we're going to do the function

27:18

call and then we're going to add the

27:20

result. And I just showed you where

27:21

we're adding the result of the function

27:23

call. So here, this is just me adding

27:25

that to the um and this is some of the

27:28

squirrel stuff. I'm I have this this

27:31

application running against the um

27:33

Gemini API as well. And the biggest pain

27:37

in the butt in all of this stuff is that

27:39

the formats are different. So I have to

27:42

rewrite because the JSON formats of

27:44

conversation history are different

27:45

between the different models. Yes, I

27:48

know there's um light LLM out there, but

27:50

I don't like least common denominators.

27:52

And also I like to understand what those

27:54

formats look like. So um but you can see

27:57

here that I'm just doing some ugly

27:59

parsing and then I'm executing remember

28:03

I'm handling the tool call here. I'm

28:05

executing the activity with that tool

28:08

call. So I've p pulled the tool call out

28:10

of the response from the um LLM and then

28:15

I'm going to invoke that activity which

28:17

is execute activity and the item name is

28:20

the tool.

28:22

Now one of the things that I was really

28:25

intent on here is that I didn't want to

28:27

build one aentic loop application that

28:31

does one set of tools and then have to

28:34

rebuild a whole another one when I have

28:37

a different set of tools. the agent

28:39

itself and we heard I don't remember who

28:41

talked about this but somebody talked

28:42

about this on stage this week where they

28:44

said look the agentic pattern is the is

28:48

is fairly standard and what we're doing

28:51

now is we're inserting things into this

28:54

standardized agentic loop and that's

28:56

exactly what these um AI frameworks are

28:59

doing these agent frameworks and I

29:01

wanted to do that here in the temporal

29:02

code as well the cool thing is that

29:05

temporal has something called a dynamic

29:07

activity

29:08

The dynamic activity allows you to call

29:12

an activity by name, but that that

29:15

activity is dynamically found at

29:18

runtime. So the activity handler here,

29:21

and I'm going to show you the code in

29:22

just a second, is basically going to

29:24

take in that name and say, oh, okay, I

29:27

and remember this is event driven. So we

29:30

have an activity that's waiting for

29:32

things on a queue. And so you can

29:34

configure an activity. You can configure

29:37

one of our workers to say, "Hey, this is

29:39

a worker that will basically pick up

29:41

anything off of an activity queue.

29:44

Doesn't matter what the name is." So you

29:46

don't have to tightly bind to a specific

29:49

topic name for example. Yes. Question.

29:51

>> I need in advance map which tools would

29:56

be available for the agent based on the

29:59

activity.

30:00

>> Um that is separate and I'm going to

30:03

show you that module. There's a module

30:05

here that you see that's called tools.

30:06

If you see the tools directory, the way

30:09

that I'm running it here, it is it loads

30:12

that stuff at the time that I load the

30:14

application. So, I'm not doing any

30:15

dynamic loading, but I can swap in and

30:19

out that tools module and the agentic

30:22

code does not change at all. So, I'm not

30:24

going all the way to the point where

30:26

I've implemented a registry and I'm

30:28

doing dynamic calling of those things.

30:31

You can do that, but this simple example

30:33

has basically just put that all into a

30:36

separate module. And you'll see how that

30:38

module can be switched in and out

30:39

because I'm loading it at at at um at

30:42

start of runtime. So, um simplifying,

30:46

but yes, you could do that. Okay. So,

30:49

I'm just going to call an activity. And

30:52

so, let's take a look at what that

30:54

activity looks like. It's this tool

30:56

invoker. And so you can see here that it

30:59

has the activity decorator just like I

31:01

showed you before, but now it says

31:04

dynamic equals true. So that means that

31:07

this activity handler will pick up

31:10

anything that is showing up on a queue

31:12

that isn't being picked up by some other

31:15

activity already. So it'll pick up it'll

31:18

pick up get weather. It'll pick up get

31:20

random number. It'll pick up whatever

31:22

shows up in there. You have to register.

31:25

Um, you do have to register. No, you

31:27

don't have to register all of those.

31:29

Those things can be done dynamically.

31:30

You don't have to register them into the

31:32

worker.

31:34

And what you can see here is that we

31:35

basically grab that. We get the tool

31:38

name. And then what you can see here is

31:41

that I'm effectively looking up the

31:44

function. You can see here there's no

31:46

tool names in here at all. It's

31:49

basically looking up the tool name from

31:52

a dictionary. it and it it's

31:55

metaphorically a dictionary. I'll show

31:57

you those those uh um functions in just

31:59

a second. So I have one function which

32:02

is a get tools function um which by the

32:05

way let me go back to that. So in the

32:06

open AI responses uh no sorry it's down

32:09

in the workflow when I invoke the LLM

32:13

right here. Notice that I made this get

32:16

tools call. I'll show you that get tools

32:18

call in just a second. It's completely

32:21

outside of the scope of the workflow and

32:23

the activities. It's in its own module.

32:25

I'll show you that um function in just a

32:27

second.

32:29

Okay. So, back to the tool invoker. It's

32:31

basically now taking the name and then

32:34

it's doing a get handler. So, somewhere

32:38

here is a get handler call.

32:41

Here's the handler.

32:43

>> You just passed it.

32:44

>> I just passed it. Sorry.

32:46

>> 17.

32:47

>> 17. Thank you. I appreciate it. So

32:50

here's the get handler and I'll show you

32:51

that function in just a second. So great

32:54

question on the like how tightly bound

32:56

are these things. Let me show you where

32:58

that binding is right now. So I have a

33:00

tools module here and I have in the init

33:04

is where I've got those two functions

33:06

defined. So, I've got the get tools

33:09

and the get tools are basically just

33:12

taking the list of functions and I'll

33:15

show you those functions and those

33:17

functions what we're passing in here is

33:19

we are passing in the JSON blobs that

33:22

are passed to the LLM as the tool

33:24

descriptions. So, these are the tool

33:26

descriptions. So, for example, let me

33:29

show you the get weather one. So, if we

33:31

go over here to get weather, you can see

33:33

that the um the JSON blob is right here.

33:39

And it's interesting because OpenAI

33:42

um in in the completions API, they had a

33:46

public API that allowed you to take any

33:50

function that has dock strings on it and

33:53

generate the JSON for the completions

33:55

API for the tools. The responses API has

33:59

no no such public API. So there's a

34:03

warning in here that says this API that

34:05

I'm using um which is in this tool

34:08

helper. I'll show you the tool helper.

34:12

Where is my tool helper? Uh helpers.

34:15

Here we go. I guess I could put that in

34:17

tools. Is that there's a thing in there

34:19

that says warning. There is currently no

34:22

public API to generate the JSON blob of

34:25

tools for the responses API. So I'm

34:28

using an internal one. There is an open

34:30

issue on this. So there's just a warning

34:33

in there that I'm using an internal one.

34:34

So if we go back there, I've used an

34:37

internal API to just take my get weather

34:41

alerts um request which is the uh it's a

34:46

pyantic model that has the the functions

34:48

in there and has some you know

34:51

additional metadata around it and it

34:53

generates the JSON blob. So again,

34:56

that's what you see when we go into the

34:58

agent is we that's what you're getting

35:00

with get tools is you're getting the the

35:02

the array of JSON blobs for each of the

35:05

tools. And then as I said the get

35:09

handler basically has it it's it's

35:12

basically a dictionary that I've

35:14

implemented as as a set of ifns. So it's

35:17

a takes the tool name and then it picks

35:19

up what the actual function is

35:22

completely independent. And so this

35:24

particular example has a set of and I'm

35:27

going to demo those for you in just a

35:28

second. It has a set of tools here. Um

35:31

and you can just switch those things

35:33

out. You do have to restart your Python

35:35

pro process at the moment just because

35:36

of the way that I've implemented it.

35:39

Okay. Make basic sense. All right. Let

35:42

me show you this in action.

35:46

Um and so what I've got here is I'm

35:48

running uh the worker. I'm not spending

35:51

a lot of time here talking about

35:52

workers, but you remember that I said

35:54

that this is all event driven. Um, and

35:57

so there's something that is picking up

35:59

work off of event cues and then

36:02

executing the right workflows and

36:04

activities based on what it's pulled off

36:06

of the event cues. The the um the thing

36:09

in temporal that does that is what we

36:11

call a worker. So a worker is a process

36:14

that you run. with that worker, you

36:16

register the activities and the

36:18

workflows that that worker is going to

36:19

be responsible for. So it's going to be

36:21

looking for things on the queue to pull

36:23

off of those. That worker itself is

36:25

multi-threaded. So it is not one worker

36:28

one process. Um in general people run it

36:32

depends you can do worker tuning but in

36:34

general people run several hundred

36:36

threads. So you run one worker and it's

36:39

already a a a you know concurrent

36:42

multi-threaded architecture. Okay. So

36:45

this is some solid stuff. Temporal is

36:48

just the coolest stuff. It's really

36:49

truly is distributed systems designed.

36:52

Okay. So I'm running the worker up here,

36:54

which is effectively where you're going

36:55

to see the outputs coming from the

36:57

activities and the workflows. And I'm

36:59

going to go ahead and run um run a

37:03

workflow. And so

37:06

let's say are there any weather alerts

37:10

in California? That's where I'm from.

37:13

And I think a lot of you are from and

37:15

hopefully where I will be headed back to

37:17

tonight. And so we're going to start.

37:20

And what you can see here is the way

37:22

that this application is written is

37:24

basically I I um say whether or not I'm

37:28

calling a tool. And so you can see here

37:30

that it said, oh, I made a call to get

37:32

weather alerts. Um and that is what's

37:35

happening. So there's a tool call that's

37:37

happening. And in just a moment, I

37:39

happen to know that as soon as we get a

37:41

few drops of rain in California, you

37:42

know, there's alerts all over the place.

37:45

So, here we go. Here's a whole bunch of

37:47

weather alerts in California. You'll see

37:49

why I'm I'm pointing that out. It's kind

37:51

of fun. Um, okay. Now, let me show you

37:54

what this looks like in the temporal UI.

37:59

So, over here I have the temporal UI,

38:01

and you can see that I've run a bunch of

38:02

workflows this morning. And so, let me

38:05

refresh refresh this. And this is the

38:07

one that I just ran. And what we see

38:10

here is, yep, there's all of that dense

38:12

fog advisory. That's that's about as as

38:15

extreme as we get in California. A

38:16

little bit of fog, a little bit of wind,

38:18

high surf, beach hazards. But here is

38:23

what happened. So you can see in the

38:25

temporal UI, you can see each one of

38:28

those activities that I called. You can

38:30

see that I made a call to an LLM. That's

38:33

the create line that you see on the

38:34

bottom. So we're working from bottom to

38:36

top. Then you can see that I did a

38:40

dynamic activity, but the dynamic

38:42

activity that I did in particular, it

38:44

doesn't say generic dynamic activity. It

38:46

says I did a get weather alerts. And

38:49

then as we do with agentic loops, we

38:52

take the output of the tool and we send

38:54

it back into the LLM and we get this.

38:57

Now

38:59

I want to show you something here. I'm

39:01

gonna show you a different example. So,

39:05

I'm going to ask the question, are there

39:07

any weather alerts where I'm at? So,

39:10

does it know where I'm at? And I'm going

39:12

to start this. And I'm very going to

39:14

quickly going to come over here and

39:16

we'll see this one running. And you can

39:19

see Oh, I'm going to be too slow it

39:21

looks like, but I'll I'll come back and

39:24

I'll redo this demo. But you can see how

39:25

it just it's, you know, brought those

39:27

things in. So, the other So, I have

39:30

three tools registered right now. I have

39:32

a tool that takes in a state. I have a

39:34

tool that takes in um an IP address and

39:37

returns a state. And I have a tool that

39:40

gives me an IP address for the currently

39:42

running computer. And so I didn't I

39:45

didn't wire that up that the LLM made

39:48

those decisions just based on the tools.

39:50

So all I did was I provided those tools.

39:53

But you can get that visibility across

39:55

this in temporal. So, you can see that

39:58

we started with get IP address, then we

40:00

got the location info from that IP

40:02

address, then we got the weather alerts.

40:04

And here's the ironic thing is there are

40:08

no weather alerts in New York. So, I

40:10

think of New York as a place that has

40:12

much more weather, but maybe today is

40:13

cal. You have fog, but there's no fog

40:16

advisories. So, y'all are a lot more

40:18

resilient than than the rest of us

40:20

Californians.

40:22

Okay. So, I want to show you one other

40:24

thing, which is I'm gonna come back over

40:27

here. I'm gonna run this again, and I'm

40:31

going to try to be I I can be a lot

40:33

quicker. So, I'm going to hit okay. And

40:36

now I'm going to come up here and I'm

40:39

going to control C. No workers running.

40:43

My agent is not running. It's not

40:46

running at all.

40:48

And so if we come over here and we take

40:50

a look at what this looks like in

40:51

temporal and this is going to give you

40:53

the clearest picture of what I mean by

40:55

durability and durable agents is that I

40:58

have this agent running and you can see

41:01

that it made the first LLM call. Then it

41:04

got the made the tool call to the IP

41:06

address and now it's it's stuck. It

41:11

started to call the LLM but hang on it

41:15

something went wrong. the agent itself

41:17

is not running. And by the way, I could

41:19

have also done a demo. And I don't have

41:21

the time to do all of those today, but I

41:23

could have done a demo where I cut the

41:25

the network. So I could have cut the

41:28

network. And what you would have seen

41:29

here in this little red bar is you would

41:31

have seen it. Create attempt one, create

41:34

attempt two, create attempt three. I

41:36

could have brought the network back and

41:37

then it would have gotten through. But

41:39

for brevity here, because I still want

41:40

to I still have more stuff to cover. I'm

41:43

just showing you one of the failure

41:44

scenarios. There's tons of failure

41:46

scenarios that are covered. So, I'm

41:48

going to come back over here and I'm

41:49

going to restart the worker. And what we

41:52

should see happen is, oh, sure enough,

41:55

it keeps going. So, it picked up where

41:58

it left off. Now, when I say it picked

42:00

up where it left off, of course, I

42:03

killed the process. There was nothing

42:06

running in memory anymore. So, when I

42:09

brought the worker back, it had to

42:11

reconstitute the state of the

42:12

application. It did that through event

42:15

sourcing.

42:17

So that's the way temporal works

42:19

fundamentally. Any questions on that?

42:22

Yes.

42:22

>> Can we delegate one agent to another

42:24

agent?

42:25

>> Can you delegate one agent to another

42:27

agent? Absolutely. Now we do not yet

42:30

have native support for A to A if you're

42:32

thinking about that protocol in

42:34

particular. But one of the things that

42:36

you can certainly do is that you can

42:38

have an agent act as a tool. And so

42:42

there are a number of different ways to

42:44

do that. You can either have an activity

42:46

invoke another agent or you can use some

42:49

other mechanisms. We have child

42:50

workflows and those types of things. I'm

42:52

not going to cover that more advanced

42:53

use case. But yeah, absolutely.

42:56

>> A couple of questions. One thing is the

42:58

way you are coding it. It seemed the

43:00

functions very itemed. There was like

43:02

one single line essentially. uh how to

43:06

make sure that the developers are you

43:08

know creating function so that the

43:09

retries are posing a lot so

43:14

>> second question is the latency just

43:15

added through because of the framework

43:17

>> okay I'll so first question is about

43:19

around item potence so you have

43:22

recognized that um the activity

43:26

activities themselves should be item

43:28

potent um we don't require it we don't

43:32

check on it because We really don't get

43:34

into the inner workings of the

43:35

activities. We leave that up to the

43:37

developers. Um but that is the the

43:40

guidance is that if they're not item

43:42

potent because remember that when we do

43:44

retries on your behalf, we don't know wh

43:50

why we never heard back from the first

43:52

invocation. So we are going to keep

43:54

retrying until we get back a response.

43:57

Of course it could be that the request

43:59

never made it to the activity. It could

44:01

be that it made it and it invoked the

44:03

downstream function could have gone

44:05

wrong in a number of places. So how do

44:07

you make sure that your developers are

44:08

doing uh creating your activities to be

44:11

item potent education. So we don't have

44:14

any silver bullets there. The second

44:16

question was around latency because yes

44:19

I am going up to the server here um with

44:22

every one of those activity calls and so

44:26

when we when we think about agents um we

44:30

the type of latency and Johan I don't

44:33

remember the exact numbers do you

44:34

remember what the numbers are I mean

44:36

it's tiny the latency to go up to the

44:38

server around activities

44:40

>> u so it's going to depend a bit where

44:42

the server is but it's tens of

44:44

milliseconds

44:45

>> tens of millc seconds. So it's pretty

44:47

small. Um so whether I I I think I have

44:51

heard of several customers who are using

44:53

this in quite realtime applications. But

44:56

in the case of agents, especially agents

44:58

where they're long running and they're

45:00

running over minutes, hours, days, or

45:03

they have user interaction, tens of

45:05

milliseconds is is is tolerable. So

45:07

there might be use cases where it's not

45:10

applicable because of that latency, but

45:12

it's pretty small. It's applicable in

45:14

most cases.

45:16

Okay. All right. So, that is the

45:18

temporal overview. Now, I want to switch

45:21

back over to the agents SDK now and show

45:25

you the differences and the

45:28

similarities. So, let's come back over

45:31

here. I'm going to go through a few more

45:33

pictures.

45:37

Okay. So the OpenAI agents SDK the

45:41

combination of these two things at a

45:43

very high level looks like this. At the

45:46

foundation we have the OpenAI models and

45:50

the OpenAI API not the SDK but the

45:53

OpenAI API. So you might have noticed

45:56

that I've already been using the OpenAI

45:58

API and we're now going to start using

46:00

the agents SDK. And then we also have

46:03

temporal as a foundational element. And

46:07

now that's what the agents SDK is

46:10

layered over the top. So those are two

46:12

foundational components. So it isn't

46:14

that we're making that temporal sitting

46:17

on the side or open AI models are

46:20

sitting on the side. We have actually

46:21

integrated these things and I'll make

46:23

some comments when we get to the code on

46:25

how we did that integration and I'll

46:27

totally invite Johan to add to that as

46:30

well because he led the in led the the

46:32

engineering for the integration here. So

46:34

now you've got the agents SDK and now

46:36

you're going to use the agents SDK to

46:38

build your agents to add guard rails.

46:42

We're going to I'm going to show you

46:43

some tracing. So I showed you the

46:45

temporal UI, but the agents SDK has some

46:48

really cool tracing features as well.

46:50

And you'll see that we've integrated

46:52

those things together. You're going to

46:53

see those come together. And of course

46:55

tools.

46:57

So I've been talking about these

46:59

temporal activities and we already saw

47:01

this. I'll skip that. uh skip that. Um

47:04

and so now uh we're I'm going to take

47:07

the same exact example that we just went

47:10

through. I'm going to have three tools.

47:13

One is the weather API and the other two

47:16

are those location APIs. And what are we

47:19

going to do? Well, we're going to put

47:20

activity decorators around them. And

47:23

I'll show you what that looks like in

47:24

the other codebase in just a moment. We

47:26

are going to make sure we have doc

47:28

strings in there because I showed you

47:31

how the open AAI API had the um the uh

47:37

the internal helper function that

47:39

allowed us to generate the JSON blobs to

47:41

describe the tools. Well, the agents SDK

47:44

actually does even more of that for us.

47:46

So, you'll see that some of my code went

47:48

away. Um and then uh yeah, and then

47:51

we'll we'll car continue on from that.

47:53

And then and this is going to be our

47:54

loop here.

47:56

I'm going to show you when we get to the

47:58

code that the um the way that we create

48:02

that JSON blob is part of the

48:04

integration. So you can take an activity

48:07

and we have provided for you a function

48:10

called activity as tool that will take

48:13

in the activity the function itself. So

48:15

you don't have to worry about

48:16

serializing it yourself. No internal

48:18

APIs. This is a public API. It's part of

48:21

the in the integration. and you're going

48:23

to call activity as tool which is going

48:25

to generate the um the JSON blob and

48:27

then you can have your timeouts as well.

48:30

There's another part which is really

48:32

important which is that you have to

48:35

configure the integration. So you have

48:38

to the agents SDK alone doesn't use

48:42

temporal and if you want to use temporal

48:45

you need to make sure that you include a

48:47

plugin and I'll show you the code for

48:49

that in just a second. And then of

48:52

course we're going to run it and we're

48:54

going to run it the same basic way.

48:57

Okay. So let's demo that. So we're going

49:00

to spend a lot more time in code and

49:02

demo again. Let me come back over to

49:04

cursor. Okay. So I've got four four

49:08

files that I want to show you here. I'm

49:10

going to start with the activities

49:12

again. So here's the get weather

49:14

activity and you'll see that it actually

49:16

got a bit simpler. It's just has the

49:20

activity decorator on the get weather

49:23

alerts and then here's the function

49:24

where it actually makes the the U

49:26

National Weather Service API. So there

49:29

was another there was a bit of um code

49:31

in there that was doing some formatting

49:35

where it made that API call to generate

49:37

the JSON blob that goes away because we

49:39

have a a supported function for that.

49:42

The location activities equally simple.

49:45

So literally this is the entire file. So

49:48

I've got these two functions with the

49:50

activity decorators and my dock strings.

49:54

So the doc strings are describing the

49:56

the arguments and so on. Okay. So now

50:02

what about the agent itself? So remember

50:05

activities were just the things that

50:07

those were the tools that the agent was

50:09

using. What I showed you before was an

50:11

agentic loop written in Python that was

50:15

orchestrating the LLM call and the tool

50:17

invocations.

50:19

So now if I come over to the workflow,

50:22

what does my workflow look like? This is

50:24

it.

50:26

So I have

50:28

sorry this is it. This is the workflow.

50:32

Okay. And it's basically let me increase

50:35

the font size because I have plenty of

50:37

space. is notice that I'm using the

50:40

agents SDK. So I'm defining an agent

50:43

right here on line 18. I'm giving it a

50:46

name, your helpful agent, and I'm giving

50:49

it a set of tools. Those tools were

50:52

implemented as activities.

50:55

And there you can see that I've made the

50:57

function call that says activity as tool

50:59

that generates the JSON blob.

51:02

That's it.

51:04

That's all there is to it. That's the

51:06

way I've implemented it. Now notice that

51:08

I'm still doing it within the workflow

51:10

because remember earlier I said we've

51:12

got activities, we've got workflows.

51:14

When you put them together, that's where

51:15

the magic happens. So putting this agent

51:18

inside of a workflow, that's what adds

51:21

all of these durability capabilities.

51:24

Now I am not going to demo the

51:26

non-durable version of this because

51:28

again we just have constrained time here

51:31

today. But if I had implemented this

51:34

with just the agents SDK, which is just

51:37

a Python library, I would have had a

51:39

single process. And if I killed that

51:42

process, it everything would have gone

51:44

away with it. I there's no way for me to

51:46

scale that process. And remember, I've

51:49

got an a runner.run right down here,

51:52

right? So every one of those runners I

51:55

it's just it's just a it's a monolithic

51:58

agent, right? It's just one Python

52:01

process. By doing it this way, you can

52:04

see that if I'm running multiple

52:06

workers, I can just keep scaling this

52:07

out by just running multiple workers who

52:09

are just pulling other things off of the

52:11

queue.

52:13

>> Yes.

52:13

>> Do handoffs to other agents work?

52:15

>> Do handoffs to other agents work? Yes.

52:18

And I'm going to come back to that in

52:19

the final section where we're going to

52:20

talk about orchestrations. Um, yes, they

52:23

do. Absolutely. Um, okay. So, now let me

52:28

go to uh I need to I do need to get one

52:31

other thing out of here. I need to get

52:33

my worker.

52:35

Um where is my worker?

52:42

Here's my worker.

52:47

because it's in the worker where

52:54

where's the plugin? Johan, help me out.

52:58

>> I just passed it. Oh, here we go. OpenAI

53:01

agents plugin. Okay, so it's in the

53:04

worker. Remember the worker is where all

53:06

the execution is happening. Think of it

53:08

as kind of like a logical metaphorical

53:10

container. And oftentimes you are

53:12

running the workers in containers. And

53:15

here's the configuration that you need

53:16

to put in there. It's those and notice

53:19

that it's doing things like it it is um

53:22

configuring some of the retry behavior

53:25

around the LLM. You'll notice, did you

53:28

notice that I did not give you an

53:30

activity for invoking the LLM

53:33

that's done as a part of the agent, but

53:35

we still want that to be durable. And

53:38

that's what one of the things that our

53:40

implementation does here. So you're

53:42

doing some retry policies for the LLM

53:44

and you're basically saying hey a open

53:47

AI agents SDK use these parts of

53:50

temporal.

53:52

So let me tell you a little bit about

53:54

what we did as a part of the

53:56

integration. What we did if you go back

53:59

and you look at the commit history of

54:01

the OpenAI agents SDK you'll find a

54:03

commit where it says make the runner

54:06

class abstract.

54:09

They did that for us because that's how

54:11

we imple that's how we got this

54:13

durability. That's how we were able to

54:15

make the LLM calls durable along with

54:18

all of the tools that you just saw. So

54:21

we have our own implementation of the

54:24

abstract runner class. So that is the

54:28

way that this works. Okay. So we've

54:31

looked at the activities, we've looked

54:33

at the workflow, and then we run the

54:36

tools workflow. So, I don't think

54:38

there's anything more to look at there.

54:40

So, let's go over

54:42

to

54:45

this. Um, let me find my right window.

54:51

It is this window.

54:54

Okay. So, what I'm doing in this window,

54:57

let me go ahead and increase my font

54:58

size a little bit. Is up here in the top

55:02

window. And I'm going to exit out of

55:03

these because I only need two.

55:07

Okay. So, in the top window, I'm running

55:10

my worker again. You saw that before.

55:12

So, I'm running the worker up there. And

55:15

so, it's got a little bit of, you know,

55:16

log messages that are going to come out.

55:19

And then down here is where I'm starting

55:21

the workflow. Here's where I'm

55:22

interacting with the agent. So, I'm

55:26

going to I just pushed some of this

55:28

stuff. Oh, I'll show you the the

55:29

repository in just a second. So, are

55:32

there any weather alerts in California?

55:35

And remember the code. The code is just

55:37

that agent, right? We've still

55:39

implemented our activities, but the code

55:41

is that agent and we are checking and

55:45

you can see the things that are

55:46

scrolling up there. So, you can see

55:48

actually the uh API calls to the LLM.

55:52

You can see the API call to the National

55:54

Weather Service. And so if we come back

55:56

over to the temporal

56:00

UI,

56:04

it's a different it's called tools

56:05

workflow. Here you can see it looks

56:09

exactly the same,

56:12

right? And that's why I wanted to spend

56:14

some time showing it to you with

56:16

temporal because temporal, if you're

56:17

building these temporal native

56:19

applications, you get all this

56:20

durability. You get this visibility. It

56:23

looks exactly the same, but you were

56:25

using the agents SDK to implement your

56:28

agents, which I think is just so cool.

56:30

So, let's run a second one.

56:34

And uh I'll show you the repository in

56:38

just a second. We're going to run this

56:40

second example which are are there any

56:42

weather alerts where I am. And we're

56:44

going to come over here. We'll watch it

56:46

in progress.

56:48

So here it's running.

56:50

And it's running exactly the same way.

56:54

And I'm going to run it one more time

56:56

when it comes back. And it says, "Nope,

56:58

you're good in New York." Let me run it

57:00

one more time. I'll let it get started.

57:03

Get part of the way in. Control C out of

57:06

this. And we come back here

57:12

and we see the same thing that we saw

57:14

before, right? Agents SDK durable,

57:20

which is so sweet. I I sorry I get I I

57:25

do this all the time, but I still get so

57:26

excited about this. Um

57:30

and there it goes.

57:32

I'm going to share with you like um um a

57:35

a way to think about this intuitively

57:37

what we're doing here. I've been writing

57:39

software for over 30 years. Yes, I have

57:42

the gray hair to prove it, right? I have

57:45

I have written that software where I

57:47

when I'm writing the software, I'm

57:49

thinking about the processes that it

57:51

runs in. I'm thinking about the fact

57:54

that oh I've got a process here and what

57:56

happens if something happens to that

57:57

process or as I'm scaling things out and

58:00

things might not run in the same

58:01

processes I'm always thinking about

58:04

processes

58:05

with temporal what you get to do is you

58:08

get to write your program thinking about

58:10

a process as a logical entity and just

58:14

let temporal map it down to the actual

58:17

physical processes that are there. This

58:19

is particularly

58:22

it it's it's so cool to look at when you

58:24

do things like human in the loop. So

58:26

earlier this week I did another I've

58:28

done another I another one of the talks

58:30

that I do is around human in the loop

58:31

with agents and one of the big pains of

58:35

human in the loop is that when you're

58:37

thinking about building these things and

58:39

you're thinking about the processes

58:41

you're like okay I need to run for a

58:43

little while and now I'm going to wait

58:44

for the human in the loop and it might

58:46

take a second it might take a minute

58:48

likely it's going to take hours or days

58:51

before this human comes back. What do I

58:53

do with that process that's waiting for

58:55

that response in the meantime? Like you

58:58

as a developer have to figure that out.

59:00

With temporal, you don't. You just code

59:03

it as if that process. And by the way,

59:06

the way that the worker architecture

59:08

works is that if it's waiting on

59:11

something like human input,

59:13

it it'll keep it in memory for a little

59:15

while, few seconds, then it'll take it

59:18

out of active memory, but it's still

59:20

sitting in a cache. And after a little

59:22

bit more time, it'll come out of the

59:24

cache and it'll be just as if you had

59:27

just killed that process. So that when

59:29

it does come back after days or weeks,

59:32

when the user comes back and gives you

59:33

that input, it just reconstitutes memory

59:37

the way that it was when it was waiting

59:38

for the user and continues on. So

59:42

remember I said it's a crash or it might

59:43

be other things, operational things, all

59:46

of those types of things. So, it's so

59:49

freeing once you start to really get

59:51

into this temporal thing. It is so

59:53

freeing to realize that I don't have to

59:56

think about physical processes anymore.

59:58

To me, the processes are just logical.

60:00

Temporal takes care of the rest for me.

60:03

Super cool stuff. All right, we have

60:06

about uh 20 minutes left. I'm going to

60:10

go through just a couple more slides to

60:12

answer one of the questions around

60:13

handoffs.

60:15

um and just show you just a little bit

60:18

more content and then we're we'll have a

60:20

little bit of time in the last I don't

60:22

know maybe 10 you know 10 or 15 minutes

60:24

I'm happy to take more questions and

60:26

Johan would be I'm sure very happy to to

60:29

jump in as well. Okay. So, let me

60:34

So, um

60:37

there are with the OpenAI agents SDK.

60:40

This is what I'm talking about here is

60:42

somewhat specific to the agents SDK, but

60:44

this does kind of generalize to agents

60:48

in general, which is with the open AI

60:51

agents SDK. The kind of paradigm that

60:54

they use there is to build lots of small

60:57

agents that have their own independent

61:00

agentic loops and then orchestrate them

61:03

together. And there's two ways that you

61:06

can orchestrate them together in the

61:07

agents SDK. And I'm going to show you

61:10

both of those in just a moment. So what

61:12

we see here on the screen are just a

61:14

couple of diagrams of like, okay, I've

61:18

got a triage agent. I've got a

61:20

clarification agent. Then I've got a

61:22

human in the loop. That's not an agent.

61:24

Although you might think of the human as

61:27

the agent in this application, right?

61:30

Then I've got an instructions agent

61:32

that's going to craft some stuff. Then

61:34

I've got a planning agent. Then you can

61:35

see that we're doing things in parallel.

61:37

I didn't talk about this, but temporal

61:40

has all those abstractions. You can

61:42

anything that you can write in a regular

61:44

programming language, you want to do

61:47

multi-threaded and have a bunch of

61:49

different threads and do things in

61:50

parallel and then wait for them to come

61:52

back together. You can do that. You want

61:54

to have some kind of an await that says,

61:56

you know what, as they start coming in,

61:58

I'll start processing them. No problem.

62:00

You can do that. Anything that you can

62:02

do in code, you can do with temporal

62:04

because you're just coding. So that's

62:07

effectively the way that it works here

62:08

with the agent SDK as well. Um I'll show

62:11

you those things again as well. So you

62:13

can do parallel, you can have long

62:15

weights. Um and you can have loops. So I

62:19

already showed you the fact that I

62:21

didn't have to craft my logic in the

62:25

Python. The logic the LLM made the

62:28

decisions on how the flow was going to

62:29

happen in that application. Right? So I

62:32

just had a loop that the loop itself is

62:35

like fixed, but what happens in the loop

62:37

is entirely determined by the LLM. So

62:40

that those are all things that you can

62:42

do. So there's two ways with the agents

62:45

SDK that you can orchestrate these

62:47

microaggents. And by the way, I just

62:50

have to say I love the term microaggent.

62:52

As I mentioned early on, um I uh I spent

62:56

a lot of time in the microservices world

62:58

and oh my gosh, did we get a lot of

63:00

mileage out of that, right? That's the

63:03

reason that we can deploy software

63:04

multiple times a day. That's the reason

63:06

why we can scale the way we can scale.

63:09

Microservices have proven themselves to

63:11

be very valuable. we I think we're going

63:14

to see a very similar paradigm, very

63:17

similar success when it comes to

63:19

building AI agents, MCP tools, and all

63:21

of that kind of stuff. So, I love the

63:23

the notion of microaggents that do one

63:26

thing and one thing well. I've spent

63:27

enough time in the land of Unix as well

63:30

that makes my heart sing.

63:32

So, just code and handoffs. The just

63:35

code is really simple. It's what I

63:37

described um before. So, you can see

63:39

here that I have a runner.run. I'm

63:41

executing an agent. I get back a result

63:44

from that agent and I pass that result

63:46

into the next agent. I can parallelize,

63:50

I can loop, I can do whatever I want.

63:53

The second way that Oh yeah, and I

63:56

already showed all that. Um, so yeah.

63:59

Yeah, I I mentioned all of those

64:01

already. Um, the second uh uh way that

64:05

Open AAI and were you talking about Open

64:06

AI specifically when you were asking

64:08

about handoffs? Yeah. So for those of

64:10

you who don't know, OpenAI has a second

64:13

way of doing orchestrations which are

64:15

called handoffs. And so what you see

64:17

here is that in my definition of an

64:19

agent, I can define handoffs. Those

64:22

handoffs are other agents. They've been

64:25

defined. I probably should have it on

64:27

the slide, but I have a weather agent

64:29

that is defined very similarly. It's

64:31

using agent has a name, has

64:34

instructions, might have tools.

64:37

So these two are agents.

64:40

Um and all of this works with the the

64:42

the e the integration with with um

64:45

temporal and but what's interesting here

64:48

is that those microaggents when it hands

64:51

off to an agent it is not doing a

64:55

separate agentic loop. it effectively

64:58

and this is my wacky attempt at trying

65:02

to describe what's happening here is

65:04

that when you do a handoff what you're

65:06

effectively doing is just changing the

65:08

context of the agentic loop so the a

65:12

there's one single agentic loop you have

65:15

a triage agent for example it decides

65:18

that it's going to go into delivering I

65:21

worked at Alexa for a while so did you

65:23

ask how late is Costco open or did you

65:25

ask what the current temperature is

65:27

right. So those are two different

65:28

agents, the weather and the local info

65:31

agent. And what you're effectively doing

65:33

is you are that that agentic loop is

65:36

taking on a different persona. You're

65:38

just switching the context. And we heard

65:40

lots of talks this week about context

65:42

engineering because that's the beautiful

65:44

thing about the LLMs being forgetful is

65:46

that you can just you can completely

65:47

control what you want, what the context

65:50

is that's going into them. So this works

65:52

exactly. So temporal is totally handoff.

65:55

I don't have a live demo of that. Um,

65:58

and so that's it. Okay. So, with that,

66:01

we're going to have a few minutes left

66:02

for questions. I want to leave you with

66:05

a few resources. So, what you see here

66:08

on the um left hand side is you see a QR

66:12

code for the uh temporal Python SDK.

66:18

You'll find lots of great info on our

66:20

Python SDK, but you'll also find a

66:22

contrib directory and that's where all

66:25

of the integration code to the OpenAI

66:28

agents SDK is. And you'll find lots of

66:31

samples in there. On the right hand

66:33

side, I didn't have a QR code for it

66:36

because my marketing folks don't work on

66:38

Saturday mornings. Good for them. Um, is

66:41

you will see a URL UR URL here. So, if

66:45

you go to our documentation, so

66:46

docs.temper temporal.io. At in the top

66:49

banner, you'll find AI cookbook. We have

66:51

an AI cookbook that implements a bunch

66:54

of patterns. The one that I showed you

66:56

today, the Agentic Loop, is in a um

66:59

branch at the moment. It is ready to be

67:01

merged. It's been reviewed, but my

67:03

reviewer didn't actually give it an

67:05

approval review. They just reviewed it

67:07

and said, "Looks good, but I need an

67:09

approved, so I couldn't merge it this

67:10

morning." Um, but that uh recipe will be

67:13

up there. And there's a number of

67:14

others. There's a recipe in there for

67:16

OpenAI agents SDK. So you'll find that

67:18

in there as well. Um, so summing it up,

67:22

I don't I'm not going to belabor that. I

67:24

think we went over that as well. Two

67:26

other resources that I want to leave you

67:28

with is on the left hand side you'll

67:30

find our blog where we describe the

67:33

integration of the OpenAI agents SDK and

67:36

Temporal. So that's the blog on the left

67:38

hand side. The other thing you'll notice

67:41

is that that I have a paidantic blog

67:43

there. And so this idea of in bringing

67:47

durability to these otherwise

67:49

non-durable a you know agent frameworks

67:52

is a very popular one. So after we did

67:55

open AAI agents SDK pyantic themselves

67:59

integrated temporal into their agent

68:01

framework and Johan do you I I don't

68:04

know which ones we can talk about. We

68:06

have a whole bunch of other ones in

68:08

progress. Is that all we want to say or

68:10

do you want to talk about any of those

68:11

in specific? That's that's all for

68:13

today, but there's more coming.

68:14

>> Yeah, I think we have two or three or

68:17

four that are in progress right now that

68:20

will be popping out either from us or

68:22

from some of the other agentic

68:24

frameworks. So, this idea of bringing

68:27

durability to what is otherwise kind of

68:29

just a a proof of concept tool is is

68:33

turning out to be quite powerful. And

68:35

then finally, if you would be so

68:37

inclined, here's a QR code and a URL. If

68:40

you want to give us some feedback on

68:42

this workshop, we'd really appreciate

68:44

it. Um, and include in that feedback.

68:47

There's some free form in there. Include

68:49

in that feedback what you'd like to see

68:51

more of. Like, hey, this was cool, but

68:54

it didn't go far enough or you mentioned

68:56

this. I'd really I'd really like to see

68:58

more about Human in the Loop. By the

69:00

way, if you go on our YouTube channel,

69:01

you will find a bunch of different

69:04

presentations. So, the human in the

69:06

loop, I did a webinar on that like three

69:08

weeks ago. We've done some MCP module,

69:10

MCP things, even advanced. So, we did an

69:13

advanced one where where we showed you

69:15

how you can use temporal to implement an

69:17

MCP server that is durable and supports

69:20

sampling and elicitation in a much more

69:23

durable way than it otherwise is. Um,

69:27

and with that, we still have now about

69:30

eight minutes. Um, so, oh, I'll also

69:33

mention, especially if you're in the Bay

69:35

Area, but if you even if you're not, is

69:38

that our conference, our replay

69:40

conference, the temporal conference, um,

69:42

is in May and it's going to be at

69:45

Moscone. And so, we sure would love to

69:47

see you there as well. And oh, I you

69:50

know this this QR code here was meant

69:53

for the workshop that I did on Tuesday,

69:55

but heck, might as well use it here. 75%

69:59

off. Yes, 75% off the registration um

70:04

for uh replay. So, invite you to come

70:07

there. You'll find me, you'll find

70:09

Johan, you'll find a whole bunch more of

70:11

us. And you can see that we've got all

70:12

sorts of really cool people like Samuel

70:14

Coven is coming and we've got like

70:17

people from Replet and Nvidia and lots

70:21

more coming. So I'll leave the feedback

70:23

up there. So we have a few minutes left

70:25

for questions.

70:27

>> Yes.

70:28

>> Um how state saved temporal

70:30

>> how is state saved?

70:31

>> You shut down the server it just loses

70:33

all memory of all the workers.

70:36

>> Yeah. Okay. So you're talking about the

70:38

temporal server that I showed you how

70:39

you can run it locally. So when you're

70:41

running it locally, you can put a switch

70:42

on there that says, "Hey, store it in a

70:44

like SQL light or something like that."

70:47

So you can there is there's state that

70:49

backs it. I usually don't run that way

70:52

because I want to throw away things

70:53

anyway. Um,

70:56

so Temporal is open source and we have

70:59

lots of users that self-host it. Because

71:01

it's open source, we literally at events

71:03

like this always run into people. I ran

71:05

into somebody yesterday or something who

71:07

was like, "Oh yeah, we're using

71:09

Temporal." And I'm like, and they're

71:10

just using the open source. Um, so it's

71:13

it truly is open- source. Um, and so we

71:16

do have people who are self-hosting it

71:18

and we support relational database and

71:20

Cassandra as the backing stores on

71:22

temporal cloud. Part of the reason that

71:25

um that people come to cloud is that

71:28

first of all, we run cloud in 15

71:30

different Amazon regions. Uh I don't

71:33

know four, five, six Google regions. We

71:36

have multi-reion namespaces. All of that

71:38

durability. And then we do also have

71:40

some special sauce on the persistence

71:43

that allows us to do things more

71:44

efficiently. Um uh but we have people

71:47

who are hosting it quite quite

71:49

successfully using the Cassandra or the

71:51

database options. So yeah,

71:56

any other questions? Yes.

71:58

>> Start and stop the agents.

72:00

>> When I start and stop the instance the

72:02

agent you mean? I mean how do we stop it

72:05

if the user wants to stop it

72:08

>> the work so

72:09

>> the workflow

72:10

>> yeah

72:12

um so there there are a couple of

72:14

different ways that you can start a

72:16

workflow you can start a workflow

72:17

expecting it to be you know synchronous

72:19

and it just ends and you would have to

72:20

have some kind of a kill on that but

72:22

more commonly you're going to start it

72:24

in an async mode and you're going to get

72:26

back a handle and then you can do things

72:28

against that handle to stop workflows.

72:31

Um but generally the the most common

72:33

thing is that you are going to define in

72:35

your logic what it means to have

72:38

completed that agentic experience or

72:40

completed that workflow in some way

72:42

shape or form. And so you will decide oh

72:45

I'm done now and you'll just return. So

72:48

it's really as simple as doing a return

72:50

from it. It's that's a good question

72:52

though since we're talking about these

72:53

asynchronous things. I didn't talk about

72:55

it in this session, but one of the

72:57

really powerful things is that these

72:59

workflows can run for hours, minutes,

73:01

days, weeks, months, years, and it's

73:04

super efficient. And what we what a

73:07

pattern that a lot of our users use is

73:09

they use it they use a workflow as kind

73:12

of a digital twin of something else. We

73:15

call it entity workflows as well. So,

73:18

for example, you might have a workflow

73:20

that corresponds to a loyalty customer

73:25

and every time that loyalty customer

73:27

scans their QR code at the checkout

73:29

register, it'll send a signal into the

73:32

workflow and the workflow is otherwise

73:34

not consuming any resources and it will

73:37

just pop up, take the signal, process

73:39

what it needs to and go away again. So

73:42

that is a very very common pattern is

73:44

this notion of digital workflows as

73:46

digital twins of some um other processor

73:50

some other entity. Super super powerful.

73:53

Lots of people use that.

73:55

>> Yes.

73:56

>> Another one.

73:56

>> Yeah.

73:57

>> Um so if work goes down and you've got

74:00

it like in that block state where it's

74:02

just sitting,

74:03

>> how do you guys have any kind of

74:05

integration with like incident

74:06

management things that would like

74:07

trigger an alert so that engineer can

74:10

come in the worker? Yeah. So we we as

74:14

far as I know we do not have those

74:15

integrations but we our customers build

74:18

those integrations.

74:19

>> Yeah. Yeah. They absolutely build those

74:21

on top. Whether we have some of those in

74:23

cloud I'm not sure but it isn't

74:25

something like we don't have like native

74:27

Slack connectors or those types of

74:29

things. And some of that of course

74:31

wouldn't necessarily be a temporal

74:33

thing. Like if you're running your

74:34

workers on Kubernetes, you might have um

74:38

set up your Kubernetes configuration so

74:40

that when the when the um when the

74:42

container goes down, you're going to get

74:44

alerts or when you see something in the

74:46

Kubernetes dashboard where oh gosh, like

74:48

my autoscaler and of course you can have

74:50

these workers and you you can have them

74:52

running in on Kubernetes with

74:54

autoscalers. So a lot of that or you

74:57

know that like it orchestration stuff

75:00

probably would come through your

75:01

operational environment. Um you are

75:04

that's actually a really good point is

75:05

that we host the server but we do not

75:07

host the workloads for you. So you're

75:10

hosting the work workloads yourself.

75:12

Most people love that because they want

75:14

complete control over that. We are

75:16

toying with the idea in some instances

75:19

of maybe hosting workers in the future

75:20

but that's nothing on the road map right

75:23

now.

75:24

So yes,

75:26

>> examples of people building like voice

75:29

agents with temporal or

75:31

>> examples of people building voice agents

75:33

with temporal. I don't know of any

75:35

offhand.

75:37

I

75:37

>> I don't know of any that are deployed.

75:40

Um people are experimenting with it.

75:42

We're experimenting with voice agents.

75:44

Um and it's definitely something that

75:46

that makes sense. That's one of the

75:49

places where we expect agents to go in

75:50

the future.

75:51

>> Yep. Yes. question in the back.

76:02

>> So, I do not have Claude up in keep an

76:05

eye on the cookbook. I do not have

76:06

examples for Claude just yet. Um, I have

76:10

Gemini almost done. Um, and yeah, we

76:13

want to we want to add Claude to the the

76:14

cookbook as well. We'll also happily

76:17

take PRs. So if you want to take this

76:18

example and map it over to to Claude,

76:21

we'd love to have PRs on that as well.

76:23

So yeah, this this is the cookbook is

76:25

all open source. It's all in MIT

76:28

licensed in our main repository, our

76:30

main org.

76:33

>> Yes.

76:34

>> Any example agents on extracting

76:36

information from Excel, PDF?

76:39

>> Example agents of extracting from Excel

76:41

or PDF? I don't have any personally.

76:44

um you know we one of the other things

76:46

that I'll mention is that we have a code

76:48

exchange so we have um the cookbook is

76:51

ours and that's where we're very we're

76:53

very careful about making sure that it

76:56

demonstrates best practices and we we do

76:59

rigorous reviews on those because we

77:01

don't want to mislead you at all. We

77:03

also have a code exchange which we have

77:05

literally I think 20 or 30 or 40

77:08

examples in there. There might be

77:10

something in there. I'm I'm honestly not

77:12

sure. Um, yeah.

77:14

>> Is it like a GitHub?

77:15

>> Yes, it is. So, you'll find the code

77:17

exchange on our website and all and I

77:20

believe all of the entries in the code

77:22

exchange have GitHub URLs. We don't own

77:25

most of them um because they're from the

77:27

community, but they're in other people's

77:28

repositories. So, yeah, you would find

77:31

that.

77:36

>> All right. Well, this has been Oh, is

77:39

there another question? No, I I just

77:40

want to comment that uh we've mentioned

77:42

a few times that's coming or that would

77:44

be really really cool to do and um you

77:47

know uh my team is hiring uh for folks

77:51

>> the hiring plug

77:52

>> on these AI applications of temporal.

77:55

>> Okay. And since he said that I am a I'm

77:57

in developer advocacy. We're looking for

77:59

developer advocates too. So if you fit

78:02

the engineer profile talk to Johan. If

78:04

you fit the developer advocate profile

78:06

come talk to me.

78:08

So, okay. Well, thank you so much.

Interactive Summary

Ask follow-up questions or revisit key timestamps.

Cornelia Davis from Temporal introduced herself and the focus of the presentation: the integration of OpenAI agents SDK and Temporal. She highlighted that many developers are not yet using agent frameworks or Temporal. Temporal is an open-source backing service designed to provide durability for distributed systems, allowing developers to program the "happy path" of their business logic, such as AI agents, without worrying about retries, crashes, or scaling. Key Temporal concepts include Activities (chunks of work that might fail) and Workflows (orchestrating activities). Notable AI applications like OpenAI's Codeex and image generation, and Lovable, already leverage Temporal. The integration between OpenAI agents SDK and Temporal allows for building durable AI agents, where Temporal ensures LLM calls and tool invocations within an agent's loop are robust and recoverable, even from application crashes, using a custom runner and an `activity as tool` function. This approach treats processes as logical entities, freeing developers from managing physical process concerns, especially beneficial for long-running workflows or human-in-the-loop scenarios. The presentation also touched upon orchestrating micro-agents using "just code" or "handoffs" within the agents SDK. Future plans include native streaming support and large payload storage, with ongoing integrations with other agent frameworks.

Suggested questions

8 ready-made prompts