Try it: open https://nankuru-banto.onrender.com (no login). Press Reset demo, then Run AI check (the agent takes about 30–60 seconds). Approve a proposal, then press Simulate 23:30 airline update (demo) and Run AI check again.

Inspiration

I've worked at hotels in Okinawa and Hokkaido, and I've been on shift on typhoon days when flights were cancelled and guests couldn't go home. In Okinawa, a typhoon can ground every flight for days.

Okinawa has about 3,900 places to stay, and roughly 9 in 10 are small: guesthouses, pensions, rentals and hotels with fewer than 100 guests (Okinawa Prefecture, 2023). Big hotels have night managers. A small inn usually has one tired owner.

That owner has to work out, late at night, who can't fly home, how many extra nights each guest needs, how to explain it in English, Korean or Chinese, how to collect payment and who has paid. Meanwhile, a rumour online is demanding full refunds. I wanted to give that one person a night-shift front desk that does the legwork but never touches the money on its own.

What it does

nankuru BANTŌ runs the whole typhoon night in PayPal, from the first invoice to the last refund, and only a human can move money.

  1. The AI investigates. A Gemini agent reads the guest list and checks each guest's flight against official notices. Social-media posts are read only to flag them as unverified.
  2. The AI proposes. Each stranded guest gets an extension offer for only the nights needed to reach the next available flight, written in their own language. Guests it can't safely help (a travel-site booking, no official next date, more than 3 nights needed, no rooms left) go to staff instead.
  3. A safety gate in code checks every proposal. The AI can't change the rules, set a price or move money.
  4. A manager approves each proposal with one click, and PayPal creates and sends the invoice.
  5. Payment is the confirmation. When the guest pays, a verified PayPal webhook confirms the extension within seconds. Nobody presses a button.
  6. Plans change. When the airline restores a flight, the agent re-checks every open invoice: it proposes cancelling an unpaid one, a full refund for a paid one, and one gentle reminder if the flight is still cancelled and the guest hasn't paid. Each runs in PayPal only after the manager approves.

Every decision — the AI's, the safety gate's, the manager's and PayPal's — is logged with a timestamp.

The safety gate enforces these rules in code, not in the prompt:

  • Only guests whose flight is officially cancelled
  • Only the nights needed, at most 3; no official next date or more than 3 nights → staff
  • The discount comes from the inn's policy, and every amount, including refunds, is calculated by code
  • Direct bookings only; travel-site bookings go to staff
  • Extension rooms can't be overbooked
  • Cancel only unpaid invoices, refund only paid ones, and only after an official restore
  • One reminder per invoice, only while the flight is still cancelled
  • The official notice and PayPal status are checked again right before any PayPal action
  • Refunds carry an idempotency key, so a retried approval can't refund twice
  • Allowlisted tools only, at most 20 steps

The AI has no tool that charges, sends, cancels or refunds money. Its only PayPal access is a read-only status check.

Why an AI agent, not just rules? The code only decides what is allowed. The agent does the work rules can't: it reads free-text airline notices, tells official ones from rumors, works out how many nights each guest needs, writes each message in the guest's language, and, when the notice changes, re-checks every open invoice and picks cancel, refund or reminder. The gate then makes sure none of it breaks a rule.

How we built it

It's a Python and Flask app with one manager dashboard, deployed on Render.

  • Agent: the Gemini API (gemini-3.8-flash) with function calling over REST. The agent can look things up, propose, and notify staff, nothing else.
  • Safety gate: plain Python that runs after the model and before anything is saved, so the model can't argue its way past a rule. Approvals re-check the official notice and PayPal right before acting.
  • Payments: PayPal REST in the Sandbox. Invoicing v2 creates, sends, reminds, cancels and checks invoices; Payments v2 refunds a captured payment with a PayPal-Request-Id; verified webhooks (INVOICING.INVOICE.PAID and CANCELLED) update the dashboard in real time.
  • Dashboard: Flask templates with AG Grid Community for the guest and invoice tracker. Every money-moving action is a POST from the manager.
  • Live demo: each visitor gets a private workspace. A "23:30 airline update" button replays a real pattern: flights restored after invoices were already sent. If Gemini is busy, a clearly labelled recording replays through the same real safety gate.
  • Tests: 170 offline tests with Gemini and PayPal mocked, plus a live evaluation harness (below).

