Skip to content

Commit 474f89c

Browse files
committed
Expand README with Planning Pattern overview and travel-planning sequence diagram
1 parent e6b9866 commit 474f89c

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

README.adoc

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,70 @@ style AttractionService fill:#F8F7F7,stroke:#019DDC,stroke-width:2px,color:#1D51
6363
style CityRepository fill:#F8F7F7,stroke:#019DDC,stroke-width:2px,color:#1D5183
6464
style AttractionRepository fill:#F8F7F7,stroke:#019DDC,stroke-width:2px,color:#1D5183
6565
style MongoDB fill:#1D5183,stroke:#019DDC,stroke-width:2px,color:#F8F7F7
66+
----
67+
68+
== Planning Pattern
69+
70+
Traditional software typically follows a static execution flow where developers explicitly define each step through method calls, conditions, and workflows. AI systems introduce a different paradigm. Instead of following a predetermined path, the model evaluates a goal and dynamically determines which actions should be executed.
71+
72+
The Planning Pattern enables the model to decompose a request into smaller tasks, select the appropriate tools, retrieve information, and compose a final response. This allows enterprise applications to combine deterministic business logic with the flexibility of AI-driven decision-making.
73+
74+
For example, when a user asks:
75+
76+
[source,mermaid]
77+
----
78+
%%{init: {
79+
"theme": "base",
80+
"themeVariables": {
81+
"primaryColor": "#F8F7F7",
82+
"primaryTextColor": "#1D5183",
83+
"primaryBorderColor": "#1D5183",
84+
"lineColor": "#019DDC",
85+
"secondaryColor": "#F8F7F7",
86+
"secondaryBorderColor": "#019DDC",
87+
"tertiaryColor": "#1D5183",
88+
"tertiaryTextColor": "#F8F7F7"
89+
}
90+
}}%%
91+
92+
sequenceDiagram
93+
94+
actor User
95+
96+
participant UI as JSF + PrimeFaces
97+
participant Agent as AI Travel Agent<br/>(TravelService)
98+
participant CityTools as CityTools
99+
participant AttractionTools as AttractionTools
100+
participant MongoDB as MongoDB
101+
102+
User->>UI: Create a historical itinerary in Portugal
103+
104+
UI->>Agent: chat(userMessage)
105+
106+
Note over Agent: Analyze goal and create a plan
107+
108+
Agent->>CityTools: citiesByCountry("Portugal")
109+
110+
CityTools->>MongoDB: Find cities
111+
MongoDB-->>CityTools: Lisbon, Porto
112+
CityTools-->>Agent: Available cities
113+
114+
Agent->>AttractionTools: attractionsByType("Lisbon", HISTORICAL)
115+
116+
AttractionTools->>MongoDB: Find attractions
117+
MongoDB-->>AttractionTools: Historical attractions
118+
AttractionTools-->>Agent: Lisbon attractions
119+
120+
Agent->>AttractionTools: attractionsByType("Porto", HISTORICAL)
121+
122+
AttractionTools->>MongoDB: Find attractions
123+
MongoDB-->>AttractionTools: Historical attractions
124+
AttractionTools-->>Agent: Porto attractions
125+
126+
Note over Agent: Build itinerary from tool results
127+
128+
Agent-->>UI: Travel recommendation
129+
130+
UI-->>User: Render recommendation
131+
66132
----

0 commit comments

Comments
 (0)