Build your Agent

Building local, offline AI assistants for real tasks

Today

Today’s Helpers

Valerio Ciotti

Valerio Ciotti

Team lead for the Consumer and Affluent Data Science Team.

Veeraraghavan Veerasubramanian

Veeraraghavan Veerasubramanian

Senior Data Scientist for the Consumer and Affluent Data Science Team.

Today

Today's Menu

Talk What an agent actually is and what we will build. ~45 minutes. Slides, one live demo, no keyboards yet.
Hands-on Run the Agent: a Content Curator that reads, judges, and compiles articles into an e-book. ~1.5 hours. Change agent's behaviour, test, iterate, have fun.

Everything today runs on your own laptop. No cloud, no API keys, nothing leaves your machine.

Today

What is today about?

Explore

Get inspired to use things locally — test it, break it, repair it, poke around.

Enjoy

Give yourself permission to just enjoy spending the time discovering what's possible.

Automate

Leave with one part of your own life a little more improved, or automated.

Today

The full 3 hours

9:00 – 9:45
Presentation — what an agent is, what can and cannot do, how to run one on your machine.
9:45 – 10:00
What are we going to build today? An agent's demo.
10:00 – 10:30
Activity: “Be the agent”. Understand what the agent does and how it makes decisions.
10:30 – 10:45
Break.
10:45 – 11:30
Run end-to-end + “break it and see what happens” (mistune the prompt, watch decisions flip).
11:30 – 11:45
Read the result on Calibre/e-reader/phone, regroup, compare what each track built.
11:45 – 12:00
Discussion + wrap-up + showcase your work.

Block A · What is an agent?

You've all used a chatbot. Today we build something that does things, not just answers.

Block A · What is an agent?

Chatbot vs. agent

Chatbot

You ask, it answers, the conversation ends. Nothing happens unless you type again.

Agent

It perceives something, decides what matters, and takes an action — often in a loop, often without you in every step.

Block A · What is an agent?

What is an agent?

Strip away the hype: an agent is software that perceives something, decides what it means, and acts — on its own, in a loop — instead of waiting for you to do each step by hand.

🌡️ A thermostat

Perceives the room's temperature, decides it's too cold, acts by turning on the heat. No AI involved — the simplest possible agent.

🧹 A robot vacuum

Perceives a wall through a bump sensor, decides to turn, acts by changing direction. Still just a loop.

📚 Today's build

Perceives a new article, decides — using a language model's judgment — whether it matches your interest, acts by adding it to your book.

Block A · What is an agent?

When is the use of an agent appropriate?

The perceive → decide → act loop is worth the extra complexity only when "decide" needs real judgment. A quick gut check ↓

✗ Not an agent problem

The rule already exists — writing it down is the whole job.

  • Track a price on a page and alert if it drops below a number — a scheduled script + if/else
  • Rename ten thousand files to a fixed pattern
  • Pull an API every five minutes and log the response
  • Check that a CSV's columns match a fixed schema

✓ Good fit for an agent

The output depends on judgment a script can't cheaply encode.

  • Read a stack of PDFs and pull out the ones that actually match a research question
  • Triage support tickets by what the person actually means, not a keyword match
  • Draft a first-pass reply that references the right internal doc
  • Turn a messy meeting transcript into real action items

Block A · What is an agent?

Task, workflow, or agent?

Task One model call. Summarize this. Classify that.
Workflow Several model calls, chained through control flow you wrote — judgment at fixed points you decided.
Agent The model decides its own next steps at runtime — which tool to call, whether to retry, when to stop.

The system we built today is a workflow, not an agent.

Our code hardcodes the order — discover → scrape → summarize → decide → publish, every run. The model only fills in judgment; everything else is plain code. Same model, different code, and this could be a real agent instead.

Not a flaw — the right call. Anthropic recommends workflows for well-defined tasks like this one: predictable, cheap, errors don't compound. Full agentic autonomy is for genuinely open-ended problems.

Block A · What is an agent?

The loop

PERCEIVE EXTRACT DECIDE ACT repeat
Perceive

Notice something — a new article, a price, an email.

Extract

Pull out what matters from the noise.

Decide

Judge it against a goal.

Act

Do something real — send, write, save, notify.

Block A · Live

Talk to your model, right here ↓

If Ollama is running on this laptop, this talks to it directly — nothing leaves the room.

not connected
Output streams here once you hit Send.

Block A · The model

What you actually just talked to

ModelGemma 4, Google DeepMind — April 2026
This buildgemma4:e2b — the smaller of two on-device sizes (e2b / e4b)
"e2b" means2.3B effective parameters — not the whole story, see right
On disk~7 GB — more than 2.3B params' worth, because of how it's built
Context window128K tokens available; this project caps it at 8K — plenty for one article
Modalitytext, image, audio, video — we only ever send it text
Made concrete

