m4Mindset docs

Demos / Two agents · The Atlas, Lisboa

Two agents, one page

Several agents on one page, each with its own session: a Lisbon hotel has a concierge desk and a spa desk side by side, two different agents from the same script tag. The spa is scripted, so it speaks first while the concierge waits.

Two agents, one page · Two agents · The Atlas, LisboaEsc

The live demo loads here.

What it shows

  • Several agents: two <mindset-agent> elements on one page, each configured with its own agent handle, atlas-concierge and atlas-spa, from the one served bundle
  • A session per desk: each element’s getSession asks for a session bound to its own agent, so neither desk can see the other’s conversation
  • A one-phase script, atlas-spa-welcome, whose onEnter greets the guest and offers Restoring and Help me sleep as suggested replies before anyone types
  • The script’s phase granting atlas-spa-treatments through resources.functions, so the spa can answer the first reply, then handing over to free chat
  • A function over literal sample data on each desk, with each desk’s status light and its line on the "Your evening" card moved only by that desk’s own runtime events

Files

  • demos/atlas-concierge/demo.json
  • demos/atlas-concierge/functions/atlas-concierge-find-dining.json
  • demos/atlas-concierge/prompt/policy-rules.md
  • demos/atlas-spa/demo.json
  • demos/atlas-spa/script/atlas-spa-welcome.json
  • demos/atlas-spa/functions/atlas-spa-treatments.json
  • src/demos/atlas/index.tsx
  • src/demos/atlas/evening.ts
  • src/content/demos/atlas.ts
  • src/content/demos/atlas.md

Related docs