Python

Pausing for Human Feedback in LangGraph
Pausing for Human Feedback in LangGraph

Adding a human-in-the-loop step to a LangGraph flow is an easy way to improve quality and control without adding branching or complexity. In this post we will build a tiny three-node graph that drafts copy with an LLM, pauses for human feedback, and then revises the draft, using LangGraph’s …

Advent of Code 2025: Preparations
Advent of Code 2025: Preparations

Advent of Code 2025 is almost here, and this year I am aiming squarely at speed and optimisation across all 12 puzzles using Python and UV. I will publish a short post every day covering the approach and performance choices, and you are very welcome to join in using whichever language you want to …

Sudoku Series: Implementing Wing Rules
Sudoku Series: Implementing Wing Rules

The next rules to implement for the Sudoku solver are called wing rules. There are a few of these rules used in solving Sudoku, but some are hard to identify and are for very advanced solves. The two needed to solve most Sudoku puzzles are called XY-Wing and XYZ-Wing:

  • XY-Wing uses a pivot cell with …

Controlling flow with conditional edges in LangGraph
Controlling flow with conditional edges in LangGraph

Conditional edges let your LangGraph apps make decisions mid-flow, so today we will branch our simple joke generator to pick a pun or a one-liner while keeping wrap_presentation exactly as it was. In the previous post we built a two-node graph with joke_writer and wrap_presentation, and now we will …

A Primer in LangGraph
A Primer in LangGraph

LangGraph makes it easy to wire simple, reliable LLM workflows as graphs, and in this post we will build a tiny two‑node graph that turns a topic into a joke and then formats it as a mini conversation ready to display or send. By the end, you will have a minimal Python project with a typed JokeState …

Sudoku Series: Implementing the Fish Rules
Sudoku Series: Implementing the Fish Rules

The next rules to implement for the Sudoku solver are called the fish rules. There are three versions of these rules but they all share the same principles:

  • X-Wing works with a 2x2 fish pattern.
  • Swordfish works with a 3x3 fish pattern.
  • Jellyfish works with a 4x4 fish pattern.

If you like this post …

Sudoku Series: Implementing the Locked Candidates Rule
Sudoku Series: Implementing the Locked Candidates Rule

Up until now in the Sudoku Series we’ve implemented a number of rules for Sudoku solving. I had been trying to remember the name of an old iPhone Sudoku app I used to enjoy. The reason I wanted to find it was that it used to be good at reviewing a puzzle and telling you what the next logical …

Sudoku Series: Implementing Hidden Set Rules
Sudoku Series: Implementing Hidden Set Rules

In the last Sudoku Series blog post we implemented the naked pair and the naked triple rules. In this post, we will look at implementing the hidden single, hidden pair and hidden triple rules. Applying these rules is documented on many websites, but the two I’ve liked during my research are …

Sudoku Series: Implementing Naked Set Rules
Sudoku Series: Implementing Naked Set Rules

In the last Sudoku Series blog post we implemented the single candidate rule. In this post, we will look at implementing both the naked pair rule and the naked triple rule. These are documented alongside more advanced rules on a Mastering Sudoku website.

If you like this post and you’d like to …

Sudoku Series: Implementing the Single Candidate Rule
Sudoku Series: Implementing the Single Candidate Rule

This week, we hit a major milestone: our solver can now complete very easy Sudoku puzzles, thanks to the simplest rule of all — the single candidate rule. By writing code that parses the grid repeatedly and looks for opportunities to apply this rule, we’re able to solve some of the simplest …

Sudoku Series: Locating Your Neighbours
Sudoku Series: Locating Your Neighbours

When solving Sudoku puzzles, a lot of the logic is about spotting patterns among groups of cells. In this context, a group of cells are those which must not contain a number among them more than once. Let’s build some logic to pick out groups of cells we might want to work with in our solving …

Migrating from Poetry to UV in a Python Project
Migrating from Poetry to UV in a Python Project

This is a very short post about our move from Poetry to UV in the Sudoku Solver we’re building in Python. I don’t have a definitive reason for switching, but I’ve been experimenting with UV recently and I’m starting to prefer it over Poetry. In this post, we’ll outline the goals of the …