Demos / Full page · Wayfarer Travel
Trip planner
Plan a trip end to end: hotels and cars from functions, options as widgets, and a real calendar that fills in live.
Wayfarer Travel is a made-up travel brand. You ask it to get you to Lisbon from Tuesday to Thursday next week, with a car from the airport, and to put the trip in your calendar. The planner shows packages, fills in your itinerary, confirms a demo booking and books three hours on a real calendar in its Calendar tab.
The agent is configuration
trip-planner is a Mindset agent made of five prompt fields, a model and a list of what it may use. There's no agent code in this page. The prompt makes it a brief travel planner that shows options rather than listing them, and it says plainly that the data is sample data and that nothing is really booked or paid. The whole definition lives in demos/trip-planner/, and the repo is applied to the org through the admin MCP.
Functions for the data
The hotels and cars are literal sample stock inside functions. A function is a JSON pipeline: one step holds the stock, and every step after it is pure. plan-trip filters hotels by city and price cap, ranks them by rating, pairs each with the cheapest airport car and sorts the packages by total. search-hotels sorts by price, rating or minutes from the river, which is how "move my hotel nearer the river" works. book-hotel and book-car build a confirmation reference from your input and store nothing. A function call costs no model call and returns the same answer every time.
Widgets for the choices
The chat is Mindset's own <mindset-agent> element, so authored widgets render in it. The option cards widget shows each package with its tag, its total and a Choose button. Pressing it sends your choice back to the agent as a message. The booking form widget asks for the traveller's name, with optional date changes, and submits them to the agent. The agent books only after the form is submitted.
A connection for the calendar
The calendar is a live demo service with a keyed booking API and a public week view. The agent reaches it through a REST API connection that declares three operations: list_calendars, get_slots and book_slot. The API key is entered by a person on a credential capture page, so it never passes through a chat or the repo. book_slot writes, so it's governed: the org decides whether it runs straight away or waits for a person's approval. If the calendar isn't reachable, the agent says so and the itinerary still updates.
The Calendar tab frames the service's public week view, which shows today and the next six days, refreshes every two seconds and shows each slot only as Booked. Until the connection's key has been captured, the tab says the calendar isn't connected yet.
Page tools and situational awareness
The page gives the agent two page tools. add_to_itinerary puts a hotel or car on the itinerary panel and replaces the old one. remove_from_itinerary takes one off. Both check every argument before they touch the page: the stock id, the dates and the total. Situational awareness sends today's date, the current itinerary and the calendar id with every turn, which is how the agent turns "next week" into dates. When a booking or a calendar slot comes back, the page copies its reference onto the itinerary.
Under the hood
The pane below shows each step as it happens: the function calls with their arguments, the widgets, the page tools and their results, and the calendar booking.
Build the same thing
- Build a function for pure data steps like
plan-trip. - Connect a system and connection types for the calendar API.
- The mindset-agent element and how embedding works for page tools and situational awareness.
- Test an agent's behavior for the pinned tests that hold the planner to its rules.