Inspiration
What it does
How we built it
Inspiration
Smallholder farmers in Nigeria need money at specific points in a season: land prep, planting, inputs, harvest. Sponsors abroad want to help, but sending one lump sum to someone you can't see is a leap of faith. We wanted funding to follow proof of progress, so sponsors can trust where the money goes and farmers get funded at each stage they reach.
What it does
Yieldra lets a sponsor choose a farm and fund it in four milestone tranches, paid in US dollars through PayPal.
- The sponsor picks a farm and an amount. Yieldra splits it into four milestones and creates a PayPal order for the first tranche.
- Once PayPal captures the payment (via the return route or a verified webhook), the sponsorship goes live.
- At each milestone, the farmer uploads a photo. An AI vision agent checks whether the photo shows the claimed progress.
- If the check clearly passes, Yieldra charges the next tranche to the sponsor's saved PayPal payment method. If the result is uncertain, it goes to a human operator for review.
- Every captured tranche records a farmer payout obligation in naira. Sponsors see what they've paid and what's owed to the farmer, and operators see every milestone and payout status in one console.
How we built it
- Backend: FastAPI with async SQLAlchemy on Postgres, Alembic migrations, and Celery + Redis for background work.
- Frontend: React 19 + TypeScript, built with Vite and Tailwind CSS, served by FastAPI. AG Grid powers the operator console.
- Payments: PayPal Orders for the first tranche, then a saved PayPal payment method for later tranches. Each charge uses a stable idempotency reference.
- AI: One agent layer (
app/agents/base.py) that talks to Anthropic-compatible or OpenAI-compatible APIs. Separate agents handle milestone verification, vision checks, and reports. - Auth & data: Afribase handles sign-in and hosts the Postgres database. Sponsors, farmers, and operators each get their own dashboard.
Challenges we ran into
- Payment safety. Webhooks can arrive twice or out of order. We verify every PayPal event with PayPal, check captured amounts against the milestone amount, use idempotency keys for repeat charges, and commit the capture before any AI-generated messages or notifications run.
- Paying farmers is a separate problem. A PayPal capture doesn't put naira in a farmer's bank account. Instead of pretending it does, we record each farmer payout as a separate
pending_manualobligation, and the app blocks live PayPal mode until a real settlement route exists. - Trusting the AI. Photo evidence is messy. We send uncertain results to a human instead of letting the model make the final call on money moving.
Accomplishments that we're proud of
- A complete sponsor-to-milestone flow where each payment depends on verified progress.
- A clean split between "sponsor paid" and "farmer owed," shown openly to sponsors.
- Guardrails that stop the app from collecting real money before it can pay farmers.
What we learned
Getting money to move safely is harder than getting the AI to work. Idempotency, webhook verification, and keeping a clear record of who owes what mattered more than the model itself. Keeping a human in the loop for unclear cases made the AI usable for real payments.
What's next for Yieldra
- Add a farmer settlement provider so pending obligations become real naira payouts, then turn on live PayPal.
- Add more evidence signals (GPS and timestamp checks, multiple photos per milestone).
- Send sponsors season reports and harvest updates. ## Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for Yieldra
Built With
- afribase
- ag-grid
- alembic
- anthropic
- celery
- claude
- docker
- fastapi
- openai-api
- paypal
- paypal-orders-api
- postgresql
- python
- react
- redis
- sqlalchemy
- tailwindcss
- typescript
- vite