Inspiration

Most people have a dozen recurring subscriptions and no real idea what they add up to — let alone which ones overlap, which have quietly gotten more expensive, or how to fairly split the ones they share with roommates and family. I wanted to find out what happens when you put an AI agent behind PayPal and let it not just show you your subscriptions, but actually do something about them.

What it does

Tally is an autonomous AI agent for your PayPal subscriptions, built around one idea: Understand → Act → Share.

  • Understand (Spend Autopsy): Tally audits your real PayPal subscriptions, detects overlapping services (e.g. two streaming or two music subscriptions), and surfaces real cheaper plans pulled live from PayPal's own catalog. It reports your true monthly and annual spend and a health score.
  • Act (Autonomous Agent): You set a monthly "trust budget" and a few rules (auto-downgrade waste, auto-cancel duplicates). Within those guardrails, the agent takes real PayPal actions on your behalf — revising plans and cancelling subscriptions — and logs every decision to a full audit ledger.
  • Share (Household Split): You declare a household and a "bill payer" who holds a shared subscription. Tally computes your fair share and sends it to the bill payer via a real PayPal Payout — actual money moving between accounts.

How we built it

  • Backend: NestJS (modular services) + Prisma ORM + PostgreSQL.
  • Frontend: Next.js 14 (App Router) + MUI, with AG Grid powering the analytics and audit-ledger tables.
  • AI: Google Gemini with a local Ollama (Llama 3.2) fallback, time-boxed so a slow model never blocks the app.
  • Payments: The PayPal REST APIs in sandbox — Subscriptions (create / revise / cancel), the Plans catalog, and Payouts for the household split.

The most important architectural decision: every financial number is computed in deterministic server code; the AI only classifies subscriptions and writes the conversational summaries. That means the agent can never hallucinate a dollar figure — a problem I hit early when I let the model reason about money directly.

Challenges we ran into

  • Grounding the AI. Our first version let the model compute savings and pick plans, which produced wrong and inconsistent numbers. I re-architected so all math is deterministic and the AI is limited to categorization and prose.
  • The sandbox approval lifecycle. PayPal subscriptions start as APPROVAL_PENDING and only activate after the buyer approves; I built a reliable return-flow sync so the UI reflects reality.
  • Correct money direction for shared subscriptions. I reworked the split so the person who owes pays their single share to the bill payer who holds the subscription — rather than accidentally paying everyone — and I prorate shared subscriptions so a user's reported spend only counts their portion.

Accomplishments that we're proud of

  • Real money actually moves. The household split triggers a genuine PayPal Payout between sandbox accounts — not a mock or a simulated confirmation.
  • A grounded agent, not a chatbot wrapper. By keeping all financial math in deterministic server code and limiting the AI to classification and prose, the numbers are always trustworthy — no hallucinated savings.
  • Bounded autonomy. The agent takes real PayPal actions entirely within a user-set trust budget and rule set, with every decision captured in a full audit ledger — a concrete, safe take on agentic commerce.
  • Graceful AI reliability. A time-boxed Gemini-to-Ollama fallback keeps the app responsive even when the primary model is slow or unavailable.
  • One coherent product. Three capabilities — understand, act, share — that ladder up to a single clear story instead of three disconnected features.

What we learned

How to build a bounded autonomous agent — one that takes real financial actions but only within explicit, user-set guardrails and with a complete audit trail — and why keeping the model away from the numbers is essential when money is involved.

What's next for Tally

Real webhook-driven reactions to live billing events, smarter AI-suggested household splits based on usage, and expanding beyond sandbox.

Built With

Share this project:

Updates

Submission history