Building AI Agents with Groovy® and Spring AI Agent

Author:  Paul King
PMC Member

Published: 2026-12-04 10:00PM


Introduction

Spring AI Agent is a new library for building AI agents as typed graphs, with support for Java and Kotlin. Groovy integrates natively with Java but also has excellent DSL capabilities. So, let’s first use the Java API as is, then sketch what a Groovy DSL could look like to make the experience a little more friendly to ML engineers who use Python. Finally, we’ll get two agents on different stacks to talk to each other.

An agent graph with start, draft, review, soften and end nodes, next to the Groovy DSL code that wires it with the right-shift operator

The Spring team recently announced Spring AI Agent, a set of modules on top of Spring AI 2.1 for building agents. The project is incubating in the spring-projects-experimental organisation, with the intention of merging it into Spring AI 3.0. JetBrains is a partner in the effort, and their accompanying post describes the Kotlin extensions and DSL that come with it.

An agent in this library is an Agent<I, O>: something with a typed input and a typed output. The most flexible kind is the graph agent, where typed nodes are joined by edges, and where an edge can carry a condition, a transformation, or both. Around that core are tool calling, structured output, subagents, checkpoints for long-running work, pauses for human approval, and support for the Agent2Agent (A2A) protocol.

We’ll look at:

  • using the Java API directly from Groovy

  • a small prototype Groovy DSL for wiring graphs

  • a local model, via Ollama, calling Groovy tools and returning a record

  • swapping in a hosted model from llmao, the ASF LLM gateway

  • following a run’s events as they stream, and asking several models at once with async/await

  • pausing a run for human approval and resuming it from a checkpoint

  • calling an Apache Camel route as a remote agent over A2A

Spring AI Agent is at version 0.8.0 and its API can be expected to change before it settles. The same goes, more so, for the DSL in this post. It is a sketch of what Groovy makes possible, covering just what the examples need. The Kotlin DSL that ships with the project is the supported one and will have had far more thought put into its corner cases.

All the code is in the groovy-spring-ai-agent repo. We used Groovy 6.0.1, Spring AI Agent 0.8.0, Spring AI 2.1.0 and JDK 17. Following earlier posts, our examples are about Scotch whisky.

The Java API from Groovy

We need one dependency for the agent library and, while we are getting started, a second one with a test double for the chat model:

implementation 'org.springframework.experimental.ai:spring-ai-agent:0.8.0'
implementation 'org.springframework.experimental.ai:spring-ai-agent-test:0.8.0'

No Spring Boot application is needed. The builders can be called from a plain script.

Our first agent answers questions about whisky and has one tool that it can call. A tool is a method with a @Tool annotation:

class DistilleryTools {
    @Tool(description = 'Returns the region of a Scotch whisky distillery')
    String region(String distillery) {
        [Laphroaig: 'Islay', Macallan: 'Speyside'].get(distillery, 'unknown')
    }
}

So that the example runs anywhere and gives the same answer each time, we’ll use the library’s ScriptedChatModel. It plays back the replies we give it: here a request to call our tool, then a final answer.

def chatModel = new ScriptedChatModel()
    .replyWithToolCall('region', '{"distillery": "Laphroaig"}')
    .reply('Laphroaig is an Islay distillery.')

Now the agent itself. The graph has a single node between its start and end, the built-in ToolCallLoop, which sends the input to the model, runs any tools the model asks for, and repeats until the model gives an answer:

def graph = Graph.builder().inputType(String).outputType(String).build { g ->
    def loop = AgentNodes.subgraph('toolCallLoop', ToolCallLoop.create())
    g.edge(g.start, loop)
    g.edge(loop, g.end)
}

def agent = ModelGraphAgent.builder(graph, chatModel)
    .name('whisky')
    .instructions('You answer questions about Scotch whisky.')
    .tools(new DistilleryTools())
    .build()

def result = agent.result('Where is Laphroaig made?')
println result.messages()*.messageType
println result.output()

This is the Java API unchanged. Groovy closures stand in for the Java lambdas, and the output shows the conversation the agent had on our behalf:

[USER, ASSISTANT, TOOL, ASSISTANT]
Laphroaig is an Islay distillery.

The same code works as a single-file script if we swap the build file for two @Grab lines:

