💡 Inspiration
Over $40 Billion is contributed annually to emergency relief, grassroots mutual aid funds, and municipal community grants. But donors and organizers rarely distrust the cause—they distrust the middlemen. An estimated 15% to 30% of relief capital disappears into unverified contractor markups, phantom delivery invoices, and unauthorized cuts before reaching the ground.
Traditional crowdfunding platforms dump pooled funds into an organizer's personal bank account with zero spending controls or milestone verification. Small NGOs and mutual-aid collectives desperately need rigorous financial controls, but cannot afford dedicated full-time forensic audit teams.
We asked: What if community grant capital was locked in a programmatic release gate, and money only moved when an AI agent mathematically verified that goods were actually delivered at fair market rates?
🚀 What It Does
GrantPool AI is an autonomous financial escrow agent and audited ledger connecting Donors, Pool Escrow, Contractors, and Beneficiaries in a closed-loop 4-Way Cross-Reconciliation Engine:
- Inbound Capital Pooling: Donors pledge funds via PayPal Smart Buttons. Funds are locked in a programmatic escrow-style pool balance.
- Contractor Milestone Claims: Suppliers submit invoices requesting milestone reimbursement (e.g., food rations, well pumps, laptops).
- Beneficiary Ground Truth: On-site volunteers verify delivery via Dual-Factor SMS OTP (Twilio) and timestamped delivery photos with GPS coordinates.
- Autonomous AI Discrepancy Engine:
- Google Gemini 2.0 Flash Vision extracts line items, quantities, and unit rates with zero temperature and structured JSON schemas.
- The engine validates unit rates against UN World Food Programme (WFP) & Humanitarian Data Exchange (HDX) market baselines to detect price gouging.
- It matches invoiced items against verified delivery proofs to catch phantom items.
- If 100% Reconciled: The agent autonomously releases milestone funds via the PayPal Payouts REST API with zero manual button clicks.
- If Discrepancy / Markup Detected: The agent halts payout immediately, freezes unverified funds in escrow, and alerts the community.
- AG Grid Forensic Surveillance Ledger: Renders real-time transactions with custom badges (🟢 Reconciled, 🟡 Pending Proof, 🔴 Flagged Discrepancy), live cell flash animations, quick text search, and an expandable Master-Detail side drawer comparing invoices against delivery photos.
- Human-in-the-Loop Dispute Override: Community organizers can review contractor explanations for emergency supply disruptions and grant authorized overrides.
🛠️ How We Built It
- Frontend: Built with React 18, Vite, TypeScript, and Tailwind CSS.
- Auditing Dashboard: Built on AG Grid React Community v31, utilizing custom cell renderers, responsive column auto-fitting, live cell change flashing (
enableCellChangeFlash: true), quick filtering, and a Master-Detail inspection side drawer. - Backend API: Built on FastAPI (Python 3.12) with SQLAlchemy and SQLite. Implemented Server-Sent Events (SSE) to stream the agent's 5-stage cognitive thought process directly to the browser.
- AI Core: Integrated Google Gemini 2.0 Flash Vision with deterministic structured output (
temperature=0.0, Pydantic JSON schemas) for reliable financial extraction. - Market Data: Integrated the UN WFP / HDX Emergency Commodity Reference Catalog normalized to USD.
- Payment Rails: Integrated the PayPal Sandbox Orders API (for donation pooling) and the PayPal Payouts REST API (for automated batch milestone disbursements).
- Automated Verification: Engineered a 7-test Pytest test suite enforcing anti-fraud halting, client tolerance hard-caps, idempotency, and pagination.
🧗 Challenges We Ran Into
- Receipt OCR Normalization: Small vendor receipts in disaster zones are often crumpled, handwritten, or poorly lit. We solved this with Gemini 2.0 Flash Vision enforced by strict Pydantic extraction schemas.
- Legitimate Crisis Price Surges: Disaster disruptions (floods washing out bridges) can legitimately raise transport costs. We introduced an emergency tolerance ceiling (hard-capped on the backend at 35%) and a Human-in-the-Loop dispute override flow.
- Eliminating Evaluator Friction: Running live SMS verification and external APIs can fail due to test balance or rate limits. We built a dual-mode architecture: natively supports live PayPal Sandbox REST API credentials, but includes an instant pre-seeded demo mode so judges can evaluate every feature in under 60 seconds.
🏆 Accomplishments That We're Proud Of
- Built a non-trivial, end-to-end agentic commerce application that programmatically executes milestone disbursements via the PayPal Payouts REST API rather than just recommending actions.
- Created an institutional-grade financial auditing dashboard on AG Grid that makes complex multi-party reconciliation intuitive and visually clear.
- Backed by an automated 7-test backend test suite (100% passing) ensuring zero duplicate payouts, price gouging enforcement, and hard-capped safety rules.
📚 What We Learned
- How to orchestrate multi-party financial workflows (escrow $\rightarrow$ vendor $\rightarrow$ beneficiary) using PayPal Payouts.
- The power of combining multimodal LLMs with deterministic benchmark catalogs for fraud prevention.
- Advanced AG Grid techniques for building high-performance, real-time financial surveillance interfaces.
🔮 What's Next for GrantPool AI
- Cross-Border Disbursements via PayPal Hyperwallet: Enabling international diaspora funding with automatic local currency conversions.
- Offline USSD / Feature Phone Verification: Expanding SMS delivery verification for rural low-connectivity areas without smartphones.
- Multi-Signatory Community Governance: Enabling multi-sig community approval rules for high-value relief milestones exceeding $10,000.
Built With
- ag-grid
- agentic-commerce
- ai-agent
- fastapi
- fintech
- fraud-detection
- gemini-2.0-flash
- google-genai
- paypal
- paypal-payouts
- paypal-sdk
- postman
- pydantic
- pytest
- python
- rapidfuzz
- react
- render
- sqlalchemy
- sqlite
- sse
- tailwindcss
- twilio
- typescript
- vite