A goal names a desired result an agent should achieve. In Embabel, an action annotated with @AchievesGoal marks the finishing point of a workflow. section 12.3.2
Use goals to structure agent behavior:
- Define the desired outcome, such as determining game mechanics or player counts. section 12.3.2
- Work backward by adding actions that supply the workflow needed to reach the goal. section 12.3.2
- Inspect goals and their preconditions through the agent shell, then execute user input against the resulting workflow. section 12.3.6
Listing 12.8 An action method that achieves the goal of determining game mechanics
@Value("classpath:/promptTemplates/mechanicsDeterminer.st") #1
Resource mechanicsDeterminerPromptTemplate;
@Action
@AchievesGoal(description = "Game mechanics have been determined.") #2
public GameMechanics determineGameMechanics(GameRules gameRules) {
LOGGER.info("Determining mechanics from rules for: {}",
gameRules.gameTitle());
var prompt = promptResourceToString(mechanicsDeterminerPromptTemplate, #3
Map.of("gameRules", gameRules.rulesText()));
return PromptRunner.usingLlm()
.createObject(prompt, GameMechanics.class); #4
}
Shows an action that uses @AchievesGoal to derive structured game mechanics from game rules through an LLM. section 12.3.2