@Grab('org.springframework.experimental.ai:spring-ai-agent:0.8.0')
@Grab('org.springframework.experimental.ai:spring-ai-agent-test:0.8.0')
import org.springframework.ai.agent.graph.ModelGraphAgent
// ...

There is one thing to get right. Spring AI matches the arguments of a tool call to the method’s parameters by name, and Groovy, like Java, only keeps parameter names in the bytecode when asked. Without them the tool above is called with null and answers unknown, with no error to say why. For a script, run it with groovy --parameters hello.groovy. For Gradle, add:

tasks.withType(GroovyCompile).configureEach {
    groovyOptions.parameters = true
}

Sketching a Groovy DSL

The builder code above is fine, but graphs with more nodes and edges get harder to read, which is why the project provides a Kotlin DSL. The Kotlin DSL is a layer over the same Java builders, so we can try the same idea in Groovy. Here is our first agent again:

def agent = modelGraphAgent(chatModel) {
    name 'whisky'
    instructions 'You answer questions about Scotch whisky.'
    tools new DistilleryTools()

    start >> toolCallLoop() >> end
}

The configuration methods are called on a delegate object, a common pattern for Groovy builders. The edges use the right-shift operator, which Groovy lets us define for any class. Readers who have written Apache Airflow pipelines in Python will recognise the notation.

The operator is an extension method on the library’s Node class. It adds an edge to the graph being built and returns its right-hand side, so that edges chain:

static <S, T, R> Node<T, R> rightShift(Node<S, T> self, Node<T, R> next) {
    current().edge(self, next)
    next
}

The signature says that the output type of the node on the left must be the input type of the node on the right. We’ll come back to that shortly.

Packaging the extension methods as an extension module makes them available to both dynamic and statically compiled Groovy code. The whole DSL is about 300 lines.

Conditions and transformations

For a more interesting graph, suppose we want one-line tasting notes but don’t want them to oversell. The agent will draft a note, review it, and send it back to the model only if it needs toning down. This is the graph in the picture at the top of this post.

record Review(boolean clean, String text) {}

@CompileStatic
class Guardrail {
    static Agent<String, String> build(ChatModel chatModel) {
        modelGraphAgent(chatModel) {
            instructions 'You write one-line tasting notes.'

            def draft = toolCallLoop('draft')
            def review = node('review', String, Review) { text ->
                new Review(!text.toLowerCase().contains('best'), text)
            }
            def soften = node('soften', Review, String) { flagged, ctx ->
                ctx.call(new UserMessage('Rewrite that without superlatives.')).text
            }

            start >> draft >> review
            review.when { it.clean() }.via { it.text() } >> end
            review >> soften >> end
        }
    }
}

A node is given a name, its input and output types, and a closure for its body. The closure receives the node’s input and, if it declares a second parameter, a context that it can use to call the model. The review node is ordinary code and needs no model at all. Nodes like this are a large part of the appeal of the graph style: the model is used where judgement is needed, and plain code is used everywhere else.

There are two more pieces of wiring vocabulary. A when makes an edge conditional on the output of its source node. A via converts that output on its way to the next node, here from a Review to the String that the end node expects. An unconditional edge declared after a conditional one acts as the fallback.

Running it with a scripted model that first oversells and then behaves:

def model = new ScriptedChatModel()
    .reply('The best whisky ever made.')
    .reply('Peaty and medicinal, with a long finish.')
def softened = build(model).result('Describe Laphroaig 10')
softened.messages().each { println "${it.messageType}: ${it.text}" }
USER: Describe Laphroaig 10
ASSISTANT: The best whisky ever made.
USER: Rewrite that without superlatives.
ASSISTANT: Peaty and medicinal, with a long finish.

Checking the wiring

The class above is annotated with @CompileStatic, and that is where the generic signature of the >> operator pays off. If we wire the review node, which produces a Review, straight to the end node, which expects a String:

start >> review >> end

the compiler rejects it:

[Static type checking] - Cannot call <S,T,R> agentdsl.WiringExtensions#rightShift(Node<S, T>, Node<T, R>)
with arguments [Node<String, Review>, Node<String, String>]

The types of it in the when and via closures are also inferred, using Groovy’s groovy.transform.stc.ClosureParams annotation on the extension methods.

It is worth knowing that this check is the compiler’s alone. In dynamic Groovy the mis-wired graph builds and runs, and an agent declared as returning a String hands back a Review. Dynamic Groovy is still a good fit for scripts and exploration, but for agents of any size, @CompileStatic (or @TypeChecked) is the way to get the "typed graph" part of the library’s promise.

