Inspiration

Say I own a camera rental shop. A customer calls: the shoot ran over, can they keep the camera until tomorrow? Saying yes means the next customer, who booked that camera weeks ago, won't have it in the morning. Saying no loses money and goodwill. So the owner gets on the phone. Is there another unit free? Would the next customer take a better model, or a later pickup for a refund? Who pays for what, and when?

It's a small problem, but solving it means negotiating between multiple people, rearranging existing commitments, and moving money around. I wanted to see whether an AI agent could handle that entire process: find an arrangement that actually works, negotiate with each customer in plain language, and coordinate the payments, without making decisions the owner or customers never agreed to.

What it does

I built MakeRoom, which is an AI agent for small rental shops that deals with the scramble when a rental runs late. A customer messages the shop's assistant ("the shoot ran over, can I keep the camera until tomorrow?"), and MakeRoom takes it from there:

  • Finds a fix: When there's a conflict, the agent searches the schedule for rearrangements that fit, such as another unit, a better model, or a later pickup.
  • Holds payment with PayPal: places an authorization hold on the late customer, and only charges them if everyone agrees.
  • Proposes alternatives to affected customers: Interactive buttons show up on their messaging app, and they'll be able to click them. Importantly, an affected customer can totally disagree with all options, and their booking will NOT be changed. In fact, they can completely ghost the agent, and the agent will consider them not available for change.
  • Proposals simply offer alternatives. It can be an upgrade to a better item, or they could also pick up their item a little later at a reduced rate. The owner won't have to worry about anything.
  • Shows it all on a live Bryntum schedule: proposed plans appear as ghost bookings, with a feed of every step the agent took, and the owner can drag bookings or mark a rental overdue.
  • However, verification is still required; the owner must approve any decisions made to the schedule.
  • There is also a feature which escalates to owner if a customer requests, in which the owner can chat directly with individuals. This is the "Owner Chat" at the bottom.

For Bryntum Integration please visit the Github read me: https://github.com/vinyx1/MakeRoom/blob/main/README.md Also note that I'm using the free trial, so on larger viewports you may see a watermark.

How I built it

MakeRoom is a TypeScript app: a React and Vite frontend, a Fastify backend with live updates over SSE, and PostgreSQL with Drizzle. Deployed on Railway.

  • Claude SDK interacts with customers, calling tools it needs and operates the shop
    • The deterministic optimizer is the actual backend of the scheduler. It uses no ML, and is built on a set of determined rules/invariants. Claude can call this as a tool. This was also the hardest to build.
    • Paypal is used for authorization. I used PayPal's Orders API with the authorize intent. A customer's request is first put on hold, and captured only after everyone agrees; any disagreement before that voids it, and refunds go back to the affected customer and the optimized plan is cancelled.
    • Bryntum Scheduler Pro draws the schedule: turnaround buffers, maintenance windows, ghost bookings for proposed plans, and red drafts for conflicting owner edits.
    • Bryntum Scheduling Engine. A separate, read-only Bryntum project independently re-checks every plan the optimizer proposes (dependencies, shop-hours calendar, maintenance), and the owner sees whether it agrees. The optimizer still makes the decisions.
    • Postgres itself stores the states, customers, proposals, and literally everything. Changes to this db are atomic, so changes are first verified by a validator.

I tested the result with 220 tests, including full scenarios against the real PayPal sandbox, plus a 26-prompt eval of tricky chat messages like "make it free" and "ignore your instructions". Let me know if you can still jailbreak it.

Challenges I ran into

  • Staleness of schedule and optimizer plans. Luckily, I realized early on this would be an issue. So I came up with a state machine + invariants which defines rules that ensure that concurrent plans won't result in two schedules that don't agree with each other.
  • Bryntum's engine wants to move bookings. A booking here can only move with a customer's approval and a payment, so I pinned every booking and gave the engine a separate, read-only project as a cross-check on the optimizer.
  • Order of operations: If the next customer is asked before the late customer has paid, a cancellation leaves them hanging. So the PayPal hold comes first, and the charge happens only once everyone agrees.
  • Not all sorts of conflicts are dealt with. This requires several weeks to months of testing and communication with business ends. Right now, it deals with four main scenarios, which is listed below.

Accomplishments that I'm proud of

The main thing is that I made a real money flow, e2e. A customer's PayPal hold is placed first, captured only when everyone agrees, and every other exit releases it or refunds it. All of it runs against the real PayPal sandbox, not a mock. The model is currently at a point where 80% of extreme scenarios are covered

Currently, the model can take care of four scenarios:

  1. The extension (the main demo). Vincent asks to keep the camera until tomorrow. The optimizer finds two plans. He pays a PayPal hold. Bob picks the free upgrade or the later pickup with a refund. The owner approves, the hold is captured, both bookings change, and Bob is refunded. Both customers are told.
  2. The owner drags, the agent asks. The owner drags a booking, which creates a red draft that conflicts with another booking. Resolve with agent finds a plan. If it depends on an unknown equipment fact (such as whether the Crane 4 balances a rig), the owner answers it and can save it as a fact for next time.
  3. The customer says no. Bob chooses Keep my booking as is. The backend tries another plan, then offers Vincent the closest alternative. If nothing works, the request ends and his hold is released.
  4. The race. While Vincent's request is pending, the owner drags the same booking. The owner gets a warning and can override. Vincent's request is cancelled, his hold is released, and he gets a fresh offer that fits.

What I learned

  • Architecture first, then code. I realized that making something with concurrency is not trivial. You can't just dive straight in. That's why halfway through, I realized that I needed to create a model that prevents staleness and conflict bugs in the first place, rather than patching them on the spot.

    • There are a LOT more edge cases than I realized. For instance, the owner can create multiple conflicts the agent has to resolve, agent escalates to owner when there's something it cannot handle, rules for preventing the agent from proposing absurd plans, etc.

What's next for MakeRoom

  • Talk to clients! I would cater MakeRoom for each business's needs.

Built With

Share this project:

Updates

Submission history