AWS Builder Center
Embabel: AI Agents with Domain-Integrated Context Engineering

Embabel: AI Agents with Domain-Integrated Context Engineering

Embabel is a JVM-based agent framework created by Rod Johnson (creator of Spring Framework) that enables developers to build agentic flows combining LLM interactions with code, domain models, and tools. Built on Spring AI, it emphasizes strong typing and object orientation, ensuring compile-time checking and refactoring support while allowing agents to replan after each action in an OODA loop pattern.

Embabel is a sophisticated framework designed for building autonomous, domain-aware AI agents. It focuses on  Domain-Integrated Context Engineering  (DICE), enabling agents to leverage specific, curated knowledge bases (like local documents, databases, and APIs) and operational capabilities to perform complex tasks reliably and accurately. By isolating the agent's reasoning from its specific knowledge sources, Embabel allows for the creation of versatile, adaptable agents that excel in targeted domains. Embabel builds on Spring AI and has great support for Amazon Bedrock AI models.  Check out an intro to Embabel that Josh Long and I did recently:

To really show off the power of Embabel and the DICE approach, we need something beyond “hello, world” with some actual domain objects.  At Devoxx Belgium 2025,  Rod Johnson ,  John Davies , and I led an Embabel hands-on workshop (repeated at AI by the Bay 2025 with  Josh Long ) where we created an AI agent for meeting preparation.  This example illustrates the DICE concept and how Embabel orchestrates the internal state management and AI interactions using domain objects like  Contact ,  IndustryAnalysis , etc. Let’s walk through the important parts of that example. ( Complete “prepper” code example )
First let’s start with the domain objects. The  Meeting  object is where the agent starts based on input from the user to define the title, objective, and participants:
public record Meeting(String context, String objective,
@JsonPropertyDescription("A list of participant email addresses or however else we identify them, e.g. 'Roger Daltrey The Who' or 'roger@who.com'") List<String> participants)
implements
PromptContributor {
@NonNull
@Override
public String contribution() {
return "Meeting:\nContext: %s\nObjective: %s\n".formatted(context, objective);
}
}
The  Meeting  (and other domain objects you’ll see) implement  PromptContributor  and a  contribution  method which will be used by Embabel to get a string that will be used in a LLM prompt. This approach keeps prompt contribution logic local to the domain model making it easier to maintain and reuse.
Our next domain object is a  Contact  which is persisted in a database so that we don’t have to look up the same meeting participant multiple times.
@Table("contact")
public record Contact(@Id Long id, @Column("name") String name, @Column("email") String email,
@Column("writeup") String writeup, @CreatedDate @Column("created_at") LocalDateTime createdAt,
@LastModifiedDate @Column("updated_at") LocalDateTime updatedAt) implements PromptContributor {

public Contact(NewContact newContact) {
this(null, newContact.name(), newContact.email(), newContact.writeup(), null, null);
}

@NotNull
@Override
public String contribution() {
return "- %s: %s".formatted(email, writeup);
}

@NotNull
@Override
public String toString() {
return "Contact{id=%d, name='%s', email='%s', writeup:\n%s}".formatted(id, name, email, writeup);
}
}
The  Contact  domain object has some typical fields but also a  writeup  which will hold information the AI assembles about the person. Some additional fields like  createdAt  provide database generated metadata for reporting / auditing.
The  Participants  domain object holds all those in the meeting and has its own prompt contribution, which is just an aggregation of the prompt contributions from each  Contact .
public record Participants(List<Contact> participants) implements PromptContributor {

@NotNull
@Override
public String contribution() {
return "Participants:\n" + participants.stream()
.map(Contact::contribution)
.collect(java.util.stream.Collectors.joining("\n"));
}
}
The  IndustryAnalysis  domain object just holds a string but could be enriched with more domain-oriented information like market size, trending topics, etc.
public record IndustryAnalysis(String analysis) { }
The  MeetingStrategy  domain object uses a  JsonPropertyDescription  on the  strategy  property. This is used by Embabel to guide (with a prompt addition) when the AI is used to create the strategy.
public record MeetingStrategy(
@JsonPropertyDescription("Complete report with a list of key talking points and strategic questions to ask, to help achieve the meeting's objective") String strategy) { }
The final domain object,  Briefing , is just an aggregation of the other domain objects.
public record Briefing(Meeting meeting, Participants participants, IndustryAnalysis industryAnalysis,
MeetingStrategy meetingStrategy, String briefing) {
}
That’s all for the domain objects that will be used by the agent.  We will have four “actions” that the agent will orchestrate to achieve the requested goal (in our case “Produce a briefing”). These are: Research Specialist, Industry Analyst, Meeting Strategy Advisor, and Briefing Coordinator.  With agents it is often nice to have their prompts and configuration externalized.  For each of the actions there is a set of properties which define the LLM type to use (e.g. lite, best/pro), the tools, a role, goal, and backstory.
The Research Specialist has these properties:
prepper.researcher.llm.role=best
prepper.researcher.tool-groups=web
prepper.researcher.persona.role=Research Specialist
prepper.researcher.persona.goal=Conduct thorough research on people and companies involved in the meeting. Use web tools to perform your research
prepper.researcher.persona.backstory=As a Research Specialist, your mission is to uncover detailed information about the individuals and entities participating in the meeting. Your insights will lay the groundwork for strategic meeting preparation.

