Embabel is a JVM framework for building goal-directed software agents. Developers define annotated actions rather than explicit workflows; Embabel uses action preconditions, postconditions, types, and goals to plan a route toward the requested result. section 12.3 section 12.3.3
Embabel builds on Spring AI and uses Goal-Oriented Action Planning (GOAP) instead of delegating the complete plan to an LLM. This combines familiar Spring components with automatic action selection. section 12.3 section 12.4
A practical Embabel agent typically develops through these steps:
- Create a Spring Boot application, add the Embabel repository and agent starter, and implement the agent in Java. section 12.3.1
- Annotate an agent class with @Agent and its workflow methods with @Action; mark terminal methods with @AchievesGoal. section 12.3.2
- Represent intermediate inputs and outputs with types such as GameTitle, RulesFile, GameRules, GameMechanics, and PlayerCount. section 12.3.2 section 12.3.3
- Use PromptRunner.usingLlm() with injected prompt templates when an action needs language-model extraction or classification. section 12.3.2 section 12.3.5
- Expose goal-achieving actions through MCP by adding @Export metadata, then connect an MCP client or MCP Inspector. section 12.3.7
Board-game information agent
A GameInfoAgent accepts Embabel's UserInput, extracts a game title, finds the corresponding rules file, loads its contents with Spring AI's TikaDocumentReader, and derives player counts or mechanics. For “How many can play Azul?”, the shell trace shows three LLM calls and returns a two-to-four-player result. The same goal actions can be exported as MCP tools. section 12.3.3 section 12.3.6 section 12.3.7
@Action
@AchievesGoal(description = "Player count has been determined.",
export = @Export(
name = "playerCount",
remote = true,
startingInputTypes = UserInput.class))
public PlayerCount determinePlayerCount(GameRules gameRules) {
// ...
}
@Action
@AchievesGoal(description = "Game mechanics have been determined.",
export = @Export(
name = "gameMechanics",
remote = true,
startingInputTypes = UserInput.class))
public GameMechanics determineGameMechanics(GameRules gameRules) {
// ...
}
Inspect the MCP export annotations that turn goal-achieving Java methods into remotely callable player-count and game-mechanics tools. section 12.3.7
