正在加载视频...

视频加载失败

don't use loops, design state machines

221,789 次观看 • 3 个月前 •via X (Twitter)

60 条评论

David 的头像
David3 个月前

do this today at

David K 🎹 的头像
David K 🎹3 个月前

What does the state machine for this example look like?

David 的头像
David3 个月前

My version actually don't use a full deterministic state machine, I want to keep the flexibility of AI with minimal guardrails:

Ilko Kacharov 的头像
Ilko Kacharov3 个月前

Hot take: it's not loops vs state machines, it's both. The state machine defines what "done" looks like; the loop is the engine that grinds until it gets there. No loop = agent stalls mid-task. No state machine = it loops forever toward nothing. Winners design both.

David 的头像
David3 个月前

Agreed, but that's not catchy and doesn't go viral 😂

Brian Via 的头像
Brian Via3 个月前

We’re inventing computer science from first principles

David 的头像
David3 个月前

😂 just slowly moving up the ladder of abstraction

David 的头像
David3 个月前

A loop is just a state machine with 2 states 😅

David 的头像
David3 个月前

😂

patark 的头像
patark3 个月前

sir this is a kanban board /s

duet 的头像
duet3 个月前

🪩🪩🪩

Daniel 的头像
Daniel3 个月前

🤯🤯🤯this looks insanely powerful! 2026 -- what a year 🚀🚀 reworking stack for 3rd time in 10 days 😵‍💫

David 的头像
David3 个月前

Give it a try at and tell me how it goes! Happy to give you some free credits :)

Jason Szesze 的头像
Jason Szesze3 个月前

Sweet @duetchat

David 的头像
David3 个月前

@duetchat Niceeeee

Mustafa Kirac 的头像
Mustafa Kirac3 个月前

It's n8n all over again 🤔

David 的头像
David3 个月前

Na, it's not a workflow engine actually, it's just the bare minimum guardrails. All workflow logic is done by agent / codegen

Sense Noped Out 的头像
Sense Noped Out3 个月前

this is what he meant. same same

David 的头像
David3 个月前

yup agreed. just adding a tangible example

Rob Schaper 的头像
Rob Schaper3 个月前

State machines can be designed to run in a loop, they can also act like a DAG with an outcome certain. For example, you can have four state machines in a loop, made of four DAGs, each run updates an S3 bucket, which has a trigger to run the next state machine, etc... Cheers.

Relex Legal 的头像
Relex Legal3 个月前

Each state should be a loop until successfully state changed

David 的头像
David3 个月前

@relexyou Yup, our custom harness has this guarantee

Rick Wong 的头像
Rick Wong3 个月前

State machines and workflows are amazing, but do you think humans should spend time focusing on those, or do you see a trajectory where the models are advance enough to manage both of those internally? Older solutions like zapier/make.com/n8n were heavy on workflows/states, but many realized how adept the models are becoming at managing those things internally. If you look at the design of claude's /workflow, you'll see it is actually far from what most people consider "workflow" -- they leap frogged quite a few steps ahead.

Mek 的头像
Mek3 个月前

Claude Fable 5? Please add it to the platform as soon as possible.

David 的头像
David3 个月前

On it 🫡

David 的头像
David3 个月前

FYI: you may need to wait a bit for everyone's sandbox to get upgraded. If you're impatient, feel free to go into the files tab and click on "Reboot gateway". Just note that it'll terminate all currently running sessions if you do that.

Kenn 的头像
Kenn3 个月前

Would love to give it a try

David 的头像
David3 个月前

Nice, sign up at and shoot me a DM if you want more free credits

Shaun Sheikh 的头像
Shaun Sheikh3 个月前

Very cool

David 的头像
David3 个月前

Thanks! Give it a try at :)

Enterprise Software Architecture 的头像
Enterprise Software Architecture3 个月前

👀 I’ve already ascended to recursive state-loop machines by design.

Will 的头像
Will3 个月前

Don't design state machines, build hyper structures

Farshad Taheri 的头像
Farshad Taheri3 个月前

Yea, this been there for sometimes and not working plus too slow

David 的头像
David3 个月前

What do you mean?

Farshad Taheri 的头像
Farshad Taheri3 个月前

Have you used it for any actual/real complex workflow?

D 的头像
D3 个月前

how's duet make money? bulk token arb?

David 的头像
David3 个月前

we run our own inference stack for certain models

D 的头像
D3 个月前

Ah yes, got it. Thx!

Manas 的头像
Manas3 个月前

Aight we are back to langgraph great 😭

David 的头像
David3 个月前

Very different, it's not a workflow engine

Felipe 的头像
Felipe3 个月前

We have the same but we used coder and n8n to integrate with linear is Duet a platform by itself? Like, could linear, clickup or others platforms have the same features as u guys?

David 的头像
David3 个月前

Yup @duetchat is its own platform And it's fundamentally different than linear/clickup. In duet the kanban view is just treated as a way to visualize all your agents, as a user you don't actually interact with the cards, and that's by design The problem we are solving isn't better project management, but how can we deploy 00s of agents and actually track & steer them. Right now it's kanban, in 6 months maybe something else

Felipe 的头像
Felipe3 个月前

@duetchat I see that, I mean we have the same, but "in-house implementation", linear is just because it's what we used before You can see we have the plan, plan approval, review approval etc... that u also have related states, on your kanban on the video Here it's using n8n for the flow

Felipe 的头像
Felipe3 个月前

@duetchat U guys don't see your product "benefiting" from being something that can integrate with a existing linear/clickup/jira etc...? Like, stack can integrate with your codebase, but also be seen from clickup if you do something with n8n as well; Like "integrate Duet" on your workflow

Aleksandr Fulha 的头像
Aleksandr Fulha3 个月前

state machines ARE loops with transition contracts. paperclip handoff: each agent's exit state is typed, next agent's entry matched. break-on-mismatch instead of run-on-pattern. the loop still runs — the contract just keeps it honest about what it's passing forward.

Scott Evernden 的头像
Scott Evernden3 个月前

tomorrow .. "we learn about arrays"

David 的头像
David3 个月前

😂😂

Duncan 的头像
Duncan3 个月前

Excellent callout :)

SurfboardRSS 的头像
SurfboardRSS3 个月前

This is the way

kreo 的头像
kreo3 个月前

i like your thinking young man

David 的头像
David3 个月前

🫡

0xA 的头像
0xA3 个月前

Don’t use state machines. Design coinductive coalgebras over Cartesian closed categories.

SAWC || CS STUDENT 的头像
SAWC || CS STUDENT3 个月前

What does this entail?

David 的头像
David3 个月前

just sign up for @duetchat -

Michael Gustin 的头像
Michael Gustin3 个月前

What the fuck does that mean Kobe Bryant

David 的头像
David3 个月前

are you the same animal but a different beast?

Walter Monecke 的头像
Walter Monecke3 个月前

this looks amazing!

Divya Soni 的头像
Divya Soni3 个月前

Making probabilistic machines deterministic. We've come a full circle here

David 的头像
David3 个月前

Deterministic orchestration probabilistic execution Also - my state machine implementation isn't fully deterministic. Guardrail only enforces correct states, orchestrator agent can transition to any state it wants

Eray 的头像
Eray3 个月前

don’t use loops. design a fault-tolerant replicated giant atomic state machine. @toly

相关视频