Most agents fall over the moment you stop watching them. A rate limit hits, a container restarts, a feed sends back garbage, and (sadly) the whole run is gone…
The moral of the story is this one:
"Building an agent is easy, but building a system you can leave running (and trust!) is the hard part".
That second part is the hard one, and it's the part almost nobody teaches.
So we built one in the open, over six weeks. The Substack Brain is a living knowledge base made from the AI newsletters you want to read but never have time for. It pulls articles from RSS feeds, keeps itself fresh, works out who said what, and lets any agent search it and cite its sources.
Along the way, you’ll learn the three skills that separate a demo from a production system:
Harness engineering. Everything around the LLM call: retries, idempotency, and evals built from real failures.
Durable execution. Every step runs on Inngest, so a crashed run picks up where it stopped instead of starting over.
Knowledge graphs. Claims go into Memgraph, so you can ask who said something and when, not just what was said.
The stack is Python, FastAPI, Postgres with pgvector, Inngest, Memgraph and MCP. By the end, you can plug the Brain into Claude Code, Cursor or Codex.
The course starts small: one newsletter, five articles, one Postgres table. Each lesson adds one hard problem. Every lesson below comes with a written article, a full YouTube video and a recorded office hours session.
That's hours and hours of production AI engineering, completely free!
Lesson 1: Our First Inngest Durable Pipeline
We start by building a durable RSS importer that you trigger over HTTP. One feed goes in, and seven Inngest steps take it from raw XML to embedded chunks in Postgres with pgvector.
Then we break it on purpose: kill the embed step halfway, restart, and watch only that step rerun. We finish with a first look at sparse (BM25) versus dense retrieval on the same articles.
📕 Article
🎙️ Office Hours
Lesson 2: Scaling Production RAG
Let's be honest … five articles is a toy. In this lesson we backfill 100 to 300 of them, which is where rate limits and partial failures start to bite.
We combine BM25 and dense vectors into hybrid retrieval inside Postgres. Then we get the first LLM answer out of the Brain, with clickable citations you can check yourself.
📕 Article
🎙️ Office Hours
Lesson 3: Temporal Versioning for Production RAG
A knowledge base that goes stale is just an archive. We add a low-cost poller that checks every feed for new posts and only pulls in what changed. Then we wrap the Brain in an MCP server, so Claude Code, Cursor or Codex can search your newsletters as if they were a built-in tool.
📕 Article
🎙️ Office Hours
Lesson 4: Knowledge Graphs for Durable Agents
Vector search finds similar text, but it can't tell you that two authors disagree, or that someone changed their mind last month.
In this lesson an LLM extracts claims from every article and stores them in a temporal knowledge graph in Memgraph. Each claim is tied to who made it, when, and where. Because extraction runs as durable steps, a failed article gets retried without reprocessing everything else.
📕 Article
🎙️ Office Hours
Lesson 5: Error Analysis for Durable Agents
Generic benchmarks won't tell you where your system breaks. Here we do error analysis on the Brain's real mistakes: wrong citations, missed articles, bad claims.
Then we turn them into an evaluation suite. Every future change gets tested against the failures that actually happened.
📕 Article
🎙️ Office Hours
Lesson 6: Durable Research Agents in Production
Now everything comes together. We build a bounded research agent, one with clear limits, that digs through the Brain to answer harder questions. We add a weekly digest so the newsletters you never got to come to you. Finally, we deploy the whole system to production, ready to keep running without you.
📕 Article
🎙️ Office Hours
Our Sponsor
None of this would have been possible without Inngest.
A huge thank you to the Inngest team for backing this project. Supporting a free, fully open-source course, where every line of code is public and every lesson is available to everyone, is a real bet on the developer community, and I’m genuinely grateful for it.
Thanks for making this happen! 🙌

















Lesson 1's kill-the-embed-step demo is the one I'd make people run twice. If that step dies after inserting half the chunks, the rerun inserts them again unless the table upserts on something like (article_id, chunk_index). Inngest reruns the step. It doesn't undo the partial write.
"A system you can leave running and trust" is exactly the hard part. In my own one-person lab, what helped most was making every research step leave a record: which source, which hash, who checked it. How do you audit an agent's run after a restart?