Skip to content
EZGraph Get started

No EZGraph key required. Free production use. No runtime fee. Bring your own model provider. Support Jev. Run in your own infrastructure. Optional support is available.

1. A sixteen-turn live DecisionHotelGraph replay

Read this first. This is a complete passing provider-backed run with HOTEL_GRAPH_CURRENT_DATE frozen to 2027-07-15. It exercises a chat model (gpt-4o) and the Jev decision model together. Model wording can vary; normalized criteria, decision boundaries, hotel results, and completion are the durable contracts.

Run it yourself

cd ezgraph-demo
npm run test2:decision-hotel-graph

The script sets USE_ENV=1 KEEP_SESSION=1. The test sends all sixteen turns through one session, semantically judges every reply, and verifies the final durable booking state. It is skipped unless TYPESAFE_API_KEY (for Jev decisions) and OPENAI_API_KEY are set.

Captured live transcript

  1. 1 · date range prompt

    You
    Hi
    Bot

    What are your Portland check-in and checkout dates?

  2. 2 · invalid calendar date

    You
    February 30, 2027 through March 5, 2027
    Bot

    February 30, 2027 is not a valid date. Could you please provide valid check-in and checkout dates for your stay in Portland?

  3. 3 · valid date range

    You
    August 1 through August 8, 2027
    Bot

    What nightly budget range should I use?

  4. 4 · invalid inverted budget

    You
    minimum 800 and maximum 500 per night
    Bot

    It seems like there’s a contradiction in your budget range, as the minimum is higher than the maximum. Could you please clarify your intended budget range per night?

  5. 5 · valid maximum budget

    You
    maximum 700 per night, with no minimum
    Bot

    Would you like one bed, two beds, or a suite?

  6. 6 · suite selection

    You
    a suite
    Bot

    Which hotel amenities do you require?

  7. 7 · cross-step date correction

    You
    Actually change my dates to August 3 through August 9, 2027
    Bot

    Which hotel amenities do you require?

  8. 8 · amenity selection

    You
    free wifi and free parking
    Bot

    Do you have an airport or city-center distance limit?

  9. 9 · no distance preference

    You
    distance does not matter
    Bot

    Current Portland hotel criteria:

    • Dates: 2027-08-03 to 2027-08-09
    • Nightly budget: no minimum to $700
    • Room type: suite
    • Amenities: freeWiFi, freeParking
    • Distance: no preference

    Tell me what to revise, or say “search” when ready.

  10. 10 · criteria review

    You
    show my criteria
    Bot

    Current Portland hotel criteria:

    • Dates: 2027-08-03 to 2027-08-09
    • Nightly budget: no minimum to $700
    • Room type: suite
    • Amenities: freeWiFi, freeParking
    • Distance: no preference

    Tell me what to revise, or say “search” when ready.

  11. 11 · first grounded hotel search

    You
    search
    Bot
    1. Hampton Inn & Suites Portland Tigard

      • Address: 11799 SW 69th Ave, Tigard, OR 97223
      • Nightly Price Range: $522 - $600.3
      • Total Price: $3810.60
    2. Hilton Garden Inn Portland Airport

      • Address: 12048 NE Airport Way, Portland, OR 97220
      • Nightly Price Range: $576 - $662.4
      • Total Price: $4204.80
    3. Hilton Garden Inn Beaverton

      • Address: 15520 NW Gateway Ct, Beaverton, OR 97006
      • Nightly Price Range: $459 - $527.85
      • Total Price: $3350.70
    4. Hampton Inn Sherwood Portland

      • Address: 22000 SW Meinecke Parkway Sherwood, Oregon 97140 USA
      • Nightly Price Range: $486 - $558.9
      • Total Price: $3547.80

    Please review the options and let me know if you would like to book one of these hotels or revise your search criteria.

  12. 12 · revise to restrictive budget

    You
    change maximum budget to 500 per night
    Bot

    Current Portland hotel criteria:

    • Dates: 2027-08-03 to 2027-08-09
    • Nightly budget: no minimum to $500
    • Room type: suite
    • Amenities: freeWiFi, freeParking
    • Distance: no preference

    Tell me what to revise, or say “search” when ready.

  13. 13 · empty hotel search

    You
    search
    Bot

    No hotels matched all current criteria. Tell me whether to revise budget, room type, amenities, or distance.

  14. 14 · restore viable budget

    You
    change maximum budget to 750 per night
    Bot

    Current Portland hotel criteria:

    • Dates: 2027-08-03 to 2027-08-09
    • Nightly budget: no minimum to $750
    • Room type: suite
    • Amenities: freeWiFi, freeParking
    • Distance: no preference

    Tell me what to revise, or say “search” when ready.

  15. 15 · second grounded hotel search

    You
    search
    Bot

    Here are the matching Portland hotels:

    1. Hampton Inn & Suites Portland Tigard — 11799 SW 69th Ave, Tigard, OR 97223 — nightly $522.00–$600.30 — total $3,810.60
    2. Hilton Garden Inn Portland Airport — 12048 NE Airport Way, Portland, OR 97220 — nightly $576.00–$662.40 — total $4,204.80
    3. Hilton Garden Inn Beaverton — 15520 NW Gateway Ct, Beaverton, OR 97006 — nightly $459.00–$527.85 — total $3,350.70
    4. Hampton Inn Sherwood Portland — 22000 SW Meinecke Parkway Sherwood, Oregon 97140 USA — nightly $486.00–$558.90 — total $3,547.80

    Reply with a hotel name or number to book, or tell me which search criterion to revise.

  16. 16 · validated hotel booking · completed

    You
    book hotel 1
    Bot

    Hampton Inn & Suites Portland Tigard is booked with confirmation #785427. Thank you for choosing Hilton.

