Refund Court: How Two Beginners Turned a Chat Room into a Courtroom with Switch
AI agents argue refund disputes. A human decides. Every verdict becomes precedent.
Hi! We're Roshanlal Maddheshiya and Arpita Thakur. We're still pretty new to AI, and this was the first time either of us built anything with AI agents. When we saw the Flip the Switch Hackathon by @WeMakeDevs and @DevTools Academy, we wanted to try something that felt like a real business problem, not just another chatbot. That's how Refund Court happened: four AI agents and one human sorting out refund disputes together inside a single team chat, using Switch.
- GitHub: https://github.com/EC-Roshan/refund-court
- Demo video: https://youtu.be/fhDyZFD0tUE?si=7ZgOwcKDFJso9Swh
Why we picked this problem
If you've ever ordered from Blinkit, Zepto or Amazon, you've probably raised a refund request at some point. "Two items were missing." "My order came really late." On the other side, a support person has to decide: refund or not, and how much?
Here's the thing we kept thinking about. Two people can look at the exact same complaint and make two different calls. One approves a full refund, the other rejects it. And nobody remembers what was decided last week. That's money lost for the company and frustration for the customer.
The idea: what if every dispute got its own little courtroom?
We imagined a court case. Someone checks the facts. One side argues for the customer, the other side argues for the business. A human listens and makes the call. And every decision gets written down, so the next similar case can be judged the same way.
So we set up one Switch room on Mattermost and gave four agents one job each:
| Agent | What it does |
|---|---|
| case-clerk | Reads orders.csv and customers.csv and only states the facts |
| customer-advocate | Speaks up for the customer, quoting rule numbers from our refund policy |
| company-advocate | Looks out for the business: fees, refund limits, signs of fraud |
| precedent-keeper | Looks through verdicts.md for similar past cases and records new verdicts |
And then there's us, the Support Lead, playing the judge. The agents can argue all they want, but only a human gets to decide.
How a hearing actually runs
Support Lead: "@case-clerk Dispute on Order #1043: 2 items missing" -> case-clerk posts the facts -> passes it to customer-advocate -> customer-advocate makes its case -> passes it to company-advocate -> company-advocate makes its case -> passes it to precedent-keeper -> precedent-keeper checks history -> waits for the human Support Lead gives the verdict -> precedent-keeper saves it in verdicts.md The nice part is that once we post the first message, the agents pass the case along to each other by themselves, just by mentioning the next one.
The moment it actually clicked for us
Our first real test was Order #1043. The customer said milk and bread were missing. The clerk checked the data and found four items billed but only two scanned at packing. The customer advocate pointed to Rule 3.1, which says missing items get refunded. The company advocate agreed about the items, but said the delivery fee stays with the company under Rule 3.2, since the order was only three minutes late. The precedent keeper looked and found no earlier cases. We gave a partial refund, and it got saved.
Then came Order #1062. Different customer, same complaint. This time the precedent keeper said: "This case mirrors #1043 exactly." We made the decision in a few seconds.
But the part that honestly surprised us was the company advocate. Without us asking, it pointed out that this was the second time milk and bread were missed at the same store. So this wasn't really a customer problem, it was a warehouse problem. The agents didn't just settle a refund, they spotted the actual root cause. That's when we felt like we'd built something useful.
Where Switch fits in
- One room for everyone: all four agents and the human are in the same chat, so everyone sees the same conversation.
- Handing off with mentions: each agent ends its reply by tagging the next one, and the hearing moves forward on its own.
- A human in the loop: no agent is allowed to make the final call.
- Shared files as memory: the policy, the order data and the verdict log are just plain files that every agent can read.
Without Switch, these would have been four separate chatbots that don't know about each other. With Switch, they actually work like a team.
What went wrong (a lot!) and what we learned
We'll be honest, setting this up on Windows took us much longer than building the actual idea.
- Claude Code and Antigravity just wouldn't connect. Switch Console kept saying "CLI not installed", even though both worked fine in the terminal. We finally got it working with OpenCode, installed into a folder without spaces in the path.
- The real problem was hiding in the logs. We spent hours changing paths and restarting. Then we opened Switch Console's log file and saw "controller socket is down". The local Switch server had simply stopped. Once it was running again, the agents showed up as signed in. Our biggest lesson: read the logs before guessing.
- Our Windows username has spaces in it, and that made file paths messy. We moved the whole project to
E:\refund-courtto stay safe. - We ran out of free Gemini requests. The free tier gives 20 requests a day, and four agents talking to each other use that up very fast. We switched to OpenCode's free models.
- The agents kept dropping the ball. One would answer and forget to tag the next one, so the hearing stopped halfway. Adding a strict rule, "always end your reply by mentioning the next agent", fixed it.
- Sometimes an agent just sat on "Working..." because it was stuck on an older task. Clicking "Stop current work" and restarting Switch Console sorted it out.
What we'd like to add next
- Exact prices for each item, so refund amounts aren't estimates
- A proper fraud case, where customers with many recent refunds go to manual review (that's Rule 3.5 in our policy)
- Running it in Slack, since that's where most support teams already work
Want to try it?
Everything is in our repo: the agent instructions, sample data, refund policy, the Switch template and the setup steps.
https://github.com/EC-Roshan/refund-court
Thanks to @WeMakeDevs, @DevTools Academy and the Switch team for this hackathon. We learned more in these four days than we expected to.
Built for the Flip the Switch Hackathon, Track 01: Best Business Workflow. #HowISwitch
— Roshanlal Maddheshiya & Arpita Thakur