Python
Using Tools in LangGraph
LLMs are impressive, but they are limited to the knowledge baked in at training time and can’t take actions in the world on their own. Tools are what change that. By giving an LLM access to tools, you turn it from a system that is frozen in time into an agent that can look up live data, run …
Pydantic Settings: A Safer Config Option for your Python Apps
Environment variables are the default way many Python apps handle configuration. They are simple, portable, and work in every deployment environment. But as soon as you add more than a handful of settings, raw env vars become fragile and hard to reason about.
Pydantic used to solve this with …
Improving Python Code Quality and Consistency Using Ruff
Consistency and quality are the foundations of maintainable Python code. As projects grow and teams expand, maintaining these standards becomes increasingly challenging without the right tools. Ruff is an extremely fast linter and code formatter written in Rust that helps teams improve their code …
Sudoku Series: Nishio Rule
The next rule to implement for the Sudoku solver is Nishio. This will make all outstanding puzzles solvable because it effectively brute forces the removal of an invalid candidate until other rules can take over.
If you like this post and you’d like to know more about how to plan and write …
How To Use Text Embeddings
Embeddings let software work with meaning rather than just matching words, so you can search by intent, find related content, and give LLMs the right context to answer questions. In this post we will start from first principles, show what these vectors actually are, explain their useful properties, …
Structured Output in LangGraph
Large language models are incredibly versatile, but when your code depends on predictable data structures, free‑form text can be a headache. The same information can be expressed in countless ways, making downstream processing error-prone. Structured output bridges this gap: by defining a schema, …
Advent of Code 2025: A Retrospective
In software engineering, it’s typically very good to have a retrospective after a sprint of work. The goal isn’t just to celebrate successes or catalogue frustrations, but to step back and deliberately reflect: what worked well, what didn’t, and what lessons are worth carrying forward? Advent …
Advent of Code 2025: Day 12
Day 12 is the last day of Advent of Code 2025, and the last day is historically quite easy. The puzzle today looks like a polyomino packing puzzle at first glance, but for this input it reduces neatly to a capacity check on occupied cells per region. This was an assumption on my part because of the …
Advent of Code 2025: Day 11
Day 11 is about counting all possible paths through a graph between two specific nodes. This sort of problem is best solved with a depth-first search using memoisation. A tiny bit of state is added in to enforce constraints in Part 2.
The whole thing runs in well under a millisecond per part on my …
Advent of Code 2025: Day 10
Day 10 is by far the hardest puzzle so far in 2025. First a classic bit-flipping puzzle that reduces to XOR over bitmasks, then a minimal-presses counter puzzle modelled as an integer optimisation. If you want to follow the whole series, check out the tag page at Advent of Code, and you can browse …
Advent of Code 2025: Day 09
Day 9 asks for the largest axis-aligned rectangle defined by any two corner coordinates in the input. It then graduates to validating that a candidate rectangle must lie wholly inside the rectilinear loop traced by those corners. Part 1 is a straightforward exhaustive search over corner pairs with …
Advent of Code 2025: Day 08
Day 8 is all about finding edges between 1,000 nodes in a graph, each with a 3D set of integer coordinates. Graphs can be computationally expensive if the wrong types are used, but my solutions run in under a second for each part of the puzzle. Let’s take a look at the puzzle specifics and how …











