<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-ai-agents-using-java-and-embabel-h2o7hds9h" -->

---
title: Building AI Agents using Java and Embabel | daily.dev
description: A hands-on walkthrough demonstrates Embabel, a JVM-based AI agent framework built on Spring AI by Rod Johnson (creator of Spring Framework). It covers Spring...
canonical: https://daily.dev/posts/building-ai-agents-using-java-and-embabel-h2o7hds9h
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building AI Agents using Java and Embabel | daily.dev
og:description: A hands-on walkthrough demonstrates Embabel, a JVM-based AI agent framework built on Spring AI by Rod Johnson (creator of Spring Framework). It covers Spring...
og:url: https://daily.dev/posts/building-ai-agents-using-java-and-embabel-h2o7hds9h
og:image: https://api.daily.dev/og/posts/H2o7hDs9h.png
og:image:alt: Building AI Agents using Java and Embabel
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building AI Agents using Java and Embabel

**[SivaLabs \(YouTube\)](https://daily.dev/sources/sivalabs-youtube)** · 53 min read · 0 upvotes · 0 comments

## Summary

A hands-on walkthrough demonstrates Embabel, a JVM-based AI agent framework built on Spring AI by Rod Johnson (creator of Spring Framework). It covers Spring Shell basics, then builds a shell-based Embabel agent and a Spring Boot web application that integrates the agent platform. Key concepts covered include the @Agent, @Action, and @AchievesGoal annotations, configuring local models via Ollama and Docker, switching LLMs by role (e.g., cheaper vs. faster models), splitting a goal into multiple coordinated actions, and four different ways to programmatically invoke agents from a REST controller (via AgentPlatform, direct Ai injection, builder chain options, and manual agent selection with AgentProcess).

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=lqQ_NL4y5Qg>

## Questions this post answers

### What is Embabel and how does it relate to Spring AI?

Embabel is a JVM-based agent framework for building AI agents, built on top of Spring AI and created by Rod Johnson, the creator of Spring Framework. It uses Spring AI's auto-configuration to connect to LLM providers like OpenAI, Anthropic, Ollama, and Docker local models, and lets developers define agents with goals and actions that the framework automatically orchestrates.

_Developers evaluating Java-based AI agent tooling can follow ongoing Embabel coverage on daily.dev._

### How do I define an agent with multiple coordinated actions in Embabel using @Action and @AchievesGoal?

Annotate a class with @Agent, giving it a name and description so the platform can match user requests to it. Each method annotated with @Action performs a discrete step, such as fetching basic movie info or actor details, while one method carries @AchievesGoal to mark the final aggregation step. Embabel automatically figures out the order to invoke actions to satisfy the goal, without explicit orchestration code.

_Anyone designing multi-step agent workflows can track Embabel patterns and examples on daily.dev._

### How can I configure Embabel to use different LLMs for different actions, such as a cheaper local model versus GPT-5?

Define a map under embabel.models.roles pairing role names to model identifiers, for example mapping 'cheaper' to a local GPT-OSS model, 'faster' to Llama 3, and a performance role to GPT-5. Inside an action method, call withLlmByRole with the desired role name to select that model for that specific action, letting different actions in the same agent use different LLMs based on cost or speed needs.

_Developers balancing LLM cost and performance across agent actions can follow model-routing techniques on daily.dev._

## Similar posts on daily.dev

- [Embabel Agent Framework Reaches 1.0](https://daily.dev/posts/embabel-agent-framework-reaches-1-0-xgzn1xdnr) · InfoQ · 0 upvotes · 0 comments
- [Spring creator wants Java’s type system to tame agentic AI](https://daily.dev/posts/spring-creator-wants-java-s-type-system-to-tame-agentic-ai-h0kiylaqg) · The New Stack · 0 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#java](https://daily.dev/tags/java), [#spring-boot](https://daily.dev/tags/spring-boot), [#spring-ai](https://daily.dev/tags/spring-ai)

[View this post on daily.dev](https://daily.dev/posts/building-ai-agents-using-java-and-embabel-h2o7hds9h)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building AI Agents using Java and Embabel","url":"https://daily.dev/posts/building-ai-agents-using-java-and-embabel-h2o7hds9h","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-ai-agents-using-java-and-embabel-h2o7hds9h"},"datePublished":"2026-09-27T07:26:44.659Z","dateModified":"2026-09-27T07:53:38.822Z","description":"A hands-on walkthrough demonstrates Embabel, a JVM-based AI agent framework built on Spring AI by Rod Johnson (creator of Spring Framework). It covers Spring...","image":"https://i.ytimg.com/vi/lqQ_NL4y5Qg/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/lqQ_NL4y5Qg/sddefault.jpg","isAccessibleForFree":true,"articleSection":"SivaLabs (YouTube)","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"SivaLabs (YouTube)","logo":"https://media.daily.dev/image/upload/s--8ATVo4an--/f_auto,q_auto/v1790493987/logos/sivalabs-youtube?_a=BAMAMicg0","url":"https://daily.dev/sources/sivalabs-youtube"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/building-ai-agents-using-java-and-embabel-h2o7hds9h","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,java,spring-boot,spring-ai","timeRequired":"PT53M","video":{"@type":"VideoObject","name":"Building AI Agents using Java and Embabel","description":"A hands-on walkthrough demonstrates Embabel, a JVM-based AI agent framework built on Spring AI by Rod Johnson (creator of Spring Framework). It covers Spring...","thumbnailUrl":"https://i.ytimg.com/vi/lqQ_NL4y5Qg/sddefault.jpg","uploadDate":"2026-09-27T07:26:44.659Z","duration":"PT53M","url":"https://api.daily.dev/r/H2o7hDs9h","embedUrl":"https://www.youtube.com/embed/lqQ_NL4y5Qg"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"SivaLabs (YouTube)","item":"https://daily.dev/sources/sivalabs-youtube"},{"@type":"ListItem","position":3,"name":"Building AI Agents using Java and Embabel"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/building-ai-agents-using-java-and-embabel-h2o7hds9h#faq","mainEntity":[{"@type":"Question","name":"What is Embabel and how does it relate to Spring AI?","acceptedAnswer":{"@type":"Answer","text":"Embabel is a JVM-based agent framework for building AI agents, built on top of Spring AI and created by Rod Johnson, the creator of Spring Framework. It uses Spring AI's auto-configuration to connect to LLM providers like OpenAI, Anthropic, Ollama, and Docker local models, and lets developers define agents with goals and actions that the framework automatically orchestrates. Developers evaluating Java-based AI agent tooling can follow ongoing Embabel coverage on daily.dev."}},{"@type":"Question","name":"How do I define an agent with multiple coordinated actions in Embabel using @Action and @AchievesGoal?","acceptedAnswer":{"@type":"Answer","text":"Annotate a class with @Agent, giving it a name and description so the platform can match user requests to it. Each method annotated with @Action performs a discrete step, such as fetching basic movie info or actor details, while one method carries @AchievesGoal to mark the final aggregation step. Embabel automatically figures out the order to invoke actions to satisfy the goal, without explicit orchestration code. Anyone designing multi-step agent workflows can track Embabel patterns and examples on daily.dev."}},{"@type":"Question","name":"How can I configure Embabel to use different LLMs for different actions, such as a cheaper local model versus GPT-5?","acceptedAnswer":{"@type":"Answer","text":"Define a map under embabel.models.roles pairing role names to model identifiers, for example mapping 'cheaper' to a local GPT-OSS model, 'faster' to Llama 3, and a performance role to GPT-5. Inside an action method, call withLlmByRole with the desired role name to select that model for that specific action, letting different actions in the same agent use different LLMs based on cost or speed needs. Developers balancing LLM cost and performance across agent actions can follow model-routing techniques on daily.dev."}}]}
```

