Game Instructions

Tap a tile to toggle its color. When a tile changes nearby tiles may change as well. Each move affect multiple tiles. The target is to turn all tiles into yellow in the fewest steps possible.

Press 'j' to show/hide the game. Press 'i' to show/hide the instructions. Press 't' to show/hide the top score table.

Steps: 0

Top Scores

Name Steps
Press J to toggle the game, I to toggle instructions, and T to toggle the top scores

Congratulations!

You solved the puzzle in 0 steps!

Success!

Score submitted successfully!

Error

Failed to submit score. Please try again.

Conf42 AI Agents 2026: Orchestrating AI Agents with Pattern Matching

Online Conference
AI agents are inherently non-deterministic. Their outputs may vary even when they receive the same input. Yet the software that orchestrates those agents still needs predictable control flow.

As software development moves from applications that use a single AI agent toward systems involving multiple cooperating agents, orchestration becomes increasingly important. Consider a system with several specialized agents: one plans a solution, another generates code, another reviews it, and perhaps additional agents perform testing, validation, or deployment.

Each agent is probabilistic. Its response is not guaranteed to be identical every time. The orchestration layer cannot be probabilistic.

At some point, our application needs to decide:

  • Which agent should execute next?

  • Should we continue or terminate?

  • Should we retry?

  • Should we request clarification?

  • Should we send the result to another agent?

  • Should we handle an error?

  • Have we covered all possible outcomes?

This is where pattern matching becomes especially interesting. The talk I delivered at Conf42 AI Agents 2026 on September 24 explores this idea through practical Java code examples.

The Video

The talk was captured on video. You can find that video on YouTube at https://youtu.be/Ef2ee-uObLo?si=zQsrjH8tBqKqCeZR. 

The Code

The code is available for you to download at https://tinyurl.com/aiagentspatterns. If you encounter any diffculties with running these code samples don’t hesitate and let me know. I will be more than happy to assist. 

AI is changing software development quickly. Many of the fundamental principles of software engineering remain important. Perhaps they are becoming even more important. As applications rely on more AI agents, developers need ways to control how those agents interact, how their outputs are interpreted, and how the system moves from one state to another. Pattern matching provides one interesting mechanism for doing exactly that.

Share:

Custom Gatherer

Creating a Custom Gatherer in Java

The gatherers allows us to define custom intermediate stream operations with their own state, processing logic, parallel-combination strategy, and finishing behavior. They are especially useful when standard stream operations are not expressive enough.

The CopyOnWriteArrayList Class

Working with CopyOnWriteArrayList in Java

The CopyOnWriteArrayList class is a thread-safe collection designed for cases in which reads are frequent and modifications are relatively rare. Its copy-on-write strategy makes iteration simple and safe, but writes come with an additional cost.

Laptop Image

Working with Java Modules from The Terminal

The Java Platform Module System allows us to organize applications into explicit modules with clearly defined dependencies and exported packages. Although IDEs automate much of the process, working with Java modules directly from the terminal is one of the best ways to understand how the module system actually works.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences