Загрузка видео...

Не удалось загрузить видео

На главную

One underrated benefit of declarative, event-based state management: It turns your app logic into something LLMs can use *directly*. Transitions + schemas become tool calls automatically. The agent doesn’t mutate state; it sends events the app already understands.

20,747 просмотров • 4 месяцев назад •via X (Twitter)

Комментарии: 24

Фото профиля Alem Tuzlak 🇧🇦
Alem Tuzlak 🇧🇦4 месяцев назад

TanStack AI agrees with you!

Фото профиля Devin Jameson
Devin Jameson4 месяцев назад

David we should talk.

Фото профиля David K 🎹
David K 🎹4 месяцев назад

Very cool. Some notes (love what Foldkit is doing btw): - If schemas are part of the contract, you should be able to do something like this without having to set up MCP; just feed it directly to the agent: - Event/message schema is only part of the story; context schema + emitted events/effect schema (what can the app emit? what effects will the app execute?) are also important - Something like store.can is huge: you want the agent to check if sending a message will have any effect, or is even allowed - State machines also bring this to a new level: "here's all the possible messages" can become "here's all the possible messages *in this state*" - Eventually, sending the entire app logic to an agent will enable lots of cool things; messages only are not enough (I'm sure you've thought of this too)

Фото профиля Devin Jameson
Devin Jameson4 месяцев назад

Many thanks for the feedback!

Фото профиля Rohan
Rohan4 месяцев назад

This is the bridge a lot of agent demos miss. If the app already exposes valid events and transitions, the model stops inventing side effects and starts operating inside guardrails the system understands.

Фото профиля David K 🎹
David K 🎹4 месяцев назад

You get it!

Фото профиля Hassan Hayat 🔥
Hassan Hayat 🔥4 месяцев назад

in python, I push my agents to specify everything as explicit state machines with states, transitions, and effects all spelled out. it's easier for the model to mine the logs after the fact to figure out where the bugs are and what it modeled incorrectly. it can also reason about it visually when you graph it

Фото профиля Werner Kasselman
Werner Kasselman4 месяцев назад

given the right tools, and taking away the complicated need for interacting with a UI makes the llm agent much more effective in my experience

Фото профиля David K 🎹
David K 🎹4 месяцев назад

Yep that's exactly what that demo shows; it sends events to the store directly

Фото профиля Swizec Teller
Swizec Teller4 месяцев назад

joke's on you our business process needs a pushdown automata at least pretty sure it might be turing complete

Фото профиля ismael celis
ismael celis4 месяцев назад

Commands (FSM “events”) are the only entry point into state changes. Then you get APIs, permissions, docs, and LLM tools almost for free.

Фото профиля Mihai Popescu
Mihai Popescu3 месяцев назад

What is the extensionyou are using to prompt the ai?

Фото профиля Ruben Casas 🦊
Ruben Casas 🦊4 месяцев назад

State machines 🤝 WebMCp

Фото профиля David K 🎹
David K 🎹4 месяцев назад

Need to try this out!

Фото профиля Robert Youssef
Robert Youssef4 месяцев назад

event schemas give llm deterministic payloads, but you still need runtime guard to reject malformed events

Фото профиля David K 🎹
David K 🎹4 месяцев назад

Yes; xstate/store (the library used here) has a validation extension just for this:

Фото профиля Robert Youssef
Robert Youssef4 месяцев назад

validation extension covers compile‑time checks, but runtime guard remains necessary for untrusted event sources

Фото профиля Dan
Dan4 месяцев назад

Explicit state makes agents safer and easier to inspect. If the app exposes transitions and schemas, the agent can operate through known events instead of inventing the workflow, and humans can see what changed and why.

Фото профиля *daymare*
*daymare*4 месяцев назад

declarative state management is the fancy way to say an imgui?

Фото профиля David K 🎹
David K 🎹4 месяцев назад

It's a fancy way to say a state machine

Фото профиля *daymare*
*daymare*4 месяцев назад

well, whats the other option to a state machine?

Фото профиля David K 🎹
David K 🎹4 месяцев назад

Implicit state machines; what people typically do with more-or-less direct state manipulation

Фото профиля EventHex.ai
EventHex.ai4 месяцев назад

Here are a few options, all under 220 characters: Option 1 (209 chars): "Spot on, David! The event-driven approach is powerful. Agents as event emitters (not state mutators) ensure cleaner integration & robust systems, unlocki...

Фото профиля entropy
entropy4 месяцев назад

I like the ui of the input box and button haha

Похожие видео