Skip to content

About

Our solution for the S-Bank challenge: Personal Economic Trainer at the Junction 2026 -Hackathon

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

S-Money Coach

A chat coach for the S-mobiili app. You talk to your own money, and the coach answers with real numbers from your transactions. Built at Junction 2026 for the S-Pankki challenge Personal Economic Trainer.

1. How to run the project

You need: Python 3.10 or newer, Node.js, uv (pip install uv) and pnpm (npm install -g pnpm).

First time only (install and set up)

Step macOS / Linux Windows
1. Download the data ./download.sh download.bat
2. Install everything ./initialize.sh initialize.bat
3. Add your Gemini key open .env, set GEMINI_API_KEY=your_key same
4. Build the database ./setup_db.sh setup_db.bat

Step 2 creates the .env file. Step 4 takes a few minutes. If db/money_coach.sqlite3 already exists, skip steps 1 and 4. Get a free Gemini key at https://aistudio.google.com (key icon, "Generate API key"). If the .csv files in Challenge data look broken, delete them and run step 1 again.

Every time (start the app)

macOS / Linux Windows
./run.sh run.bat

Open http://localhost:8081 and tap the AI tab. Stop with Ctrl+C.

Tips for a demo

  • The app signs in as demo customer CUST02706. "Today" in the demo is 15 September 2026.
  • A habit challenge lasts 7 days. To see its result now, move the demo date forward. Replace 2026-09-22 with the end date of the challenge:
    T=$(curl -s -X POST localhost:8000/api/v1/demo/session -H 'content-type: application/json' -d '{"customer_id":"CUST02706"}' | python3 -c 'import sys,json;print(json.load(sys.stdin)["token"])')
    curl -X PUT localhost:8000/api/v1/demo/clock -H "Authorization: Bearer $T" -H 'content-type: application/json' -d '{"today":"2026-09-22"}'
  • To start with no challenges: sqlite3 db/money_coach.sqlite3 "delete from challenges;" and restart.
  • Optional keys in .env: ELEVENLABS_API_KEY (read answers aloud), OLLAMA_BASE_URL and OLLAMA_API_KEY (local model, see .env.example).

2. Features

Understand My Money

  • Spending in the three baskets: euros, percent, number of purchases, top 5 groups, change since last month.
  • Spending question: "How much did I spend on taxis last month?" gives the exact sum.
  • 6-month trend of the baskets (1 to 12 months). The current month is marked as partial.
  • Spender type: one type, traits with evidence, tips.
  • Compare with similar people: your monthly average, the middle value of the group, your place in the group, and the size of the group.
  • Statistics Finland reference with year and link.
  • See all: open the transactions behind any number.

Plan My Finances

  • Balance forecast for 30, 60 or 90 days. The lowest point is marked.
  • Safe to spend per day, this week and until payday.
  • What if: change a category by -100% to +100%. See the saving per month and per year, and months to a savings goal.
  • Upcoming bills: predicted bills with date, amount and confidence.
  • Expense alerts: up to 10 purchases at least 3 times bigger than usual for that group.
  • Quick quiz: one question under the balance forecast and under safe to spend.
  • Reward card under the what-if with your yearly saving.

Improve My Habits

  • Finds one habit in your everyday spending: at least 3 purchases in 28 days and 1 in the last 7 days.
  • Names the pattern: rising, weekend, many small purchases, or a few bigger ones.
  • Offers a 7-day challenge: the goal is half of last week, rounded down to whole euros. Yearly saving is shown as an estimate.
  • Start, Another challenge, Check progress, Skip challenge. One challenge runs at a time.
  • Progress: spent so far, days left, "doing well" or "careful".
  • Result after 7 days: goal reached or not, this week against the week before, and one line on what you learned: compare equal periods, and one week is a sign, not proof.
  • Red dot on the bell when a result is ready.
  • Question buttons on each challenge card. The coach answers from the card's numbers.
  • Savings goal: "I want to save 600 EUR for a trip" gives the number of weeks the saving would need (an estimate).
  • Say "I want to skip the challenge" in the chat and the coach does it.

Features everywhere in the app

  • Alerts on the bell: when your everyday spending this week is different from a typical week (and which group changed most), when a challenge ends, or when there is a new challenge to try. Tap an alert and the chat opens with that question.
  • Ask in your own words. The coach finds the numbers, then explains them.
  • Read aloud and talk to the coach with your voice (ElevenLabs, optional key).
  • Plain-language concepts: small purchases add up, compare equal periods, fixed vs everyday spending, spending pace, one week is not proof.
  • Private by design: you can only see your own data.

3. Value for the customer and for S-Pankki

Value for the customer

  • You see where your money goes, in euros, split into three baskets. Not just a list of transactions.
  • You learn by doing: a 7-day challenge on one real habit, then a result and one lesson.
  • Every number comes with a short explanation in plain words. No jargon, no blame.
  • You stay in control. Nothing is blocked and no money moves.

Value for S-Pankki

  • Customers talk with their own data and explore it freely. S-Bank says no Finnish bank offers this yet.
  • Customers can trust the answers: the server calculates every number, and the AI model only explains them.
  • It teaches financial skills in everyday life, which helps young adults most.
  • It is one app made for the phone, so it fits the S-mobiili idea.
  • Alerts on the bell give customers a reason to come back. Each alert opens a conversation about their own money.

4. How it works: server, AI model and data

  • The server calculates every number. The AI model never writes database queries and never sees your raw transactions or your customer id. It only explains numbers that are already checked.
  • The model chooses one of 15 ready calculations. Understand: baskets, trend, spending on one thing, spender type, comparison with similar people. Plan: forecast, bills, unusual purchases, safe to spend, what-if. Habits: suggest, progress, skip. Plus a list of transactions and a concept explained.
  • Gemini (cloud) decides what to look up and writes the answer by default. A switch in the app (tab Mina) can use a private Gemma model on our own side instead: through Ollama on a host machine, or LiteRT-LM inside the server. Then the answers that contain your numbers are written by Gemma, and Gemini never sees them.
  • The app and the server follow fixed data formats. They are in contracts/.
  • Data: the test data from S-Pankki in Challenge data/. It has about 5,100 customers and 3.6 million transactions. It is not real customer data.
frontend/   Expo app (chat, cards, voice)         contracts/  API and tool contracts
backend/    FastAPI, services, tools, tests       docs/       plan, decisions, user stories
db/         SQLite database                       scripts/    data loading, local model

5. How to run the tests

cd backend  && uv run pytest -q
cd frontend && pnpm test && pnpm exec tsc --noEmit

6. Known limits

  • The free Gemini key has a small daily limit. Use a fresh key for a demo.
  • The data is test data. It ends on 30 September 2026.
  • The chat does not offer the old monthly spending limit. The API still has it.
  • English only. No push notifications: the bell shows a red dot inside the app.
  • The Windows scripts are less tested than the macOS ones.

7. More documentation

docs/vertical-slices.md (plan of each function), docs/architecture.md, docs/requirements.md, docs/user-stories.md, docs/decisions/ (why we chose things).

Team

Veikka Liukkonen · Luara Silva · Kseniia Shlenskaia

About

Our solution for the S-Bank challenge: Personal Economic Trainer at the Junction 2026 -Hackathon

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages