Inspiration

Every small business owner knows the feeling: a customer owes money, the invoice is overdue, and somehow it just sits there. Not because anyone's negligent — because chasing payments is a job nobody has time for on top of actually running the business. I wanted to build something that doesn't just answer questions about a business, but genuinely does a piece of the operational work — the way a real Chief Operating Officer would.

What it does

OpsPilot is a business management platform — customers, sales, inventory, invoices, expenses — with an AI agent layer built on top of it. The centerpiece for this hackathon is the Overdue Invoice Agent:

  • It scans every unpaid invoice and, for each one, sends Gemini the real context: how overdue it is, the customer's other outstanding invoices, their order history.
  • Gemini decides — reminder, escalation, or nothing — with a stated reason, not a canned message.
  • Every decision lands as a proposal in an approval queue. Nothing executes without a human saying yes.
  • Once approved, the action is recorded and logged.
  • And critically: it doesn't wait to be asked. Google Cloud Scheduler triggers this same review every day at 8am, for every user, with nobody logged in.

How I built it

  • Frontend: React + Vite, deployed on Google Cloud Run behind nginx.
  • Backend: Node.js + Express + Prisma, also on Cloud Run.
  • AI: Gemini via Google's official @google/genai SDK — migrated off the deprecated @google/generative-ai package specifically for this submission, preserving the existing tool-calling loop and function declarations.
  • Autonomy: a dedicated, secret-protected endpoint (separate from normal user auth) that Cloud Scheduler calls daily, looping every account with per-user error isolation.
  • Database: PostgreSQL via Supabase.
  • Trust layer: invoices and receipts get a SHA-256 hash anchored on Base Sepolia, so anyone can verify a document hasn't been tampered with.

Challenges I ran into

  • Getting the scheduler to actually work wasn't as simple as just setting up a timer — Cloud Scheduler has no user login, so I built a separate secret-protected route, and had to get the setup order right so the normal login check couldn't block it first.
  • A genuine race condition: reviewing invoices twice in quick succession could create duplicate proposals for the same invoice. Caught before the demo.
  • Deploying two separate Cloud Run services correctly — Vite bakes environment variables in at build time, so the frontend needed a two-step Cloud Build + deploy flow instead of a simpler one-liner.
  • I joined the hackathon a bit late and missed the window for the dedicated $150 Google Cloud hackathon credit — so this entire build, including all Cloud Run, Cloud Build, and Cloud Scheduler usage, runs on the standard free tier with a self-imposed budget cap. No paid infrastructure was used.

Accomplishments that I'm proud of

The agent's reasoning is genuinely context-aware, not just a day-count threshold — in testing, it independently noticed when a customer had multiple overdue invoices and escalated accordingly, without being explicitly told to check for that pattern. And nothing an agent proposes — a reminder, an escalation, a new customer, a sale — ever executes without a person approving it first.

What I learned

Making something "autonomous" is mostly about the boring infrastructure — auth models that don't assume a logged-in user, idempotency so a retry doesn't double-execute, and being honest in the UI about what actually happened (my agent explicitly tells the owner "no email/SMS provider is configured yet" rather than faking a sent message).

What's next for OpsPilot

Wiring up a real email/SMS provider so approved reminders actually reach customers, extending the same propose-then-approve pattern to inventory restocking and expense anomaly detection, and building a full multi-agent Business Health review that runs daily across the whole business, not just invoices.

Built With

Share this project:

Updates

Submission history