The “web” tool group will use a Brave MCP server to provide web search results. To connect to that MCP server, we can use a property like:
spring.ai.mcp.client.streamable-http.connections.brave-search-mcp.url=${BRAVE_SEARCH_MCP_URL:http://localhost:8080/}
Not all actions benefit from tools so there aren’t any defined for Meeting Strategy Advisor and Briefing Coordinator.
The AI models to use by each action were set as  best  and  balanced  and those are defined with configuration, in this case using different Amazon Nova models on Bedrock:
embabel.models.llms.best=us.amazon.nova-pro-v1:0
embabel.models.llms.balanced=us.amazon.nova-lite-v1:0
Now that we have the domain model and the configuration, we can define the agent itself. The  PrepperAgent  has dependencies on the config and a  ContactService  (used for storing and searching contacts).
@Agent(description = "A meeting prepper agent that helps users prepare for meetings ")
class PrepperAgent {

private final PrepperConfig config;

private final ContactService contactService;

private final static Logger logger = LoggerFactory.getLogger(PrepperAgent.class);

PrepperAgent(PrepperConfig config, ContactService contactService) {
this.config = config;
this.contactService = contactService;
logger.info("Initialized PrepperAgent with config: {}", config);
}
}
Each agent is tasked with achieving a defined goal. In our case the goal is the meeting briefing and it depends on the  Meeting ,  Participants ,  IndustryAnalysis , and  MeetingStrategy  domain objects. This is expressed as inputs to a method. Embabel also provides an  Ai  parameter which is used to interact with the AI model.
@Action
@AchievesGoal(description = "Produce a briefing for the meeting")
Domain.Briefing produceBriefing(Domain.Meeting meeting, Domain.Participants participants,
Domain.IndustryAnalysis industryAnalysis, Domain.MeetingStrategy meetingStrategy, Ai ai) {
var briefing = config.briefingWriter()
.promptRunner(ai)
.withPromptContributors(List.of(participants, meeting))
.generateText(meetingStrategy.strategy());
return new Domain.Briefing(meeting, participants, industryAnalysis, meetingStrategy, briefing);
}
The body of this method takes the parameters (which will be resolved / created by other actions) and provides them to the AI model (defined in the configuration), resulting in a  Briefing  object.
Embabel needs other actions to assemble a path to the goal. The domain objects are used to chart that path using something called “Goal-Oriented Action Planning” (GOAP).  There are three other actions for each of the domain objects needed by the  produceBriefing  action.
First the user input domain object ( Meeting ) is referenced and the action does a parallel retrieval of participants, using the AI model and web tools if the participant is not already in the database.
@Action
Domain.Participants researchParticipants(Domain.Meeting meeting, OperationContext embabel) {
var researcher = config.researcher().promptRunner(embabel).creating(Domain.NewContact.class);
var contacts = embabel.parallelMap(meeting.participants(), config.maxConcurrency(),
participant -> contactService.resolveContact(participant).orElseGet(() -> {
var newContact = researcher.fromPrompt(participant);
return contactService.createContact(newContact);
}));
return new Domain.Participants(contacts);
}
To get the  IndustryAnalysis  there is a basic action which takes the meeting information and the participants and uses the AI model to generate the analysis.
@Action
Domain.IndustryAnalysis analyzeIndustry(Domain.Meeting meeting, Domain.Participants participants, Ai ai) {
return config.industryAnalyzer()
.promptRunner(ai)
.withPromptContributors(List.of(participants, meeting))
.createObject("", Domain.IndustryAnalysis.class);
}
And finally, the  MeetingStrategy  action takes the meeting information, participants, and industry analysis to generate the strategy:
@Action
Domain.MeetingStrategy formulateMeetingStrategy(Domain.Meeting meeting, Domain.Participants participants,
Domain.IndustryAnalysis industryAnalysis, Ai ai) {
return config.meetingStrategist()
.promptRunner(ai)
.withPromptContributors(List.of(participants, meeting))
.createObject(industryAnalysis.analysis(), Domain.MeetingStrategy.class);
}
We now have a domain-oriented path from the user input,  Meeting , to the  Briefing .  Actions can be reused across multiple Agents but in this case we only use them for the  PrepperAgent .
This example includes a text-based shell that asks the user for the meeting information and participants and then invokes Embabel:
var meeting = new Domain.Meeting(context, objective, participants);
var briefing = AgentInvocation.builder(agentPlatform)
.build(Domain.Briefing.class)
.invoke(meeting);
There is also a way to match a user prompt to a defined goal ( see Autonomy in the Embabel docs ).
This example application also uses vector search to match user specified participants with those in the database. This uses an AI embedding model and in a future blog I will go into more detail on that aspect.
When we run this agent the input and output look like this (with some logging and intermediary outputs omitted):
Embabel Meeting Preparation Assistant
============================
1. Enter meeting context/title: Spring AI
2. Enter meeting objective: Learn
3. Enter participants (one per line, type 'done' to finish):
   Examples: Fred Flintstone, bill@bigcompany.com, John Smith CEO Acme Corp
Josh Long, Spring Developer Advocate
   Added: Josh Long, Spring Developer Advocate
done
=== MEETING SUMMARY ===
Context: Spring AI
Objective: Learn
Participants:
  1. Josh Long, Spring Developer Advocate
=======================
Generating briefing...
### Briefing Document: Spring AI Learning Session
**Date:** 2025-12-16  
**Coordinator:** Briefing Coordinator  
**Participants:** Josh Long 
---
#### **Meeting Context: Spring AI**  
**Objective:** Learn
---
### Key Talking Points
#### 1. **Overview of Spring AI**
   - **Current State:** Discuss the latest developments in Spring AI, including its capabilities and features.
   - **Future Direction:** Explore the planned enhancements and new features for Spring AI.
   - **Integration with Business Workflows:** Highlight how Spring AI can be integrated into existing business processes.
   - **Generative AI Capabilities:** Examine the generative AI features within Spring AI and their applications.
#### 2. **Integration Challenges**
   - **Data Management:** Address the complexities of managing data when integrating AI into enterprise systems.
   - **Learning Curve:** Discuss the challenges developers face when learning new AI frameworks and how Spring AI aims to mitigate this.
#### 3. **Opportunities for Improvement**
   - **Efficiency:** Explore how AI can enhance operational efficiency within enterprises.
   - **Innovation:** Discuss the potential for AI to drive innovation in product development and service delivery.
   - **Business Strategy:** Examine how AI can be leveraged to refine business strategies and gain competitive advantages.
   - **Simplified Integration Frameworks:** Highlight the benefits of using simplified frameworks for AI integration.
#### 4. **Ethical and Secure AI**
   - **Data Privacy:** Discuss the importance of data privacy in AI applications and the measures Spring AI takes to protect user data.
   - **Ethical AI Use:** Explore the guidelines and best practices for ensuring the ethical use of AI within Spring AI applications.
#### 5. **Speculative Bubble Risk**
   - **Acknowledgment:** Recognize the potential risk of a speculative bubble in AI investments.
   - **Mitigation Strategies:** Discuss strategies to mitigate the risks associated with over-investment in AI technologies.
---
### Strategic Questions
1. **Optimization of Spring AI Frameworks**
   - How can Spring AI frameworks be further optimized to simplify AI integration for developers?
2. **Best Practices for Data Privacy and Ethical AI Use**
   - What are the best practices for ensuring data privacy and ethical AI use within Spring AI applications?
3. **Managing AI Integration with Existing Systems**
   - How can businesses effectively manage the integration of AI with their existing systems?
4. **Emerging Trends in Generative AI**
   - What are the emerging trends in generative AI that Spring AI can leverage to stay ahead of the curve?
5. **Addressing the AI Speculative Bubble**
   - How can Spring AI contribute to addressing the challenges of a potential AI speculative bubble?
### Conclusion
This briefing document outlines the key talking points and strategic questions to guide the discussion on Spring AI. By addressing these areas, the meeting aims to achieve a comprehensive understanding of Spring AI and its implications for the industry.
Overall it did a great job with each action resulting in a pretty solid briefing document! Check out the full code example:  https://github.com/jamesward/prepper 
Let me know what you think about Embabel and this unique, domain-oriented way of orchestrating agents.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article