01 — Overview and goals
Duration: 8 min Prerequisites: none. Some Python helps; Course 2 is a plus but not required.
Why this project
Section titled “Why this project”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.
Why fully local
Section titled “Why fully local”| You care about | This project gives you |
|---|---|
| Privacy | Data never leaves your machine |
| Cost | Zero — no API key, no per-question billing |
| Offline | Works on a plane, in a cafe, anywhere |
| Hackability | Swap 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.
Architecture in one diagram
Section titled “Architecture in one diagram” 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.pyThe Streamlit app has three tabs: Dashboards, Transactions, Chat. The Chat tab exposes one tool to the LLM: query_sql(sql) — read-only on SQLite.
The 4 canonical questions
Section titled “The 4 canonical questions”By the end, your app must answer these 4 questions without hard-coding anything:
- How much did I spend on groceries last month?
- What is my biggest spending category?
- How many times did I visit Coastal Spoon Cafe this year and how much did I spend?
- 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.
What you won’t have to do
Section titled “What you won’t have to do”- 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.
Takeaways
Section titled “Takeaways”- 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.