Inspiration

When something goes wrong in a shop, the evidence arrives in fragments: a late parcel, a customer message, a refund request, then a dispute. A dashboard can show that sales changed. It rarely helps the merchant reconstruct what was known, identify the exact customers affected, and decide what to do next.

I wanted one room where the whole incident makes sense. Rewind the business, follow the evidence, and approve a remedy whose result you can inspect.

What it does

Glasshouse follows a merchant incident from signal to verified result.

  • Six connected instruments share the same evidence and time cutoff: Commerce River, Time Dial, Evidence Lens, Recovery Branches, Impact Map and Deadline Strip. Select a cohort once and follow the same orders across the workspace.
  • Rewind story time while keeping the knowledge cutoff explicit. A later source record can change what we know about an earlier event without rewriting history.
  • Ask an Investigator to inspect the evidence, record a sourced finding and counterpoint, and delegate a useful view to AG Studio's native Widget and Page agents.
  • Compare recovery policies and their exclusions, then review an exact per-order manifest before authorizing it.
  • Inspect individual operation receipts, distinguish payment from fulfillment and dispute state, and save a complete report with its original evidence and layout history.

The recorded PayPal Sandbox recovery completed 38 refunds totaling $190, 63 tracking assignments and four dispute evidence submissions. Independent reads checked all 105 original operations. Four cases remained open awaiting buyer response.

How we built it

Next.js and React provide the application, PostgreSQL preserves the evidence and operation journals, and Vercel hosts the qualified release.

AG Studio 3.1.0 supplies the native report, layout and Agent Framework. Glasshouse adds six custom instruments, shared temporal and cohort semantics, drill-through records, persistent layout history and complete static report exports.

The PayPal integration uses the pinned APIMatic-generated paypal 2.29.0 TypeScript SDK for supported payment operations and typed REST for the dispute path. The PayPal Agent Toolkit exposes four server-scoped reads. Financial execution checks current membership, original resource ownership, exact approval, expiry and durable operation identity. A lost response preserves uncertainty instead of causing an automatic replacement payment.

OpenAI powers the deployed native investigation agents. Gemini was evaluated separately in the local model comparison. Model responses, tool receipts and source references are retained so an explanation can be inspected rather than trusted merely because it sounds plausible.

How AI uses PayPal

The Investigator can inspect admitted order, transaction and dispute evidence, including owned PayPal observations through the Agent Toolkit. The Planner compares policy branches and proposes an exact remedy. A person separately reviews the manifest before execution. Independent provider reads establish what happened. The Writer summarizes the recorded evidence and outcomes, keeping open cases and unknown responses visible.

Tools used and how

  • PayPal Sandbox: Orders and captures, buyer consent/Vault, refunds, tracking assignments, dispute evidence and independent provider reads.
  • PayPal Agent Toolkit: four scoped read tools; Toolkit writes are disabled.
  • APIMatic: integration context and the generated TypeScript SDK used to implement the payment contracts.
  • AG Grid / AG Studio: custom instruments, shared selections, native Widget/Page handoffs, editable saved reports and layout history.
  • OpenAI: deployed investigation and planning agents. Google Gemini: separately measured local comparison.
  • TypeScript, Next.js, React, PostgreSQL and Vercel: application, durable storage and hosting.

Challenges we ran into

The hardest problem was keeping every view honest about the same evidence. A shipment, an order, a capture and a refund are different records. If one chart counts shipments and another counts orders, a polished dashboard can still tell the wrong story. We built explicit resource grains and shared source/context bindings, then tested every instrument against independent reference calculations.

The other challenge was changing knowledge. Nine fixture delivery records can reduce an affected cohort from 63 to 54, but the earlier proposal must remain inspectable and become stale. The same principle applies to payments: an unknown response is not permission to try again.

Model evaluation also exposed the gap between following a tool protocol and explaining the facts accurately. We report those outcomes separately and preserve the original failures.

Accomplishments that we're proud of

  • A distinct native visual language that makes time, evidence, scope and action feel like one investigation.
  • An actual Sandbox cohort of 600 captures totaling $27,600, followed by the separately approved original 105-operation recovery.
  • 60 of 60 controlled temporal/cohort cases passed across six custom instruments and one native grid: 420 view comparisons.
  • A recorded source correction that names the nine removed orders and leaves the earlier proposal visibly stale.
  • Complete saved reports that preserve the original evidence, policy, operations and native layout.
  • Ten automated local source-review traversals passed, with a 5.32-second median. This is measured software latency, not a claim about merchant time saved.

What we learned

An investigation becomes useful when a merchant can challenge it. The source, scope, counterpoint and approval need to be as easy to inspect as the chart.

We also learned to separate three questions that are often collapsed: did a tool run, was the explanation accurate, and did the intervention help? The historical model comparison reported mechanical success of 16/16 for OpenAI and 12/16 for Gemini; a separate conservative automated semantic assessment found 13/16 and 1/16 respectively. Those results informed prospective grounded-output work, without replacing the original failures or claiming human validation.

What's next

Qualify the implemented local commercial successor for concurrent incidents, operational learning and guarded invoice, subscription and storefront remedies. Complete the prospective grounded-output evaluation, broader accessibility and performance checks, authenticated webhook delivery qualification, and a consented seller usability study. These are next release gates, not claims about the current live application.

Notes for judges

The live link opens the qualified release in an isolated Sample workspace without application signup. The film combines clearly labeled retained native chapters: a 600-order Sample investigation, a separate six-order recorded AI example, a controlled 63-to-54 fixture correction, and the dated original PayPal Sandbox recovery. Local filmed successor features have their own source/build records and are not all deployed in the live release.

Shipping/support fixtures are labeled. Provider tracking does not prove physical delivery, and dispute evidence submission does not mean the case was resolved. No seller study, revenue-retention or prevented-dispute result is claimed. The repository documents the measured results and release boundaries.

Built With

Share this project:

Updates

Submission history