Skip to content

Jevspresso

Simulated espresso bar where an XState machine defines what is possible and Jev chooses the barista's next event.

Demoprototype

Overview

Jevspresso is a simulated espresso bar in which every barista decision is made by Jev. You type an order in plain English, such as a cappuccino with almond milk, and Jev grinds, tamps, pulls shots, steams milk and serves. You can work the bar yourself or break equipment and watch Jev cope.

The motivation is to invert the usual agent pattern: instead of an LLM writing tool calls that the app checks afterwards, an XState v6 machine models what is physically possible right now, and Jev only chooses among the events the machine currently accepts, including a no-op. The bar takes the event only if it is still possible. The pattern is packaged as @xstate/jev, shown on a simple lamp example where requests in context lead Jev to turn the lamp on or off. The TypeSafe call runs server-side, and tests run against a mock Jev without a key. A live demo is hosted.

What the decision model decides

TypeQuestionAnswers
ChoiceWhich currently accepted machine event should happen next (or do nothing)?—

How it works

  1. User adds an order or request to context
  2. State machine exposes the events currently accepted
  3. Jev chooses one event or the no-op given the context
  4. Machine applies the event only if still valid
  5. Repeat as state changes

Strengths

  • Model can only choose actions that are physically possible
  • Reusable @xstate/jev package
  • Mock-based tests need no key

Caveats

  • Demo application
  • Each decision is a hosted API call
  • Event descriptions must be written well

Getting started

pnpm install, cp .env.template .env (set TYPESAFE_API_KEY), pnpm dev and open http://localhost:3000.

At a glance

Type
Demo
Status
prototype
Language
TypeScript
Runtime
web app with XState v6
Has code
yes
Has tests
yes

Use cases and integrations

How curated lists describe it

  • Jev + espresso machine + state machine (XState).

    hellogumbo/awesome-jev
  • A simulated espresso bar where Jev makes every barista decision inside an XState machine; break the equipment and watch it cope.

    MrJev/awesome-jev

Frequently asked questions

What does Jev decide?

Which event the state machine should take next, chosen from the events it accepts right now.

Can Jev do something impossible?

No. It picks from a closed set and the machine rejects events no longer valid.

Can I reuse this pattern?

Yes, through the @xstate/jev package in the repo.

Related projects

  • Mineflayer Minecraft bot where code lists feasible actions and Jev picks one in about 0.2 s; 15 of 40 runs reached the Nether.

    ProjectresearchTypeScript
  • AutoGPT agent platform, listed as adding Jev decision blocks for typed routing, filtering, scoring and confidence-gated next actions.

    ProjectproductionPython
  • Framework-independent participation gate letting group-chat agents answer untagged questions only when Jev finds a useful reason to join.

    ProjectbetaTypeScript
  • Decision middleware for AI agents that uses local Laya to pick tools and judge results, falling back to an LLM when unsure.

    ProjectbetaPython
  • Real-time bot battles where you write a fighter's strategy in plain English and a System One model pilots it several times a second.

    ProjectbetaTypeScript
  • Bot that plays Red Alert 2 web skirmishes, with code handling mechanics and a decision model making stance, threat and timing calls.

    ServicebetaPython