Skip to content

Commit 0d9ebce

Browse files
committed
remove first-person references
1 parent ee2281b commit 0d9ebce

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

_posts/2025-11-12-agentic-ai-patterns.adoc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@ author: mariofusco
88
---
99
:imagesdir: /assets/images/posts/agentic
1010

11-
In the first months of 2025 I published a three-part blog post series on agentic AI with Quarkus and its LangChain4j extension where I first https://quarkus.io/blog/agentic-ai-with-quarkus/[introduced agentic AI and workflow patterns], then explored https://quarkus.io/blog/agentic-ai-with-quarkus-p2/[purely AI orchestrated agentic patterns], and finally examined the https://quarkus.io/blog/agentic-ai-with-quarkus-p3/[differences between these two approaches] with a practical example, trying to put in evidence their pros and cons.
11+
At the beginning of 2025 we started doing some experiments with agentic AI, using Quarkus and its LangChain4j extension, that culminated with the publication of a three-part blog post series on this topic, that first https://quarkus.io/blog/agentic-ai-with-quarkus/[introduced agentic AI and workflow patterns], then explored https://quarkus.io/blog/agentic-ai-with-quarkus-p2/[purely AI orchestrated agentic patterns], and finally examined the https://quarkus.io/blog/agentic-ai-with-quarkus-p3/[differences between these two approaches] with a practical example, trying to put in evidence their pros and cons.
1212

13-
Only a handful of months have passed since those articles, but in the meantime the AI ecosystem, and the possibilities it enables, have evolved at an incredible speed, and I'm trying hard to keep up with all the novelties and changes. In fact the initial experiments that I discussed in that series seem now to come from a different geological era, even though they served me as an important starting point to explore the agentic AI landscape.
13+
Only a handful of months have passed since those articles, but in the meantime the AI ecosystem, and the possibilities it enables, have evolved at an incredible speed, making it increasingly harder to keep up with all the novelties and changes. In fact the initial experiments discussed in that series seem now to come from a different geological era, even though they served as an important starting point to explore the agentic AI landscape.
1414

15-
These experiments and explorations lead me to the implementation of a https://docs.langchain4j.dev/tutorials/agents/[new agentic module] in LangChain4j intended to provide a comprehensive framework for building agentic AI systems. This module also includes a set of predefined agentic patterns that can be used as building blocks to coordinate agents in different ways. I thought that this set of patterns could be quite exhaustive and cover all the possible use cases, but as I continued my experiments, and most importantly discussed them with the community of LangChain4j users, I realized that I was naive and the reality is more complex and nuanced.
15+
These experiments and explorations lead to the implementation of a https://docs.langchain4j.dev/tutorials/agents/[new agentic module] in LangChain4j intended to provide a comprehensive framework for building agentic AI systems. This module also includes a set of predefined agentic patterns that can be used as building blocks to coordinate agents in different ways. Unfortunately, continuing with those experiments, and most importantly discussing them with the LangChain4j community, made it clear that the belief that this set of patterns could be quite exhaustive and cover all the possible use cases was naive and the reality is more complex and nuanced.
1616

1717
== Agentic AI at Devoxx Belgium 2025
1818

1919
Agentic AI was, by far, the most discussed topic at Devoxx Belgium 2025 and we had the opportunity to present there the agentic AI patterns implemented in LangChain4j. In fact, we both gave a https://www.youtube.com/watch?v=X9baI7RBhqk[talk] where we simply exposed with practical examples how those patterns work, and how to use them, and another maybe even more interesting https://www.youtube.com/watch?v=mtWHfYTLeKE[session] where we discussed the steps that brought us to implement the agentic framework as it was together with the mistakes we made and the decision that we had to take during that journey.
2020

2121
As usual at Devoxx, even more important than attending the uncountable talks on agentic AI, was the opportunity to meet so many people working in this field, exchanging ideas and sharing experiences, challenges, and solutions.
2222

23-
I learned a lot from these interactions, and at the end I returned to home with only one clear thought: I will never find an ultimate agent orchestrator pattern, not only because this is not my domain of expertise, but mostly because such a thing does not exist. The variety and complexity of tasks that can be required to an agentic system implies that there cannot be a pattern that works in all situations, a one-size-fits-all solution for agentic AI orchestration.
23+
We learned a lot from these interactions, and returned to home with only one clear thought: we will never find an ultimate agent orchestrator pattern, not only because this is not our domain of expertise, but mostly because such a thing does not exist. The variety and complexity of tasks that can be required to an agentic system implies that there cannot be a pattern that works in all situations, a one-size-fits-all solution for agentic AI orchestration.
2424

25-
In fact, there is a large spectrum of agentic patterns, ranging from reliable but rigid workflows, where agents control flow follows predetermined code paths, to flexible but unpredictable pure agentic orchestration, where LLMs autonomously decide the sequence of actions to be taken, maintaining control over how they execute tasks, and everything in between. In particular this "in between" space could represent the most interesting one, as it allows to balance reliability and flexibility, and since we are not able to better identify it, why at least not giving to users the possibility to shape it in the way they need?
25+
In fact, there is a large spectrum of agentic patterns, ranging from reliable but rigid workflows, where agents control flow follows predetermined code paths, to flexible but unpredictable pure agentic orchestration, where LLMs autonomously decide the sequence of actions to be taken, maintaining control over how they execute tasks, and everything in between. In particular this "in between" space could represent the most interesting one, as it allows to balance reliability and flexibility, and considering the difficulties in better identifying it, why at least not giving to users the possibility to shape it in the way they need?
2626