A real model, with tools and a typed answer

Time for a real model. We’ll use one running locally under Ollama, which needs the spring-ai-ollama dependency and no API key:

static ChatModel ollama() {
    var model = System.getProperty('model', 'qwen3:8b')
    println "Using $model via Ollama"
    OllamaChatModel.builder()
        .ollamaApi(OllamaApi.builder().build())
        .options(OllamaChatOptions.builder().model(model).temperature(0d).build())
        .build()
}

Our agent recommends a whisky from a small cellar. The cellar is exposed as two tools, and the answer should come back as a record instead of free text:

record Recommendation(String distillery, String region, String reason) {}

class Cellar {
    static final PROFILES = [
        Laphroaig   : [region: 'Islay', smoky: 4, sweetness: 2, fruity: 1],
        Ardbeg      : [region: 'Islay', smoky: 4, sweetness: 1, fruity: 1],
        Macallan    : [region: 'Speyside', smoky: 1, sweetness: 3, fruity: 3],
        Glenfiddich : [region: 'Speyside', smoky: 0, sweetness: 3, fruity: 3],
        Auchentoshan: [region: 'Lowlands', smoky: 0, sweetness: 2, fruity: 2],
        HighlandPark: [region: 'Islands', smoky: 2, sweetness: 2, fruity: 2],
    ]

    @Tool(description = 'Lists the distilleries in the cellar')
    List<String> distilleries() {
        println '  [tool] distilleries()'
        PROFILES.keySet().toList()
    }

    @Tool(description = 'Returns the region and the smoky, sweetness and fruity scores (0 to 4) of a distillery')
    Map profile(String distillery) {
        println "  [tool] profile($distillery)"
        PROFILES[distillery] ?: [error: "no such distillery: $distillery"]
    }
}

The agent now has input and output types, and its tool call loop is asked for a Recommendation:

static Agent<String, Recommendation> advisor(ChatModel chatModel) {
    modelGraphAgent(chatModel, String, Recommendation) {
        name 'whisky-advisor'
        instructions '''You recommend one whisky from the cellar. Always look up the cellar
            with the tools before answering; never rely on your own knowledge of whisky.'''
        tools new Cellar()
        listener servedModel()

        start >> toolCallLoop(Recommendation) >> end
    }
}

The listener line is there because the model asked for isn’t always the model that answers: a gateway can route a request elsewhere. Agents publish events as they run, and a listener for model events can read the served model from each response. This one reports each model once:

static AgentListener<ModelEvent> servedModel() {
    Set<String> seen = []
    AgentListener.of(ModelEvent) { event ->
        if (event instanceof ModelCallCompletedEvent) {
            var model = event.response().metadata.model
            if (seen.add(model)) println "Served by $model"
        }
    }
}

Let’s ask it something:

def advisor = WhiskyAgents.advisor(WhiskyAgents.ollama())

def result = advisor.result('I like fruity whisky with no smoke at all. What should I try?')
println result.output()
println "tokens: ${result.usage().totalTokens}"

The model lists the cellar, looks at the candidates it likes the sound of, and answers with a record. As with any model, the details vary from run to run. This is a typical one:

Using qwen3:8b via Ollama
  [tool] distilleries()
Served by qwen3:8b
  [tool] profile(Macallan)
  [tool] profile(Auchentoshan)
  [tool] profile(Glenfiddich)
Recommendation[distillery=Glenfiddich, region=Speyside, reason=High fruity score (3) with no smoke (0), offering a balanced and smooth flavor profile]
tokens: 5289

A hosted model from the ASF gateway

Nothing in the agent mentions Ollama. It takes a ChatModel, so a hosted model is a different factory method. llmao is the ASF LLM gateway at llm.apache.org, giving Apache committers access to Foundation-sanctioned models. It speaks the OpenAI protocol, so we add the spring-ai-openai dependency and point it at a different base URL:

static ChatModel llmao() {
    var env = System.getenv()
    var model = env.LLMAO_MODEL ?: 'qwen3.8-27b'
    println "Using $model via llmao"
    // Qwen3 reasons by default, which can use up the output budget and return an empty answer
    openAiCompatible('https://llm.apache.org/v1', env.LLMAO_API_KEY, model,
        [chat_template_kwargs: [enable_thinking: false]])
}

