published on: 15-08-2025

<- back to tech

is-tech?

Type, type, type, send. Micro blog post posted to mastodon/bluesky/nostr. It’s related to programming and should show up on my tech blog page. Alright, switch over to web browser to go my site, login, go to edit page, click mark post as tech button. Lot of steps. Oh and it has been a while since the last time I did this. Click, click, click. Okay now there an are a few posts marked. This periodic curation isn’t fun and page quickly gets stale, time to automate.

Since it’s 2025, I first check if an LLM would be useful. This is the rare use-case where I’m trying to automate language understanding / tagging and an LLM is a good fit. So that’s what I’ll use.

After messing around with mistral’s agent playground I came up with a simple system prompt:

“Analyze the text sent and return “1” if it seems related to a tech blog, topics like coding, dev ops, programming, operations systems, code editors, software architecture, software development, hacking, programming job search, open source and so on. Return “0” if not.”

mistral ui
mistral ui

And it works! Now to connect it to my micro-blog-fetchers backend app via the Mistral REST API. That takes 25 lines of Clojure. The architecture looks like this:

The micro-blog-fetchers app scrapes the various social media APIs then calls mistral and saved to pocketable. My personal site then picks up the posts including isTech = yes_ai and renders them on the tech blog page. Here is the code.

arch overview
arch overview

Now that new posts are analyzed, but how to backfill the new isTech field on the thousand older posts? This is where I enjoy Clojure the most. In the REPL I chain together functions to get all the old posts from PocketBase and run them through the LLM and update. If I need something bit more complicated I write a fn in the respective module and use the reload functionality, (require ‘[micro-blog.pocket-base] :reload) , to refresh it in the REPL. This way you can say get all the posts from PocketBase, put them into a var, then map them over a fn to call LLM. But, if the LLM call does not work as expected you can redefined it in the code, reload, and still use the same var without having to call PocketBase again. Cool workflow compared to 99% of programming where variables only survive the single execution. I’ll keep using Clojure for my personal projects.

Done and dusted. At the cost of 9 cents, it would be cool to get the LLM usage also on premise. Problem is currently non of my computers in the cluster have dedicated GPUs, problem for another day.

mistral cost
mistral cost