Inspiration
Robots are getting more capable, but hiring one is still hard. Owners have idle machines, businesses have small tasks, and neither side has a way to agree on a price, split a big job, or settle payment. We wanted something like a freelance marketplace, but for robots, where AI agents handle the negotiation and PayPal handles the money.
What it does
RoboEconomy is a two-sided marketplace.
- Owners list robots with a capability, an hourly price, and a minimum price agents may accept.
- Customers publish a mission with a budget, such as "inspect four warehouse zones within 20 minutes".
- AI agents interpret the request, find matching robots, and negotiate with each owner over up to 3 rounds. A buyer agent and an owner agent trade offers. A risk agent reviews each option, and an explanation agent recommends one.
- Teams: when one robot can't finish before the deadline, a coalition agent splits the zones across several robots at minimum total cost and negotiates each share.
- Recovery: after a failure, a recovery agent finds a substitute robot for the remaining work and proposes a price. The customer approves it.
- Payment: the customer awards a robot or a whole team and pays through PayPal Sandbox. A team mission is one PayPal order.
- Audit log: every registration, award, payment step and agent decision is recorded, with the engine that produced it.
Agents only recommend. The customer always approves and pays.
How we built it
- Backend: FastAPI and SQLAlchemy on Postgres (Supabase), deployed as a Python function on Vercel.
- Frontend: Next.js 15 with TypeScript, a dark dashboard design, and 9 screens.
- PayPal: Orders v2 (idempotent create, buyer approval, capture), plus a webhook endpoint with signature verification and event de-duplication. Money is stored as integer minor units.
- LLM agents: OpenAI
gpt-4.1-minidoes interpretation, negotiation turns, risk review, option choice and explanations. - Validators in code: every model output is bounded. The owner's minimum price, the customer's budget, the listed price and a buyer concession schedule are enforced in code. The model can only choose among existing offers, and a grounding filter rejects explanations that claim things we have no data for. If a model call fails, the step falls back to deterministic logic.
- Team planner: the zone split is a calculated minimum-cost allocation. For a job of $Z$ zones where each robot can cover at most $c = \lfloor T / t_z \rfloor$ zones before the deadline $T$ (at $t_z$ minutes per zone), filling the cheapest robots first minimises cost because costs are linear in zones.
- Reinforcement learning: PPO trained in a synthetic economic environment and compared against random, greedy, rule-based and oracle baselines on 500 held-out seeds.
- Quality: 18 automated tests, including a fake model that tries to break the price limits.
Challenges we ran into
- PayPal in the sandbox: the order succeeded but the buyer saw a dead end, and later the sandbox buyer's country blocked a USD payment. We made the approval link recoverable and fixed the account setup.
- A table name clash in the shared database: our first deploy collided with an existing table and took the API down for a short time. We prefixed our tables and verified the live site.
- Keeping LLMs honest: a small model conceded too fast in negotiation and once invented a claim about "better verification". We added a concession schedule and a grounding filter, and tested both.
- Model deprecation:
gpt-4.1-nanowas deprecated mid-build, so we moved togpt-4.1-mini.
What we learned
Let the LLM propose and let plain code decide the hard limits. Showing which engine made each decision builds more trust than hiding it. We also learned how much work a clean PayPal flow takes: idempotency, recovery from half-finished checkouts, and verified webhooks.
What's next
We did not build a robotics simulator or physical robot link. Gazebo or another robotics simulator would supply live telemetry and detect failures, but it needs an Ubuntu machine and cloud compute that a self-funded hackathon MVP couldn't cover. The idea extends there, and the app's simulation page is left empty rather than faked. Failures in the demo are triggered by hand and labelled as such.
Other limits: robot capability is unverified, there are no user accounts yet, recovery approval is recorded but extra payment and dispatch are not built, and the team planner assumes 10 minutes per zone rather than measuring it. In the RL benchmark, PPO scored 3.45 against 3.35 for the rule-based baseline, which is within noise, so we don't claim it wins. It isn't wired into live decisions.
Live demo: https://roboeconomy.vercel.app (PayPal Sandbox only).
Built With
- fastapi
- gpt-4.1-mini
- gymnasium
- next.js
- openai
- paypal
- paypal-sandbox
- postgresql
- pytest
- python
- pytorch
- react
- sqlalchemy
- stable-baselines3
- supabase
- typescript
- vercel