static ChatModel openAiCompatible(String baseUrl, String apiKey, String model, Map<String, Object> extraBody = [:]) {
    OpenAiChatModel.builder()
        .options(OpenAiChatOptions.builder()
            .baseUrl(baseUrl).apiKey(apiKey).model(model).temperature(0d).extraBody(extraBody).build())
        .build()
}

The examples pick llmao when a key is present and fall back to the local model otherwise:

static ChatModel chatModel() {
    System.getenv('LLMAO_API_KEY') ? llmao() : ollama()
}

We’ll see a run using llmao when we combine agents later on.

The same openAiCompatible method reaches any other service with an OpenAI-compatible API, including Ollama’s own endpoint at http://localhost:11434/v1.

Following a run, and running several at once

So far we’ve called result, which blocks until the agent has finished. Its sibling run returns straight away with an AgentRun, whose events() let us follow the run while it happens. The events arrive on a Source, a type from the Spring team’s new stream-source library. There are no callbacks and no reactive operators: we read it with a loop, and each receiveNext() call blocks until there is something to read.

Here is an agent that writes a tasting note, with a loop that prints the tool calls as they start and the answer as the model produces it:

def agent = modelGraphAgent(WhiskyAgents.chatModel()) {
    instructions '''You write a two-sentence tasting note for a whisky from the cellar.
        Look up its profile with the tools first.'''
    tools new Cellar()

    start >> toolCallLoop() >> end
}

try (def run = agent.run('Write a tasting note for Highland Park.')) {
    def events = run.events()
    def thinking = 0
    while (events.receiveNext()) {
        def event = events.next()
        switch (event) {
            case ToolCallStartedEvent -> println "[calling ${event.name()} ${event.arguments()}]"
            case ModelFrameEvent -> {
                def frame = event.frame()
                if (frame instanceof ReasoningDelta) thinking++
                else if (frame instanceof TextDelta) {
                    if (thinking) println "[$thinking reasoning frames]"
                    thinking = 0
                    print frame.text()
                    System.out.flush()
                }
            }
            default -> {}
        }
    }
    println()
}

Java’s version of this loop uses a record pattern. In Groovy, a switch on the event’s class does the job. The local model reasons before it answers, and that arrives as frames too, which we just count:

Using qwen3:8b via Ollama
  [tool] profile(Highland Park)
[calling profile {"distillery":"Highland Park"}]
[calling distilleries {}]
  [tool] distilleries()
[calling profile {"distillery":"HighlandPark"}]
  [tool] profile(HighlandPark)
[886 reasoning frames]
The HighlandPark whisky offers a balanced profile with moderate smoky, sweet, and fruity notes, reflecting its Islands region origin. Its gentle peat character intertwines with subtle caramel sweetness and a hint of dried fruit, creating a harmonious yet understated dram.

The model guessed at the name, was told there was no such distillery, listed the cellar and tried again. The last paragraph appeared a few words at a time. The events are an observation channel, read on a different thread from the one doing the work, which is why the tool’s own println and our [calling …​] line can come out in either order.

Blocking calls like these are cheap on virtual threads, and stream-source uses them when they are available, falling back to platform threads otherwise. Groovy’s async and await work the same way, so the two sit together with no adapter code. Each async block below starts straight away, and inside it we make the ordinary blocking result call:

def question = 'I like fruity whisky with no smoke at all. What should I try?'
def advisors = WhiskyAgents.chatModels().collectEntries { name, model -> [name, WhiskyAgents.advisor(model)] }

def (answers, nanos) = System.timed {
    def tasks = advisors.collect { name, advisor ->
        async { [name, advisor.result(question).output()] }
    }
    await Awaitable.all(*tasks)
}

answers.each { name, recommendation -> println "$name: $recommendation" }
println "${advisors.size()} model(s) asked in parallel: ${nanos.intdiv(1_000_000)} ms"

chatModels() returns the local model, plus llmao when a key is set, so each model gets its own advisor.

With both available, the two runs interleave:

Using qwen3:8b via Ollama
Using gemma4-26b via llmao
  [tool] distilleries()
Served by gemma4-26b
  [tool] profile(Laphroaig)
  [tool] profile(Ardbeg)
  [tool] profile(Macallan)
  [tool] profile(Glenfiddich)
  [tool] profile(Auchentoshan)
  [tool] profile(HighlandPark)
  [tool] distilleries()
