liveBook · Manning

Embabel

As explained in Spring AI in Action

Embabel is a framework for building software agents that can perform goal-directed tasks using language models and external capabilities.

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

How Spring AI in Action covers it

How deep it goes
Descends from framework architecture through project setup, annotations, typed actions, prompt templates, shell execution, and MCP exposure.
Examples
Uses a Java GameInfoAgent that extracts Azul, loads PDF rules, and determines player counts or board-game mechanics.
What it assumes
Assumes Java and Spring Boot development, while introducing agent actions, goals, typed workflow inputs, prompt templates, and MCP exposure.
What you can do after
Builds from scratch a typed, self-planning Spring Boot agent and operates it through the Embabel shell or MCP Inspector.
How it connects
Connects Spring AI, Goal-Oriented Action Planning, Spring Boot, Java, language models, and Model Context Protocol.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.