Skip to main content

Quote Agent

The Quote Agent takes a quote or estimate request in conversation instead of through your page's quote form. It sends the request exactly as your form would, to where your form sends it today, and hands back your reference.

Your form stays the fallback. While the agent is available, every road to the quote form leads to it: a typed request, a results card's "Get a quote", a NxisAI app link to the form. When it's away, the form works exactly as before.

The flow​

  1. Handoff. The visitor asks for a quote. The on-page agent proposes the handoff, naming the agent, and the visitor presses Send.
  2. One question a turn. The agent reads what the handoff already says and asks only for what's missing, one field at a time.
  3. Server-side validation. Every value is checked on the server: required fields, the shape of an email, 10 to 11 phone digits, choices from your form's own options. A value that fails is asked for again. A gap is never filled in by the model.
  4. A summary, and an explicit yes. The agent shows a summary written by code from the checked values, naming your business, and sends only if the visitor's next message is a plain yes ("yes", "ok, send it"). "Yes, but change the email" is a change, and the summary is shown again.
  5. Submit once. The task is claimed before your quote destination is called. A retry, a second instance or a repeated yes never sends again, and a failed send isn't retried: the visitor is offered the form or your phone number instead.
  6. Reference back. The agent hands back resolved with the reference your destination returned: "Sent to Ridgeline Roofing. Reference RR-4KQ7M2XH. They'll follow up at pat@example.com." If your destination returns none, it says it was sent, without a reference. It never makes one up.

Emergencies are phone calls. Words you choose (a burst pipe, water through the ceiling) skip the model entirely. The agent hands back unresolved with your phone number, and nothing is sent.

A resolved hand-back counts as your form sent in your analytics, exactly as the form going through would.

The quote sink​

The agent sends to the same place your form does, its sink, with the same keys, in the same order, with the same treatment of empty values. Your sink can't tell the two apart.

Your form's submissions go toThe agent
A webhook (your own, or your application through an action binding)POSTs the identical payload to a URL fixed server-side (QUOTE_SINK_URL), signed with X-Nxis-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, "<t>.<body>")> using your binding's signing secret
A server handler that saves to your databaseCalls the same function the handler calls, so your office is notified the same way
A third-party form servicePOSTs the same payload server-side, if the service accepts a server's post. A service that needs a browser token or a CAPTCHA can't take the agent's; move the form to a sink you control first

The sink URL always comes from server-side configuration, never from a request, the handoff or the model.

Return a reference. Have your sink answer success with one, for example { "status": "confirmed", "reference": "QR-7K2M9QXA" }: a short prefix and eight characters from an alphabet without look-alikes (ABCDEFGHJKLMNPQRSTUVWXYZ23456789), from a cryptographic random source. Your page's form can ignore it.

Configuration​

The agent's skill writes a site adapter and a field spec for your site:

  • The field spec is one JSON file that both your form and the agent read, so they can't drift: each field's name, label, kind (text, email, phone, choice, longtext), required, and for a choice its options as { value, label }. Hidden fields too, with where their values come from. Render your form's inputs from it where you can, or add a test that compares the two.
  • The adapter says who the quote is from, a few sentences of facts about your business for the model, guidance on your fields ("offer a phone number once; 'no' is an answer"), your emergency words and phone number, and how to submit. On a directory site, it also says which business the visitor means.

Consent. The agent sends each quote conversation, including the visitor's name, email, phone and the job, to your model provider under your key, to decide the next question, billed per turn. The request itself goes only where your quote form sends it today. The skill puts this to you and waits for an explicit yes before installing.

On the page, add the target with takes, naming your quote form's tool. The tool name is your QuoteAction's name, lower-cased with spaces and dashes as _: "Quote Form" becomes quote_form. takes also covers the site-wide quote_form_anywhere.

agent.handoff = {
relay: '/api/handoff',
targets: {
quote: { kind: 'agent', label: 'Ridgeline Quotes',
description: 'takes a quote or estimate request in conversation and sends it',
takes: ['quote_form'] },
},
};

In your system prompt, two lines, and no form tool's name:

If they ask for a quote, an estimate, or what a job would cost, call transfer_to_agent with target quote.
Only if transfer_to_agent does not offer quote, use the quote form tool instead.

A tool the prompt names gets called, even on a turn it wasn't offered, so the fallback says "the quote form tool". See Targets that take a form for how takes works.

The relay target's availability is what makes the form the fallback: with no model key, the relay lists quote as unavailable, and the form takes quotes as before.

One business per request

The Quote Agent sends each request to one business. Sending one request to several providers at once is the lead-funnel-quote skill's job, for agents outside your site.

Hosts​

The agent mounts POST /a2a/quote (relay only) and GET /a2a/quote/agent-card.json on your origin. Profiles exist for Vite (Node), Netlify, Docker, Google Cloud Run, Cloudflare Workers and AWS Lambda. See Host profiles for what each keeps where. On any host with more than one instance, the agent's progress and the submit claim live in a store every instance sees, so the visitor's "yes" never lands on an instance that didn't show the summary.

HostNotes
DockerIts own container. Route /a2a/quote and the card paths through your reverse proxy, never the health check. One replica keeps state in memory; add Redis for more. With Redis down, it refuses to send rather than risk sending twice
Cloud RunThe Docker image, with Firestore for tasks, progress and the claim, and Secret Manager for secrets. It can scale to zero, so the first visitor after a quiet spell may get the form while the agent starts
Cloudflare WorkersA Durable Object per task holds the task, progress and claim. Needs nodejs_compat. Set secrets with wrangler secret put, never as vars
AWS LambdaA function behind a Function URL, routed through your CloudFront, with DynamoDB and SSM SecureStrings. The card's origin is set explicitly, never the request's host

The skill checks it live before it finishes:

CheckExpect
GET /api/handoffquote with available: true; with no model key, available: false
POST /a2a/quote without the relay's token403
"Can I get a quote for a new roof?"A handoff proposal with Send, one question a turn, a summary, "yes", and the hand-back with your reference. Your sink received one submission, identical to the form's
"Water is coming through my ceiling"A hand-back with your phone number; nothing sent
No model keyThe same request opens the quote form