A demo pizzeria whose ordering agent talks to other people's AI assistants through NANDA's Agent Box. It shows an agent on Ora's island (this business, found and ranked through Ora's registry) doing business with an agent on NANDA's island (a person's Agent Box), with credentials and the person's consent at every step.
A demo by Ora for NANDA. No food is made and nothing is charged.
The pizzeria has its own Agent Box mailbox on NANDA's gateway and follows the gateway's conversation protocol:
- A customer's assistant sends the pizzeria a
schedulerequest ("2 margheritas for pickup tomorrow at 7pm"), or structuredconstraints: {items: [{id, qty}], pickupAt}. - The pizzeria replies with a
proposal: items, total, pickup slot and order number, intextandconstraints. - The customer's assistant asks its person, then sends
acceptnaming that proposal. The pizzeria holds the slot. - The customer's assistant (the requester) sends
confirm. The order is placed.
A counter-proposal ("8pm instead?") gets a new proposal. decline or cancel releases the slot. A general question gets the menu.
Every reply is built only from the menu and order data in lib/menu.ts; nothing a customer sent is quoted back. Every write is safe to retry: proposals are saved as drafts and resent byte for byte under the same idempotency key, and slot holds are recorded once per order.
| Path | What it does |
|---|---|
lib/menu.ts |
The business: menu, prices, pickup hours, oven capacity |
lib/agent/parse.ts |
Reads items and a pickup time from a message |
lib/agent/slots.ts |
Finds the nearest pickup slot with room |
lib/agent/respond.ts |
What to do with one inbox message |
lib/agent/sync.ts |
One pass over the inbox, cursor and lock |
lib/agentbox.ts |
Client for the Agent Box gateway |
lib/store.ts |
State in Upstash Redis (in memory for tests) |
app/api/agentbox/webhook |
Gateway wake-up; triggers a sync, never reads the body |
app/api/cron/sync |
Every-minute fallback sync (Vercel Cron) |
app/llms.txt, /.well-known/ai-catalog.json |
How agents find the ordering agent |
- Vercel project with the Upstash Redis integration (sets
KV_REST_API_URL,KV_REST_API_TOKEN). Every-minute cron needs a Pro team. - The pizzeria's Agent Box. Give an assistant NANDA's skill (
https://my.nandaindex.org/agent/SKILL.md), an email Ora controls, the display name "Nanda Pizza" and the description "Sourdough pizza for pickup in Cambridge, Massachusetts. Order pizzas for pickup today or tomorrow." Enter the six-digit code. Put the mailbox key in Vercel asAGENTBOX_TOKEN(never in chat or a file) and the mailbox address asAGENTBOX_ADDRESS. CRON_SECRET: any long random string, in Vercel.- Deploy, then attach
nanda.pizzaonce the deploy serves. - Webhook: register
https://nanda.pizza/api/agentbox/webhookwith the gateway (POST /api/v1/webhooks {"url": ...}using the mailbox key).
All variables are listed in .env.example.
npm install
npm test # unit and flow tests, no network
npm run typecheck
npm run lint
npm run dev