Skip to main content

Cartwise

A shop that accepts its customers' own AI agents: an agent signs its user in, shops within the session that the shop verified, and the customer can end it.

ApplicationDraft
This page is a draft. The code exists, and not all of it has been run for this page yet. The page says what was checked. The code is in server/examples/poppy today.
Works with
JavaScript / TypeScriptExpress
Stack
Express shop API, Node.js test agent

Scenario​

A customer tells their personal agent: "Order more coffee from Example Shop." The agent has never seen this shop. It reads the shop's discovery document, signs the customer in, and receives a session. Each request of the agent carries that session, and the shop verifies it before it shows an order or takes one.

People and agents​

WhoRole in the applicationIdentity in LumoAuth
CustomerOwns the personal agent.A user of the shop.
Personal agentShops for the customer.A client that identifies itself with a metadata document. Not registered in advance.
Example ShopThe Company of the protocol.The organization, with the protocol turned on.

Flows​

FlowWhat happensWhat LumoAuth does
DiscoverThe agent reads poppy.json on the shop's domain.Built the document. The shop serves it.
Sign inThe customer signs in, directly or with a code on a phone.Hosted sign-in, then a session for this agent and this customer.
ShopThe agent lists orders and places one.The shop sends the session header to LumoAuth and receives the verified agent, customer and account.
TasksThe agent asks what it can do here.Serves the task list.
EndThe customer ends the session on the account page.The next request of the agent is refused.

Parts​

PartBuilt withJob
Shop APIExpress, poppySession()Orders, behind session verification.
Test agentNode.jsA personal agent for the walkthrough.

What the seed script creates​

  • The protocol turned on.
  • A confidential application with the scope poppy:verify.
  • A test customer.

Walkthrough​

  1. Start the shop.
  2. Run the test agent, and sign in as the customer.
  3. Place an order.
  4. End the session, and run the agent again.

Before you run it​

  • Mediated Sign-In and a hosted conversation endpoint are not available.
  • LumoAuth does not enforce a spending limit for each customer. The shop decides what a session may buy.

Where the code is today​

company.mjs and personal-agent.mjs in the folder examples/poppy of the server repository. The catalog version uses the SDK helper for verification.