Inspiration

What it does

How I built it## Inspiration

Agentic AI systems are moving fast — but payments between autonomous agents don't exist yet. Today a developer who wants to pay an AI agent for work must wire it manually, after the fact, with no escrow, no SLA enforcement, and no audit trail.

Cascade answers the question: what if you could post a bounty, let a swarm of AI agents compete to complete it, have an independent AI Verifier score the contributions, and settle the payment automatically — all without a human in the loop?

What It Does

Cascade is a fully autonomous multi-agent payment marketplace:

  • Post a task + bounty via REST API or the AG Grid dashboard
  • BuyerAgent decomposes the task into 2–4 typed subtasks (research, analysis, dataviz)
  • PayPal Orders API escrows the bounty immediately — funds locked before any work starts
  • 3 WorkerAgents execute subtasks in parallel using Groq LLMs
  • VerifierAgent scores each contribution 0–10 and allocates the bounty proportionally
  • PayPal Payouts API settles payments to each agent's wallet automatically
  • AG Grid dashboard shows every state transition live with drill-down into verdicts and allocations

Pipeline: CREATED → ESCROWED → WORKERS_RUNNING → VERIFIED → PAID in ~90 seconds, zero human input.

How We Built It

  • FastAPI + asyncio — POST /api/tasks returns 202 immediately; full pipeline runs as a background coroutine via asyncio.create_task()
  • Groq API (openai/gpt-oss-20b) — powers BuyerAgent (decompose), 3 WorkerAgents (parallel execute via asyncio.gather()), and VerifierAgent (score + allocate)
  • PayPal Orders API — creates a real order and escrows funds before any agent does work
  • PayPal Payouts API — batch settles to agent email addresses proportional to Verifier scores
  • AG Grid Community v31 — dark-themed real-time dashboard polling every 3s, with state badge coloring and verdicts drill-down grid

Challenges We Ran Into

  • Groq TPM limits — free tier exhausted after 3 parallel worker calls. Fixed with a 20s sleep guard between worker and verifier phases.
  • LLM tool-use hallucination — model randomly tries to call browser.search with no tools configured, returning a 400. Fixed with a 3-attempt retry loop in WorkerAgent.
  • Non-blocking pipeline — FastAPI's BackgroundTasks doesn't compose with asyncio.gather(). Switched to asyncio.create_task() for true async concurrency.
  • PayPal Payouts geo-restriction — India sandbox blocks payout API. Built a SIMULATED fallback that preserves the full state machine and allocation output.

Accomplishments

  • Full escrow → work → verify → pay cycle running autonomously in ~90 seconds
  • Real PayPal order IDs created on every run
  • AG Grid dashboard with live state badges and verdicts drill-down — zero page reloads
  • Proportional payout allocation driven entirely by AI Verifier scores, not hardcoded splits

What We Learned

  • Autonomous payment systems need an escrow primitive before work starts — trust comes from the payment protocol, not agent reputation
  • LLM outputs need defensive parsing in production (markdown fences, tool-use hallucinations, JSON decode failures)
  • AG Grid's separation of column definitions and row data makes live data trivial to retrofit into a professional grid

What's Next

  • WebSockets to replace polling with push state updates
  • Agent reputation scores persisted across tasks for a staking layer
  • Open the task marketplace so any agent can claim and execute bounties
  • On-chain escrow to replace PayPal Orders for permissionless settlement

Challenges I ran into

Accomplishments that I'm proud of

What I learned

What's next for Cascade

Built With

Share this project:

Updates