Served by qwen3:8b
  [tool] profile(Macallan)
  [tool] profile(Auchentoshan)
  [tool] profile(Glenfiddich)
Ollama: Recommendation[distillery=Glenfiddich, region=Speyside, reason=High fruity score (3) with no smoke (0), offering a balanced and smooth flavor profile]
llmao: Recommendation[distillery=Glenfiddich, region=Speyside, reason=It has a high fruity score of 3 and a smoky score of 0, making it perfect for your preference.]
2 model(s) asked in parallel: 36502 ms

The hosted model had profiled the whole cellar before the local one finished its first call. The two took different routes to the same whisky, and the total is about what the slower local model takes when run alone.

Our examples run on Java 17, where both libraries use their platform-thread fallback. On Java 21 or later the same code runs on virtual threads.

Pausing for a human

Recommending a whisky is harmless. Ordering six bottles of it is something we might want a person to approve. Spring AI Agent has an interrupt node for this, and a CheckpointFeature that saves the state of a run so that the approval can arrive later, even after a restart.

record Order(String distillery, int bottles) {}

def store = new FileCheckpointStore(new File('build/checkpoints'))

def buildAgent = { chatModel ->
    modelGraphAgent(chatModel) {
        enable new CheckpointFeature(store)

        def draft = toolCallLoop(Order, 'draft')
        def approve = interrupt('approve', Order, Order) { "Place an order for $it.bottles x $it.distillery?" }
        def place = node('place', Order, String) { "Ordered $it.bottles x $it.distillery" }
        def cancel = node('cancel', Order, String) { 'Nothing ordered' }

        start >> draft >> approve
        approve.when { it.bottles() > 0 } >> place >> end
        approve >> cancel >> end
    }
}

The interrupt node’s closure produces what is shown to the human. The node’s output is whatever the human replies with. Here that is the order to place, which gives them the chance to amend it.

When a run reaches the interrupt, it stops with an InteractionRequiredException that carries the question and the id of the run:

def before = buildAgent(new ScriptedChatModel().reply('{"distillery": "Glenfiddich", "bottles": 6}'))
def paused = null
try {
    before.result('Order me half a case of something fruity')
} catch (InteractionRequiredException e) {
    paused = e
    println "Paused at $e.path: $e.payload"
}

To show that nothing but the checkpoint is needed to carry on, we resume with a second agent instance and a model that has no replies scripted. Our human has decided that two bottles is plenty:

def after = buildAgent(new ScriptedChatModel())
def result = after.resumeResult(paused.runId, new Order('Glenfiddich', 2))
println result.output()
Paused at approve: Place an order for 6 x Glenfiddich?
Ordered 2 x Glenfiddich

Agents on different stacks with A2A

Camel logo The Agent2Agent (A2A) protocol, now hosted by the Linux Foundation, lets agents built with different frameworks call each other. An agent publishes an agent card describing itself, and accepts messages over JSON-RPC, REST or gRPC. Spring AI Agent has client and server modules for A2A. So does Apache Camel, whose A2A component, in preview since Camel 4.21, turns a route into an agent or calls a remote one.

An agent doesn’t have to involve a model. Suppose the stock levels of our cellar are looked after by a separate integration service. With Camel, in Groovy, that service can be exposed as an agent with a single route:

class CellarAgent extends RouteBuilder {
    static final STOCK = [Laphroaig: 3, Ardbeg: 0, Macallan: 1, Glenfiddich: 12, Auchentoshan: 5]

    void configure() {
        from('a2a:cellar-stock?description=Reports how many bottles of a distillery are in the cellar&protocolBinding=JSONRPC&validateAuth=false&agentCard=#cellarCard')
            .process { exchange ->
                def question = exchange.message.getBody(String)
                def name = STOCK.keySet().find { question.toLowerCase().contains(it.toLowerCase()) }
                exchange.message.body = name ? "${STOCK[name]} bottles of $name in stock" : 'No such distillery in the cellar'
            }
    }
}

In a real system the processor would be replaced by any of Camel’s several hundred connectors: a database query, a call to an ERP system, a message on a queue.

On the Spring AI Agent side, a remote agent is just another Agent. Our DSL has a small helper, remoteAgent, which fetches the agent card and wraps the result as a text-in, text-out agent:

