Grounded retrieval
Answers are assembled from the store’s own help centre — hybrid lexical and embedding search over six policy documents, shipped at k=6.
No document, no claim.
Cerro Alto’s agent answers from the store’s own help centre, looks the order up while you watch, and hands you to a person the moment the documents run out — instead of guessing.
Fixture mode — recorded turns, replayed at measured timings. No key set.
Built with
Three ways to answer a support question, and only one of them the customer can verify.
Retrieval, tools, escalation and citation are separate contracts with separate tests — so a regression in one is visible before it reaches a customer.
Answers are assembled from the store’s own help centre — hybrid lexical and embedding search over six policy documents, shipped at k=6.
No document, no claim.
A typed tool call hits the Shopify Admin API and returns a normalised envelope, so status, carrier and dates come from the order — not from the model.
Real data, real latency, shown.
Refunds over the approval limit, damage claims and low-confidence retrievals route to a person through code, not through a prompt asking nicely.
No prompt can talk past it.
Every answer carries the documents it was built from as clickable chips. The customer can read the policy the agent read.
Cited, or it doesn’t ship.
The customer who asks, the lead who answers for the answer, and whoever inherits the code. Each of them needs something different from it.
Someone who wants an answer at 11pm and has no interest in whether it came from a model or a person.
The person who has to answer for what the agent said to a customer last Tuesday.
Whoever inherits this and has to change it without breaking the part that touches money.
The widget renders the agent’s actual state machine. Nothing in it is simulated — the spinner clears because a tool returned.
The question is embedded and searched against the committed index. Six chunks come back with scores; if the best of them falls under the relevance floor, the turn is already on its way to a human.
retrieve(q, k=6) → chunks[] floor → escalateOrder lookup, help-centre search and escalation are typed tools with contracts and their own tests. The widget shows each call as it starts and the real elapsed time when it returns.
lookup_order("CA-10244") → { status, carrier, eta }Claims not supported by the retrieved context fail the citation gate. When the policy says a human decides — money, damage, anything past the approval limit — the agent writes the ticket instead of the promise.
gate B: every claim ∈ context else → handoff(ticket)Every figure below came from a command that runs on a clean clone with no keys and no network. The half that could not be measured is left blank on purpose.
unit and contract tests passing, with 1 skipped loudly because it needs an embeddings key.
retrieval cases where every expected source came back — 88%, on the offline embedding stub.
top-k hit rate at the shipped k=6, where false below-floor escalation reaches 0%.
mean reciprocal rank at k=6 — within 0.007 of its ceiling at k=12, for half the context.
Answer accuracy, both hard gates, latency and cost per conversation. They need a live run against a key, which has not happened — so no number is given for them.
Both retrieval misses are written up in full in the report, including the one where the relevance floor is confident and wrong. That case is why the citation gate exists.
Nothing here is a black box you have to take on faith. Each piece is either an API with a contract or a file in the repository.
A page arguing that nothing should be claimed without a source does not get to run testimonials. These are the claims it makes, and the file each one lives in.
Refunds above the limit cannot be talked past.
The trigger reads the order envelope, not the conversation. An order flagged requiresApproval routes to a person whatever the customer or the model says next.
src/escalation/triggers.ts · refundOverApprovalLimitNo document above the floor means no answer.
When nothing retrieved clears the relevance floor the turn escalates with a stated reason rather than improvising from the model’s own priors.
src/escalation/triggers.ts · retrieval_below_floorThe half that was not measured prints no number.
The eval report publishes both retrieval misses in full, including the case where the relevance floor is confident and wrong — which is why the citation gate exists at all.
evals/report.md · §4, not runOne half of this project runs on a clean clone with no keys and no network. The other half needs keys and has not been run. Both are listed.
Everything below ran on a machine with no API keys and no network.
Unit and contract tests over every module
$ npm test252 tests · 251 pass · 1 skipped
Sixteen labelled cases over the committed index
$ npx tsx evals/run.ts --retrieval-only14/16 retrieved every expected source
Why the shipped setting is k=6 and not k=8
$ npx tsx src/retrieval/sweep-topk.ts94% hit rate · MRR 0.815 · 0% false floor
One answered from policy, one that calls a tool, one the agent refuses to answer. All three are reachable above without a key.
The agent looks the order up, reads the carrier scan history, and says what the shipping policy actually commits to — including the part where nothing has gone wrong yet.
Answered from policy plus the live order
A damage claim above the approval limit. The agent declines to promise the refund, writes a ticket carrying the order and the customer’s account of the fault, and says who decides next.
Handoff — the system working
No order, no tool call. Straight retrieval against the brewing guide, with the grind chart cited so the customer can check it before buying the wrong bag.
Answered from one document
It depends on the key. With ANTHROPIC_API_KEY set it is real inference against claude-opus-5. Without one it runs in fixture mode — turns recorded from real runs, replayed at the measured timings. The widget header says which, always. The public deploy runs fixtures on purpose: it works, you can click it, and it spends nothing.
Six policy documents written for this store — shipping, returns and refunds, subscriptions, freshness and storage, a brewing and grind guide, and an FAQ. They are chunked, embedded and committed to the repository, which is what makes a clean clone runnable without a key.
It stops. If nothing retrieved clears the relevance floor, or a claim isn’t supported by the retrieved context, the turn escalates instead of improvising. Escalation is rendered as a deliberate state in the widget, not as an error — because it is the system working correctly.
Because it was not run. The offline half — retrieval, the top-k sweep, the unit suite — ran on a machine with no keys and no network, and those numbers are printed next to the command that produced them. Answer accuracy, the two hard gates, latency and cost need a live run, so no number is given for them at all.
None of it. The brand, catalogue, orders and policies were all built for this project. No real customer information appears anywhere in the repository or in this demo.
Yes — the spec, plan, task list and tool contracts that produced the code are committed under specs/, and the case study walks through the retrieval decisions and the two failures that were not rounded away.
The interesting turn isn’t the one it answers. Try the refund over the approval limit, watch the handoff, then read how that rule is enforced.