liveBook · Manning

Pipeline

As explained in Spring AI in Action

A workflow is an explicitly defined sequence of operations that coordinates application processing steps.

A workflow is an explicitly defined sequence of operations that coordinates application-processing steps. In Embabel, annotated action methods form workflows whose inputs and outputs are connected through types. section 12.3.2 section 12.3.3

Build a workflow by:

  • Defining intermediate actions such as loading game rules without marking them as goals. section 12.3.3
  • Declaring goal-producing actions with @Action and @AchievesGoal. section 12.3.2
  • Allowing compatible record types, such as GameRules, GameMechanics, and PlayerCount, to connect action inputs and outputs. section 12.3.2 section 12.3.3

Board-game information workflow

Load a game’s rules, then derive its mechanics and supported player counts. Prompt templates supply the LLM instructions, while typed action results provide the workflow’s intermediate data. section 12.3.2 section 12.3.3

Listing 12.7 GameInfoAgent: An Embabel agent for answering questions about board games
package com.example.embabelgamesagent;

import com.embabel.agent.api.annotation.AchievesGoal;
import com.embabel.agent.api.annotation.Action;
import com.embabel.agent.api.annotation.Agent;
import com.embabel.agent.api.common.PromptRunner;
import com.embabel.agent.domain.io.UserInput;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.reader.tika.TikaDocumentReader;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.stringtemplate.v4.ST;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Map;

@Agent(
    name = "GameInfoAgent",
    description = "An agent that helps users answer questions " +
        "about board games, including mechanics and player counts.",
    version = "1.0.0")   #1
public class GameInfoAgent {

  private static final Logger LOGGER =
      LoggerFactory.getLogger(GameInfoAgent.class);

  private final String rulesFilePath;

  public GameInfoAgent(
      @Value("${boardgame.rules.path}") String rulesFilePath) {
    this.rulesFilePath = rulesFilePath;   #2
  }

  // ...action methods go here...

}

Inspect the complete GameInfoAgent implementation, including annotations, prompt-resource loading, helper methods, and typed action results. section 12.3.2

How Spring AI in Action covers it

How deep it goes
Derives workflows from typed action dependencies and goal annotations, stopping short of describing the framework’s internal planning algorithm.
Examples
Uses board-game rules, mechanics, player counts, Java records, TikaDocumentReader, and prompt templates.
What you can do after
Build it from scratch by composing typed Embabel actions that load inputs and achieve analysis goals.
How it connects
Connects action methods, type safety, goal-oriented agents, prompt templates, and LLM object creation.

Also explained in

Compare how 48 books explain pipeline →

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.