2727
== A generic architecture for agentic AI patterns
2828

29-
To support this idea, I decided to design a generic architecture for agentic AI patterns that would be customizable enough to allow the widest possible variety of patterns, keeping the possibility of using those patterns as combinable building block that could be seamlessly used together and complement each other.
29+
The natural consequence of these considerations was deciding to design a generic architecture for agentic AI patterns that would be customizable enough to allow the widest possible variety of patterns, keeping the possibility of using those patterns as combinable building block that could be seamlessly used together and complement each other.
3030

31-
To keep this as flexible as possible, I needed to identify the minimal and simplest abstraction that could do the work, thus realizing that an agentic pattern is simply the specification of an execution plan for the subagents that it coordinates. This plan can be defined by implementing the following `Planner` interface:
31+
To keep this as flexible as possible, it was necessary to identify the minimal and simplest abstraction that could do the work, thus realizing that an agentic pattern is simply the specification of an execution plan for the subagents that it coordinates. This plan can be defined by implementing the following `Planner` interface:
3232

3333
[source,java]
3434
----
@@ -46,13 +46,13 @@ public interface Planner {
4646

4747
This interface defines a method to initialize the planner, plus two other methods to plan the first action to be executed and all the subsequent ones. The method returning the first action is optional and by default it simply delegates to the method returning the next action, which is the only one that must be implemented. The `Action` class returned by these two methods represents the next step to be taken by the agentic pattern, and can be one either a list of one or more subagents to be called next, or a signal that the execution has been completed.
4848

49-
All the built-in agentic patterns offered out-of-the-box by the `langchain4j-agentic` module have been rewritten in terms of this `Planner` abstraction. The pull requests implementing this new architecture has been already merged, and I won't go in many details in how it works here, since you can find all the information in https://github.com/langchain4j/langchain4j/pull/3929[its description].
49+
All the built-in agentic patterns offered out-of-the-box by the `langchain4j-agentic` module have been rewritten in terms of this `Planner` abstraction. The pull requests implementing this new architecture has been already merged, and this article won't go in many details in how it works here, since you can find all the information in https://github.com/langchain4j/langchain4j/pull/3929[its description].
5050

51-
The other important point that deserves to be considered is that not only this new architecture gives a chance to users to implement their own agentic patterns, but it also allows to easily combine them with any other pattern, either offered by LangChain4j or implemented by the users themselves. In fact, since all the patterns are now defined in terms of a `Planner`, it is possible to use any pattern as a subagent of any other pattern, thus opening the door to an infinite variety of combinations, as I will demonstrate with the next example.
51+
The other important point that deserves to be considered is that not only this new architecture gives a chance to users to implement their own agentic patterns, but it also allows to easily combine them with any other pattern, either offered by LangChain4j or implemented by the users themselves. In fact, since all the patterns are now defined in terms of a `Planner`, it is possible to use any pattern as a subagent of any other pattern, thus opening the door to an infinite variety of combinations, as the next example is intended to demonstrate.
5252

5353
== Mixing multiple agentic patterns
5454

55-
One of the examples used in the pull request mentioned above to demonstrate this new architecture and how to create your own custom agentic pattern through it, is a goal oriented strategy determining the sequence of agents to be invoked in order to perform a specific complex task.
55+
One of the examples used in the pull request mentioned above to illustrate this new architecture and how to create your own custom agentic pattern through it, is a goal oriented strategy determining the sequence of agents to be invoked in order to perform a specific complex task.
5656

5757
More in detail, in order to put this approach in practice, not only the whole agentic system needs to define a final goal, but also each subagent needs to declare its own preconditions, required to be able to perform its task, and postconditions, that is the outcomes that it guarantees once its execution is completed. However, in agentic LangChain4j, all this information are implicitly already present in the agentic system, as those pre and postconditions are nothing else than the required inputs and produced outputs of each agent, and the final goal is simply the desired outputs of the whole agentic system.
5858

@@ -179,4 +179,4 @@ An agentic system made of multiple small but specialized agents can often outper
179179

180180
By implementing a generic `Planner` interface, LangChain4j enables users to create their own agentic patterns and seamlessly integrate them with existing ones. This flexibility allows for the development of sophisticated agentic systems tailored to specific needs, balancing the strengths of various orchestration strategies.
181181

182-
This also opens the door to users to help enriching the LangChain4j agentic ecosystem, contributing with their own agentic patterns implementations of the `Planner` interface. To this purpose, we created a https://github.com/langchain4j/langchain4j/tree/main/langchain4j-agentic-patterns[dedicated new module], named `langchain4j-agentic-patterns`, where we plan to collect and maintain a growing set of useful agentic patterns that can be used as building blocks to create complex agentic systems.
182+
This also opens the door to users to help enriching the LangChain4j agentic ecosystem, contributing with their own agentic patterns implementations of the `Planner` interface. To this purpose, a https://github.com/langchain4j/langchain4j/tree/main/langchain4j-agentic-patterns[new dedicated module], named `langchain4j-agentic-patterns`, has been added to the LangChain4j project, with the goal of collecting and maintaining a growing set of useful agentic patterns that can be used as building blocks to create complex agentic systems.

0 commit comments

Comments
 (0)