Public
Your personal, AI-native finance tool.
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Spend Agent

AI-native personal finance tool. Connect your bank via Teller or upload CSVs (Chase, Amex, Venmo), get AI-powered categorization, and see where your money goes.

How It Works

Architecture

The tool handles the boring part — syncing transactions from banks + Venmo and classifying them with AI. Once your data lands as structured rows, you build whatever you want on top.

The feedback loop is the key insight: more data + prompt refinement = better classification over time.

What's Included

  • Overview page — Monthly burn at a glance. Stacked bar chart color-coded by category over 12 months. Click any month to drill down to individual transactions with AI reasoning.
  • Ask Agent — Chat with your financial data: "what did I spend on travel last quarter?", "am I on track for my savings goal?"
  • Settings — Classification prompt editor, category management with color swatches, Teller bank connection, CSV upload.

Ideas After You Remix

Once your transactions are classified, the structured data is yours to build on:

  • Find & cancel subscriptions — "Which recurring charges haven't I used in 3 months?"
  • Budget guardrails — Cron that texts you when a category exceeds your monthly budget.
  • Smart digest emails — Weekly email: "You spent $X this month, up 15% from last month."
  • Custom automations — Val Town crons + Claude + your categorized data = any workflow.

Setup (5 minutes)

  1. Remix this project on Val Town.
  2. Set ANTHROPIC_API_KEY in Settings > Environment Variables (anthropic.com).
  3. Open the dashboard. Upload a CSV (Chase, Amex, Venmo) or connect a bank via Teller.
  4. Hit Preview Classification on the banner to categorize transactions with AI.

Optional: Teller bank sync

Set TELLER_APP_ID to enable automatic bank sync. Get a free App ID from teller.io (free up to 100 accounts, no credit card required). Sandbox mode works without mTLS certificates — just use the test credentials shown on the Settings page.

For production bank connections, you'll also need TELLER_CERT and TELLER_KEY (mTLS certificate PEMs from Teller's dashboard).

Classification Engine

AI classification — Claude Haiku batch-classifies uncategorized transactions using Anthropic tool use with JSON schema enforcement. The category field is constrained to an enum — no hallucinated categories possible.

Interactive flow:

  1. Click "Review & Classify" banner — drawer opens with unclassified transactions
  2. Review/edit the classification prompt — click "Preview Classification"
  3. Review results with color-coded category pills + confidence scores
  4. Edit prompt inline and "Retry" or "Approve All" to commit

Default categories: Housing, Food, Transportation, Shopping, Entertainment, Health, Subscriptions, Bills, Travel, Investments, Transfers, Salary, Income, Gifts, Other

Customizable on the Settings page — add, rename, reorder, assign colors, or remove categories. Removing a category sends its transactions back to unclassified for re-review. Manual overrides on individual transactions are never re-classified.

Data Sources

SourceProviderCostBest For
Banks & credit cardsTellerFree (up to 100 accounts)Chase, BofA, Amex, etc.
CSV uploadBuilt-inFreeAny bank, manual import

Files

FileTypePurpose
app.tshttpDashboard, settings, API routes
db.tsscriptSQLite schema, config helpers, default categories
lib.tsscriptFormatting, HTML shell, category colors, Settings JS
classify-engine.tsscriptLLM classification engine (tool use with JSON schema)
classify-ui.tsscriptClassification drawer UI
classify.tsinterval (daily)Thin cron wrapper — calls runClassification()
sync-engine.tsscriptTeller mTLS sync logic
sync.tsinterval (15min)Thin cron wrapper — calls runSync()

Cost

  • Teller: Free (up to 100 accounts)
  • Claude Haiku: ~$0.01/day for ~100 transactions
  • Val Town: Free tier works for personal use