---
title: "Software That Debugs Itself While I Sleep"
description: "Rather than manually debugging AI failures, I built a Ralph Wiggum loop that pushes the model against its failures each night until it dreams a correct solution."
categories: ["AI","agents","software engineering"]
keywords: ["Ralph Wiggum technique","AI agents","implicit feedback loops","DSPy","prompt optimization","Asana automation","Geoffrey Huntley","self-improving AI","nightly debugging"]
ai_summary: "A nightly loop finds failed AI tasks, debugs them automatically using DSPy, and iterates until the prompts work. The system wakes up smarter than it went to sleep."
date: 2026-01-16
lastmod: 2026-08-21
canonical_url: https://www.tomtunguz.com/implicit-feedback-loops/
author: "Tomasz Tunguz"
---


This week I chatted with an acquaintance who mentioned a board game. I caught half the title & looked for the full title & Amazon link using my [AI in Asana](https://tomtunguz.com/agent-asana-inflection/).

{{< email_image src="xcgvecsenm0qqqqkifnv" alt="Board Game Query Failure" width="540" height="246" >}}

{{< email_image src="jlovwp9m8etosts7tjat" alt="AI Agent Failure Logs" width="540" height="373" >}}

The system tried with Gemini & failed. The failover to Claude also failed. Rather than continuously iterating with the AI until it worked, I created a Ralph Wiggum loop.

[Geoffrey Huntley](https://ghuntley.com/ralph/) coined this pattern. Named after the persistently [clueless Simpsons character](https://en.wikipedia.org/wiki/Ralph_Wiggum), the idea is simple : keep pushing the model against its failures until it dreams a correct solution just to escape the loop. The system is deterministically bad in an undeterministic world. Iteration beats perfection.

{{< email_image src="rg8ybtsywujvuvwarsdb" alt="Implicit Feedback Loops Flowchart" width="540" height="961" >}}

Now an AI loop runs each night. It finds all tasks with "failed" in them. It creates a plan to debug & iterates until the prompt solves the task.

So far this naive system is working pretty well. There is a risk it might begin to oscillate between two optimal states, but I haven't observed that in the few days it's been running. It's something I'm watching.

AI creates software cheaply; excellence requires iteration. Implicit feedback loops are how you get there.

This self improving loop ensures the system wakes up smarter than it went to sleep. So do I.