I built it solo with AI tools, and every tool is credited in the README. Claude helped with product design, the safety rules, code review, research for the test scenarios and the demo video. Codex wrote the dashboard, PayPal integrations and tests from written specs, and every change was reviewed before it shipped. The video narration is Gemini TTS.

Challenges we ran into

  • A demo that can't fail in front of judges. On the free API tier, runs hit rate limits and could take minutes. I added a labelled replay fallback that still runs the real safety gate. If a live run breaks halfway, its partial writes are rolled back first, so the dashboard never shows half a night.
  • The real Sandbox didn't always match the docs. Webhook payloads carried the invoice ID one level deeper than documented, and cancel and remind returned 200 OK where the docs say 204. The app treated real successes as failures until I tested every PayPal call end to end on the live site and fixed each one.
  • Undoing money safely. Cancelling and refunding are riskier than charging. A guest might pay a second before the manager clicks "cancel". So every PayPal action re-reads PayPal and the official notice right before it runs, and refunds use an idempotency key.
  • Korean written with Chinese characters. Gemini sometimes wrote Korean words in Hanja, which most guests can't read. A code check rejects the draft and asks the model to rewrite it in Hangul.
  • Gaps the scenarios exposed. Writing test cases from real typhoons showed two holes: a cancellation with no official reopening date skipped the nights check, and a guest who needed 5 nights could be offered 3. Both now go to staff.

Accomplishments that we're proud of

  • Tested on 10 scenarios modeled on real Okinawa typhoons (2019–2026): 45 of 45 live Gemini runs passed. Unit tests mock the model, so I wrote an evaluation harness that runs the real Gemini model through the full agent and safety gate. The scenarios come from news reports: a typhoon that stalled with no reopening date, extra flights announced and then withdrawn, service restored a day early, "conditional operation" flights. Across 15 scenes × 3 runs, the agent made the expected call every time. The safety gate stepped in 4 times (3 proposals over the room limit, 1 Korean draft with Chinese characters). The slowest run took 62 seconds, against a 150-second limit.
  • The whole PayPal loop works on a public site. Invoice, webhook confirmation, reminder, cancellation and refund all run against the real PayPal Sandbox. Anyone can try it without logging in.
  • The AI can't move money. That isn't because the prompt says so: it has no tool for it, and the rules live in code it can't change.
  • Paying the invoice is the confirmation. The guest needs no form and doesn't have to queue at the front desk at midnight.

What we learned

  • Put the rules where the model can't reach them. A rule in a prompt is a suggestion. The same rule in code that runs after the model is a guarantee, and it's easier to test.
  • Agents need a narrow job. Limiting the AI to look up, propose and notify made it more useful, because the manager can trust everything it puts in front of them.
  • Test the model, not just the code. Mocked tests passed while the real model still mixed scripts. Scenarios built from real events found gaps that no mock would have shown.
  • Test against the real service. Three PayPal behaviours differed from the docs, and only an end-to-end run on the live site caught them.
  • Payment can be the workflow. Using the invoice status as the confirmation removed a whole step for both the guest and the owner.

What's next

  • Ask for the departure when the inn doesn't know it. Many small inns don't collect return flights yet. The agent will draft a message in the guest's language asking for it, and staff will send it.
  • Beyond flights: ferries, trains and buses, and a heavy-snow mode for Hokkaido.
  • Stay changes and partial refunds, with the same manager approval. Today these go to staff.
  • Help travel-site guests too, with a drafted message explaining how to extend through their booking site.
  • Live official flight-status feeds in place of the demo data.

Demo video made with Remotion. Narration: AI voice (Gemini TTS). Music: "Ambient - Ambient Music" by Tatamusic (Pixabay), used under the Pixabay Content License. All guests, flights and the inn are fictional. Payments run in the PayPal Sandbox only.

Built With

Share this project:

Updates

Submission history