Patterns · working with agents

One app, start to finish.

What does a real agent-assisted system look like when it runs every day? One reading app: each morning it turns feeds and newsletters into a ranked digest of tech reading, mailed to me and shown in a web app that only my devices can reach. It is a good first look because it uses most of the moving parts: a hosted feed service, cheap local models beside paid cloud ones, a database, and a set of timers that keep it honest.

The flow

One app: from feeds to a daily digest, and what keeps it alive Three lanes, read left to right. I choose the sources. On the middle lane a hosted feed service collects them, an ingest job reads them, a cloud model ranks them, a cloud model composes and mails the digest, and a web app stores and serves it. Two gates hang below that line: a small local model triages between ingest and rank, and a second small model removes duplicates between rank and compose. I read the digest by mail or in the web app, and my clicks and approved weights shape the next run. Under the web app, a restore test and smoke and heartbeat checks watch the stack. kept ranked mail web app my clicks and approved weights shape the next run Also on timers: hourly refresh, weekly optimizer, nightly backup, retention 1 I pick sources, rules 2 Feed service hosted feeds 3 Ingest on a timer 4 Triage small model 5 Rank cloud model 6 Dedup small model 7 Compose writes, mails 8 Web app stores, serves 9 I read mail or web 10 Restore test weekly drill 11 Smoke and heartbeats I DECIDE THE SYSTEM ACTS A GATE CHECKS
  • I decide
  • The system acts a job, a service or a model
  • A gate checks

Numbers match the steps below.

Steps

  1. MeChoose what goes in

    Feeds sit in folders in a hosted reader. Newsletters get in only through a forwarding rule that I add myself for each sender. My own likes and dislikes, set in the reader, teach it what I want.

  2. Feed serviceCollects and stores the feeds

    A hosted account does the fetching, storing and first de-duplication, so I do not run a crawler. A few sources are fetched directly instead.

  3. Ingest jobReads everything on a timer

    A small Python job runs every morning and again on a light refresh each hour. It is plain code on a schedule: nothing in it decides what is worth reading.

  4. TriageDrops what I would skip

    The editorial gate. A small model that runs on a machine of my own reads each item. If that model is unreachable, the step falls back to a cheap cloud model rather than passing everything through.

  5. Cloud modelRanks what is left

    A stronger cloud model scores the items. This step and the compose step are the paid calls; the small-model steps cost nothing.

  6. DedupRemoves repeat coverage

    A second small model groups items that cover the same story. A zero-guard stops it from returning nothing, because an empty result would otherwise mail a blank digest.

  7. Cloud modelComposes the digest and mails it

    The model writes the digest. The run mails it from a sender address reserved for this stream, and posts it to the app's API.

  8. Web appStores it and serves it, private

    An API and a database keep every digest and a web app shows them. The app answers only to my own devices; anyone else gets a 404.

  9. MeRead, and decide what counts

    I read the mail or the app. Clicks are recorded. Each week an optimizer proposes new source weights, and they stay pending until I approve them.

  10. Restore testProves the backup comes back

    A nightly backup copies the database off the machine. A weekly job restores the newest copy into a throwaway database. A quarterly drill boots the app images against a restored copy.

  11. Smoke and heartbeatsNotice when it stops

    Smoke checks the containers, the endpoints, backup age and that the public path says no. A job that stops reporting success trips a dead-man alert, and a failed run mails me.

Guardrails

What checks it

Smoke and heartbeats

  • Smoke covers the services, the endpoints, how old the last backup is, and that the public path answers 404, never 200.
  • Every scheduled job leaves a success marker with a maximum age. A stale marker raises an alert, and so does a heartbeat that stops arriving.
  • The two jobs that only tune things (the hourly refresh and the optimizer) are deliberately unwatched, because their failure costs nothing.

What waits for me

My call

  • Database migrations, and any change to who can sign in or what data is kept.
  • The optimizer's reweighting proposals, and any new newsletter rule.
  • Every deploy follows the same written ship procedure, so a live change is never improvised.

What backs it up

Dump, restore, drill

  • A nightly dump to storage off the machine, with a month of history kept.
  • A weekly restore test, so a backup is proven by use rather than assumed.
  • A retention job prunes old rows, so the database does not grow without bound.

The idea

A useful system is mostly plumbing around a few model calls. Put the cheap, replaceable models at the gates, spend the paid ones where judgment matters, and make every stage fail loudly: a zero-guard against a blank result, a backup proven by a restore, a heartbeat for every job. I choose the inputs and approve any change to the weights; the rest runs without me and tells me when it does not.

Copied