Inspiration
A one-person company hires the same kinds of help again and again: a launch strategy, a landing page, a contract review, product photos. Freelancers already do much of that work with AI. What still costs time and money is everything around it: working out what needs doing, writing the brief, finding the right person, explaining the business again, checking the work, and chasing the payment.
We wanted one place where an owner says what they need in plain words and gets work that has been checked before they pay for it, and where the expert gets paid as soon as the work is good.
What it does
Engine runs the whole loop for a small company and the experts it hires.
- The owner asks in plain words. "We need a wholesale launch plan for cafes in Portland." The Scoper (Gemini) turns it into a project of milestones, each with a role, a price, a brief, checks an AI can verify, and judgement calls only a person can make.
- The Matcher picks the team. It ranks experts for each role from their profiles and says why, in one line. The owner can also browse every expert's profile and hand them a job directly, or drag them into role slots on a visual team board.
- PayPal holds the money. The owner approves a PayPal checkout with
intent: AUTHORIZE. The money is held, not charged. - The expert does the work their way. In their own dashboard, or from their own AI agent. Each expert has their own MCP key. When the owner hands them a job, its brief, the company facts it needs, the company's playbooks and its tools appear in the expert's Claude Code, Kiro or Cursor as MCP resources, with a ready start prompt. Nothing is copied by hand.
- Two layers of review. The Reviewer (Gemini) checks every point and quotes what's missing. On a fail, the money stays held and the expert sees exactly what to fix. Judgement calls, such as "is this strategy right for us", get notes only. A person signs those off.
- Sign-off is the only trigger for money. Engine captures the authorization, sends the expert a PayPal Payout, and the Bookkeeper agent writes, sends and records the invoice through the PayPal Agent Toolkit. The next milestone then opens.
Around that loop:
- Company Brain. The business's facts, each with its source, built from a short interview, uploaded documents, GitHub repos and pasted notes. Each job sees only the facts it needs, and files marked private never leave.
- Scout. Suggests the work worth doing next from the Brain and PayPal sales (
list_transactions). It runs daily or only when you press Run, because each run uses AI credits. - An assistant on every page. One suggestion at a time, read from the company's own state, problems first: a PayPal hold that is about to expire, facts that disagree, work waiting on sign-off.
How we built it
- Next.js 16, React 19, TypeScript, deployed on Render from a Blueprint (
render.yaml) with the Render CLI. - PayPal, called directly over REST for anything that moves money:
- Orders v2 with
intent: AUTHORIZEto hold the client's money - Payments v2
authorizations/{id}/captureafter sign-off, andvoidwhen a job is cancelled - Payouts v1 to pay experts, with
sender_batch_idset from the job id, so a retry can never pay twice
- Orders v2 with
- PayPal Agent Toolkit (
@paypal/agent-toolkit) for the paperwork only: the Bookkeeper runs a Gemini tool loop overcreate_invoice,send_invoice,record_payment_for_invoiceandlist_transactions. If the model fails, a fixed sequence of the same tools runs instead. - Google Gemini (
@google/genai, 2.5 Flash) for five agents: Scoper, Matcher, Reviewer, Scout and Bookkeeper, with a fallback chain when a model is out of quota. A sixth builder, the Librarian, keeps the Brain tidy with plain rules and no AI calls. - Model Context Protocol over HTTP. Engine is an MCP server with tools, resources and prompts. Keys are signed per expert, so Engine stores none and one expert can't read another's work.
- Company Brain search: BM25 on the server, with Elastic as an option and an automatic fallback to local search.
The rules that hold for every call:
- The Reviewer has no tools. It returns verdicts, and code decides what moves.
- Amounts and recipients come from the approved job, never from a model.
- No AI tool can capture, pay or refund. Every agent call is logged, allowed or refused, and shown on the job.
Challenges we ran into
- Keeping AI away from the money. Every agentic payments demo tempts you to let the model call "pay". We split it: AI can scope, check, invoice and suggest, while capture and payout happen only in code, after a person signs off.
- Not everything can be checked by an AI. A legal review or a brand strategy needs a person's judgement. That is why there are two layers: checks get a verdict, and judgement calls get notes and a human sign-off.
- Paying twice. A double click, a retry or an auto-release sweep could each trigger a payout. Jobs are claimed before release, and the Payouts
sender_batch_idcomes from the job, so PayPal refuses a duplicate. We tested this: re-running sign-off, release, funding and cancelling on a paid job are all refused, and the payout stays the same. - The Agent Toolkit doesn't cover authorize, capture or Payouts. We call those REST APIs directly and use the toolkit where it fits: invoices and transactions.
Accomplishments that we're proud of
- The full loop runs in the PayPal sandbox, end to end. The demo run:
- held $440 ($400 for Priya plus Engine's $40 fee)
- failed round 1 on a missing risk register, with the money still held
- passed round 2, 5 of 5 checks, and was signed off
- captured
4PN69214SE131282W - paid $400 to the expert in payout batch
4GV6N8BQLHAD8 - invoiced it as
INV2-HNAG-E786-P6T2-5L8B
- An expert can earn without opening a web app. Their own AI agent connects with their own key, sees the work handed to them with its full context, submits it, and is told the review result.
- It's a complete product for both sides: the owner's dashboard, an expert directory, the team builder, the Company Brain and the builders, plus the expert's own dashboard, profile and agent page. It works on phones too.
What we learned
- The useful split is "AI does the work, people decide what good looks like". The AI is good at checking against a list. It shouldn't be the one deciding whether a strategy is right.
- Holding money with an authorization changes how both sides feel. The expert knows the money is there, and the owner knows it moves only on their say.
- MCP resources are the right place for handover context. The agent gets the brief, facts and playbooks the moment work is handed over, and loses them when it ends.
What's next for Engine
- Real accounts and identity checks for experts, such as bar registration for lawyers
- A persistent database and per-key revocation
- Milestone dashboards with AG Grid
- Disputes and refunds through the Agent Toolkit for the appeal path
- Taking it to real small businesses beyond the sandbox
Try it out
- Live app: https://engine-xjur.onrender.com (PayPal sandbox, test money only. Sign in as the owner or any expert at /login. The free plan sleeps after 15 minutes idle, so the first visit takes about a minute.)
- Source: https://github.com/AbinjithTK/engine-paypal (MIT licence, run instructions in the README)
Built With
- elasticsearch
- google-gemini
- model-context-protocol
- next.js
- node.js
- paypal
- paypal-agent-toolkit
- paypal-orders-api
- paypal-payouts-api
- react
- render
- typescript