m4Mindset docs

Demos / Select then ask · Relay

What’s wrong with this one?

Click a delayed shipment and ask "What’s wrong with this one?". The agent has no tools at all: it answers from what the page sends with your message, and a panel shows you exactly what that is.

This demo shows situational awareness: the page tells the agent what the visitor is looking at, with every message. Click a shipment, then ask "What's wrong with this one?". The agent answers about the shipment you picked without being told which one.

Relay is a made-up dispatch console for a delivery company. Today's deliveries are on the right, and the dispatcher's assistant is on the left. Every customer, driver and phone number is sample data, and the clock never moves, so every visit sees the same afternoon.

An agent with no tools

The Relay agent has no page tools, no functions and no connections. It cannot look anything up. Everything it knows about the console arrives with your message, as situational awareness. So when it explains that RL-30412 was held because the address has no suite number, that came from the page.

What the page sends

The page builds one small record of strings and hands it to the <mindset-agent> element, which sends it with every message:

  • now: the demo clock, so "will it make its window?" has an answer.
  • view: which list is on screen and how many shipments it shows.
  • rowsOnScreen: one line per shipment you can see, so "which of these first?" works without a selection.
  • selectedShipment: the shipment you clicked, in full: its scans, its notes and who to call. Or none, and the agent asks you to pick one.

The panel under the list shows that record live, exactly as it will be sent. Click another shipment or change the view and watch the values change. After a message, anything that has changed since is highlighted.

Try it

  • With nothing selected, ask "What's wrong with this one?". The agent asks you to click a shipment.
  • Click Halvorsen Dental and ask again.
  • Switch to All and ask "Which of these should I deal with first?".
  • Click Tidewell Fitness, which is on time, and ask "Anything I should worry about?". Its notes hold the problem.

The light

The strip above the console lights when the agent answers a message that was sent with a shipment selected. It names the shipment that went. A message that fails never lights it.

Build the same thing

Send context from your page with Put an agent on your page and The Mindset agent element. How embedding works shows where situational awareness fits next to page tools.