Inspiration
People subscribe to streaming, music, cloud and app services, then forget about them. They keep paying for things they barely open, miss price increases, and pay for overlapping services. Expense trackers show what was charged. They rarely say whether the money was worth it, and they never act on it. We wanted a financial assistant that connects what you pay with what you actually use, explains its reasoning, and never takes an action behind your back.
What it does
Kardex is an AI-powered subscription guardian with a mobile app and a web analytics workspace.
Detects recurring PayPal subscription payments and pairs them with app-usage data from Android Usage Access (with explicit consent) or manual entry. The app labels each figure as measured, manual or demo. Analyzes spending with deterministic logic, not an LLM guessing. It calculates monthly and annual cost, cost per use, underuse and usage trend, price increases, upcoming renewals, unusual charges and possible category overlap. Every subscription gets an explainable Health Score with visible factors. Recommends actions with the evidence, why it matters and an estimated saving, never a guaranteed one. Gemini only turns these findings into plain-language explanations, and falls back to deterministic text if it fails. Acts only with approval. The user approves or rejects each recommendation. The backend then cancels through the PayPal API and keeps the status at “pending verification” until PayPal confirms it (by webhook or a status check). Kardex never says a cancellation succeeded before then. Explores: the Reports page opens two web explorers from the app. The Transaction Explorer is a searchable, filterable AG Grid of payments. The Spending Explorer is a dashboard of spending, usage and savings with a read-only natural-language panel built with AG Grid Studio and its Agent Framework.
How we built it
Mobile: Flutter, with Supabase email/password auth. The Supabase session token goes to the backend on every request, and Reports opens the web explorers in an in-app WebView. Backend: FastAPI (Python) with per-user data scoping. It verifies Supabase JWTs through JWKS (ES256/RS256), with legacy HS256 supported. Storage is SQLite for the demo. The tables cover subscriptions, transactions, usage, recommendations, approvals, an action audit log, webhook events and one-time web sessions. PayPal: Subscriptions API (details, transactions, cancel), OAuth, and webhooks with signature verification, in the sandbox. We used the APIMatic PayPal context plugin while integrating. [Confirm: the real subscribe, approve, sync and cancel flow is working end to end in the sandbox. Otherwise say “implemented, with a labeled demo mode for reliability”.] Guardian AI: deterministic financial analysis in Python, with unit tests. Gemini produces schema-validated explanations only and has no payment or cancellation tools. Web: React, TypeScript and Vite, with AG Grid, charts and a read-only Spending Explorer agent, reached from the app through a short-lived one-time code instead of a token in the URL. Deployment: Render, using a render.yaml blueprint.
Challenges we ran into
PayPal’s data model. The Subscriptions API is merchant-side. An app can’t read a consumer’s subscriptions to other companies, so we built the demo around sandbox merchant plans and a real buyer approval flow. Sandbox time. The sandbox can’t fast-forward billing cycles, so long-term price-increase and trend history can’t be generated for real. We kept that logic unit-tested and labeled any seeded history as demo data. Honest verification. We designed the workflow so a cancel request only moves a recommendation to “pending verification”, and only a PayPal confirmation makes it “verified”. Auth and handoff plumbing. Supabase ES256 JWTs needed JWKS verification, and the app-to-web handoff needed a one-time code, cleartext LAN settings for phone testing, and a readable WebView error state. Keeping AI in its lane. The explorer agent is read-only and allowlisted, with no financial execution tools.
Accomplishments that we're proud of
A workflow of detect → analyze → recommend → approve → act → verify, with an audit trail. Financial calculations that are deterministic and tested, with the LLM used only for explanation. Clear labeling of every figure as measured, manual, sandbox or demo. A cancellation flow that refuses to claim success before PayPal confirms it. One backend and one source of truth behind both the mobile app and the web explorers.
What we learned
Real payment APIs shape the product: what data you can legitimately access matters more than what you’d like to show. The most trustworthy use of an LLM here is explanation, not decision-making. Consent and labeling build user trust more than polish does. Build a labeled demo fallback early, but don’t present it as the real thing.
What's next for Kardex
A full production PayPal lifecycle: consumer-side connection, a complete webhook-verified cancel flow, and multi-month real history. Support for more providers and payment sources beyond PayPal, such as UPI and cards. A fuller natural-language agent that builds dashboard widgets and filters through the AG Grid Studio Agent Framework. Better provider-to-app mapping, and usage from TVs and browsers. Proper migrations, observability, refresh-token sessions and a Postgres production database. Alerts for upcoming renewals, trial endings and price changes.
Built With
- agstudio
- apimatic
- flutter
- googlegeminiapi
- python
- react
- render
- typescript