def stock = remoteAgent('http://localhost:8085')
println "Found agent '$stock.name': $stock.description"
println stock.result('How much Glenfiddich do we have?').output()
Found agent 'cellar-stock': Reports how many bottles of a distillery are in the cellar
12 bottles of Glenfiddich in stock

Because both are agents, they compose. This graph agent has no model of its own. It asks the advisor from earlier for a recommendation, passes the distillery name to the Camel agent, and returns the stock level:

def advisor = WhiskyAgents.advisor(WhiskyAgents.chatModel())
def stock = remoteAgent('http://localhost:8085')

def sommelier = graphAgent(String, String) {
    def recommend = subAgent('recommend', advisor)
    def check = subAgent('check-stock', stock)

    start >> recommend
    recommend.via { it.distillery() } >> check >> end
}

println sommelier.result('I like fruity whisky with no smoke at all. What should I try?').output()
Using qwen3:8b via Ollama
  [tool] distilleries()
Served by qwen3:8b
  [tool] profile(Macallan)
  [tool] profile(Auchentoshan)
  [tool] profile(Glenfiddich)
12 bottles of Glenfiddich in stock

Setting LLMAO_API_KEY, and LLMAO_MODEL to pick one of the gateway’s other models, runs the same code against llmao. This model looks at the whole cellar before deciding, and arrives at the same answer:

Using gemma4-26b via llmao
Served by gemma4-26b
  [tool] distilleries()
  [tool] profile(Laphroaig)
  [tool] profile(Ardbeg)
  [tool] profile(Macallan)
  [tool] profile(Glenfiddich)
  [tool] profile(Auchentoshan)
  [tool] profile(HighlandPark)
12 bottles of Glenfiddich in stock

One process runs a model through Spring AI. The other is a Camel route. Both are written in Groovy, and the only thing they share is the protocol.

Making the two ends meet

Both A2A implementations are young, and getting them talking took three small adjustments. They are worth recording, both for anyone trying the same thing and as a picture of where interoperability stands today.

  • Transport. The Spring AI Agent client module includes the JSON-RPC transport, while the Camel consumer defaults to the HTTP+JSON (REST) binding. Setting protocolBinding=JSONRPC on the Camel endpoint aligns them.

  • Agent card. The card that Camel generates from the endpoint options doesn’t list a server interface, and the A2A Java SDK used by the Spring client won’t build a client without one. The agentCard=#cellarCard option in the route above refers to a card we supply, which adds the interface:

    main.bind('cellarCard', AgentCard.builder()
        .setSupportedInterfaces([new SupportedInterface(
            url: 'http://localhost:8085',
            protocolBinding: 'JSONRPC',
            protocolVersion: '1.0')])
        .build())
  • Reply shape. Camel answers with a task whose reply is a message, with no artifacts. The default output conversion in Spring AI Agent expects a single artifact. The reply message is still recorded in the agent’s conversation, so the remoteAgent helper supplies an output converter which reads the text of the artifacts if there are any and otherwise falls back to that message.

Things to know

A few things to be aware of if you try this yourself:

  • Spring AI Agent 0.8.0 is an incubating release. Expect the API to move before it is merged into Spring AI.

  • Compile with parameter names, as described earlier, or tool arguments arrive as null.

  • The typed-graph checks come from the compiler. Use @CompileStatic or @TypeChecked to get them.

  • An interrupt node’s output is the value supplied on resume. Its input isn’t passed on, so anything the rest of the graph needs has to be in the reply.

  • The agent modules run on JDK 17. Camel 4.24 needs JDK 21, so the Camel agent in the repo is a separate subproject with its own toolchain.

  • The first @Grab of the library downloads a fair number of jars. Later runs use the local cache.

  • The DSL in this post is a prototype. It has no support yet for parallel nodes with selection policies or sessions, both of which the library offers through its Java and Kotlin APIs.

Conclusion

We have seen that Spring AI Agent’s Java API can be used from Groovy without any special support, in a build or in a single-file script. We have also seen that Groovy’s operator overloading, delegating closures and extension modules are enough to sketch a compact DSL over that API, with the wiring checked by the static compiler. Whether a DSL like this is worth developing further is an open question, and we’d welcome feedback on it.

The A2A example shows the part of the story that goes beyond any one framework: an agent built with Spring AI Agent and an Apache Camel route, each doing what it is good at, working together through an open protocol.