2.3 billion parameters is enough that just writing them out as plain numbers, one per line, would fill roughly 40,000 novels. The 7 GB on disk is about the size of 2,000 photos on your phone. And the unused 128K context window is roughly a whole novel's worth of text in one go — this project only ever fills about 6% of it, one article at a time.

“Effective” parameters aren’t the whole file. Gemma 4’s small models use Per-Layer Embeddings — a lookup table bolted onto every layer, cheap to store, cheap to query, not part of the “active” compute spent per token. It’s what lets a file this size run this well on a laptop CPU.

And “thinking”? Gemma 4 also has an optional extended-reasoning mode — put a <|think|> token in the prompt and it writes out a chain of thought before answering.

Block A · What is an agent?

Today's build, on the same loop

The loopThe Content Curator
PerceiveChecks each source's RSS feed for new articles — falls back to scraping the homepage only if there's no feed.
ExtractSummarizes each article with the local model.
DecideJudges the summary against an interest you wrote in plain English.
ActCompiles the approved ones into an e-book — tags, a quiz, a link back to the source.

Block B · Why local?

Three reasons

Privacy

Nothing you read or write leaves your laptop. No third party sees your interests, your sources, or your drafts.

Cost

Free after setup. No per-token bill, no quota, no surprise invoice for a batch job that ran long.

Offline

Works on a plane. Works when the venue wifi doesn't. The model is a file on disk, not a service you call.

Block B · Why local?

Small local models are weaker than the giant cloud ones.

That's not a footnote — it's useful. The constraint forces habits that sloppy prompting against a huge model lets you skip:

clear prompts structured output knowing when not to use the model

Block A · Live

Demo time →

Hands-on

Now you're going to be the agent — literally.

ScoutSummarizerJudgePublisher

Hands-on · You vs. Gemma

Judge five articles, then check Gemma's homework

Groups of five. Same prompt, same five articles — everyone judges by hand first, then runs it through Gemma and sees where they agree.

Reader's interest

I want practical, evidence-backed articles about focus, attention, and deep work — things a busy person could actually try this week. Prefer real research or genuine lived experience behind the claims, concrete techniques over vague advice.

Reject generic productivity-app marketing and listicles, opinion pieces with no real evidence or experience behind them, and anything not actually about focus or attention.

Whole room · ~40 minutes
  1. 1Alone, 15 min — read the prompt, then all five articles on the next slide. Mark each approve or reject, privately.
  2. 2Groups of five, 10 min — compare calls, argue the disagreements, agree on one verdict per article.
  3. 3Run the same prompt and articles through Gemma, 10 min.
  4. 4Whole room, 5 min — where did you agree with the model? Where didn't you?

Hands-on · You vs. Gemma

Five articles — scan and read

Reader's interest — same as last slide

I want practical, evidence-backed articles about focus, attention, and deep work — things a busy person could actually try this week. Prefer real research or genuine lived experience behind the claims, concrete techniques over vague advice.

Reject generic productivity-app marketing and listicles, opinion pieces with no real evidence or experience behind them, and anything not actually about focus or attention.

A · Can't pay attention? You're not alone

B · On the Value of Hard Focus

C · Productivity Hacks That ACTUALLY Work for Me

D · Aristotle, Aelian and the giant octopus

E · Habit Formation and Willpower

Facilitator only — what Gemma actually said

A — approve. “The article presents empirical research on the impact of technology on attention spans.”

B — approve. “The article directly addresses developing sustained focus through a trainable process.” Borderline on evidence quality — did every group agree?

C — approve. “The article provides concrete, actionable systems for improving focus and productivity.” Borderline on authenticity — the summarizer never sees the affiliate links and course pitch a human reader would. Would you have approved it after reading the whole page?

D — reject. “The article discusses the history of citizen science rather than focus, attention, or deep work.” Clean, correct, no ambiguity.

E — reject. “The article focuses on general habit formation rather than specific, evidence-backed techniques for focus or deep work.” Borderline on topic fit — real research, well-argued, but is habit/willpower close enough to count? The one most likely to split the room.

Hands-on

What to click, and when

Same two files on your laptop, every time — no terminal, no typing.

When
🍎 Mac
🪟 Windows
First time ever
run_app.command
run_app.bat
Every time after that
Content Curator.app
Content Curator.vbs
No black window, after the first run. The second row opens straight in your browser — the server keeps running quietly in the background and stops itself a little after you close the tab, or with the ⏻ Quit the app button in the sidebar.

Hands-on · Your own run

Now break it on purpose

10:45 – 11:30 · Run end-to-end
  1. 1Run your own build, start to finish — your prompt (the one you just tuned, or your own from scratch), your sources, for real.
  2. 2Then break it on purpose: loosen the prompt until junk gets through, or tighten it until nothing survives.
  3. 3Watch which articles flip, and why — that's the model's judgment changing, not a bug.
11:30 – 11:45 · Read & compare
  1. 4Open the result — Calibre, an e-reader, or just your phone. See it in the format it was built for.
  2. 5Regroup and compare what each track built: what did your prompt keep that a neighbor's rejected?
← Portfolio