Skip to content

01 — Overview and goals

Duration: 8 min Prerequisites: none. Some Python helps; Course 2 is a plus but not required.

Your credit-card transactions are some of the most informative personal data you own. A bank CSV export already contains:

  • the date of every purchase,
  • the amount (debit or credit),
  • the merchant (“Coastal Spoon Cafe”, “Harbor Noodle House”, etc.),
  • a category (“Dining”, “Groceries”, “Housing”…).

Banks rarely offer interesting dashboards. LLMs, on the other hand, are great at understanding plain-English questions — but they can’t compute. The right combination:

LLM to understand the question → SQL to compute the answer → LLM to phrase it.

That’s the central idea of this project: an assistant that uses a tool. The LLM doesn’t make up the numbers; it writes SQL, has it executed, reads the result.

You care aboutThis project gives you
PrivacyData never leaves your machine
CostZero — no API key, no per-question billing
OfflineWorks on a plane, in a cafe, anywhere
HackabilitySwap the LLM with one ollama pull

The trade-off: latency. A question on CPU takes ~5–15 seconds with llama3.1:8b. If you want sub-second answers and don’t mind the cloud, see Project 2.

bank CSV (data1-anonymized.csv, 734 rows)
┌─────────────────────────┐
│ csv-llm-shared/ │ ← shared Python module (Project 3)
│ ingest.py │ • reads CSV
│ normalize.py │ • signs amounts, parses dates
│ db.py │ • SQLite + SELECT-only
│ categorize.py │ • rules + LLM fallback
│ dashboards.py │ • Plotly
└────────────┬────────────┘
csv-llm-ollama/
port 8504
llama3.1:8b
app.py + llm.py

The Streamlit app has three tabs: Dashboards, Transactions, Chat. The Chat tab exposes one tool to the LLM: query_sql(sql) — read-only on SQLite.

By the end, your app must answer these 4 questions without hard-coding anything:

  1. How much did I spend on groceries last month?
  2. What is my biggest spending category?
  3. How many times did I visit Coastal Spoon Cafe this year and how much did I spend?
  4. List my top 5 merchants.

We’ll verify all four against the real data in chapter 09, with the generated SQL and the final answer.

  • Connect to your bank’s API: too much variability, we use a clean CSV export.
  • Build your own LLM: we use llama3.1:8b, free and tool-call capable.
  • Reinvent a UI: Streamlit does it in under 200 lines.
  • An LLM alone doesn’t compute; it writes SQL and reads the result.
  • The app exposes one tool: query_sql(sql) read-only on SQLite.
  • 100% local: no API key, no cloud, no recurring cost.
  • In chapter 02 we’ll look at the demo CSV that ships with the repo.

Next: The demo CSV →