The replay includes an invalid date, inverted budget, cross-node date correction, criteria review, empty search, budget recovery, grounded hotel results, and a validated booking.

Under the hood

The transcript shows what the customer saw. This table shows the path through the graph that produced each reply, and how many Jev calls it made. J marks a decision node that called Jev. The paths are derived from each turn's response and the node code, since the replay records replies rather than raw decisions, and they add up to the 22 decision calls the final session recorded.

TurnCustomerPath through the graphJev calls
1HiRouterJ → directTo(DateRangeNode)1
2February 30, 2027 through March 5, 2027DateRangeNode (invalid date not saved; asks again)0
3August 1 through August 8, 2027DateRangeNode saves → RouterJ → directTo(BudgetNode)1
4minimum 800 and maximum 500 per nightBudgetNode (inverted range not saved; asks again)0
5maximum 700 per night, with no minimumBudgetNode saves → RouterJ → directTo(RoomTypeNode)1
6a suiteRoomTypeNode saves → RouterJ → directTo(AmenityNode)1
7Actually change my dates to August 3 through August 9, 2027AmenityNode reroute_request → RouterJ → DateRangeNode saves → RouterJ → directTo(AmenityNode)2
8free wifi and free parkingAmenityNode saves → RouterJ → directTo(DistanceNode)1
9distance does not matterDistanceNode saves → RouterJ → summary; resumes at the router1
10show my criteriaRouterJ (review) → summary1
11searchRouterJ → ReadinessJ → SearchHotelsNode → PresentNode drafts → PresentationJ accepts the draft3
12change maximum budget to 500 per nightPresentNode revise_search → RouterJ → BudgetNode saves → RouterJ → summary2
13searchRouterJ → ReadinessJ → SearchHotelsNode finds nothing → RouterJ shows the notice3
14change maximum budget to 750 per nightRouterJ → BudgetNode saves → RouterJ → summary2
15searchRouterJ → ReadinessJ → SearchHotelsNode → PresentNode drafts → PresentationJ; the code-rendered list is shown3
16book hotel 1PresentNode chosen_hotel → finish()0

Four patterns account for almost everything:

  • Every saved value sends the router back to Jev in the same turn, to choose the next question. That is the only call on turns 3, 5, 6, 8, and 9, and the second call on turns 7, 12, and 14.
  • Invalid values never reach a decision node. Turns 2 and 4 stay inside a collector, whose model asks again after the handler returns stay() or after it declines to call the tool.
  • A correction is one turn (turn 7), because the router can forward the customer's message to another collector.
  • Every search costs three decision calls: the router, the readiness judge, and either the presentation judge or the router again for the no-match notice.

The final session also recorded 30,693 decision tokens and 11,473 chat-model tokens. Lesson 9 breaks the decision calls down by node.

Next

2. Graph, state, and history spaces maps the nodes and state owners behind the replay.