Skip to content

Commit e2cf0bc

Browse files
committed
Add code module
1 parent 209db51 commit e2cf0bc

13 files changed

Lines changed: 2502 additions & 132 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ embabel-agent-api/src/main/resources/mcp/**
1010

1111
**/*.log
1212

13-
.claude
13+
.claude
14+
15+
lucene-index

data/docs/index.md

Lines changed: 2122 additions & 0 deletions
Large diffs are not rendered by default.

inputs/goto_cph_25.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
slideCount: 28
2+
presenterBio: >
3+
Rod Johnson, Embabel. Creator of Spring and Embabel
4+
5+
brief: >
6+
7+
Ideas for the flow:
8+
9+
Gen AI is amazing. show cool examples for personal use, personal assistant use case
10+
Show failure statistics, recent MIT gartner etc and with quotes
11+
Diagnose causes for this: Technology is nondeterministic, it's slow and expensive to run, things change all the time, best practice is emerging: ALSO it's not integrated with bsuiness, it's coming out of a diffferent team, Python frameworks aren't aligned with business, it's excessively vendor driven, vendors selling miraclesy
12+
13+
How do we fix this? Firstly we attack the nondeterminism and make agents as predictable as possible. Second we seek ways to integrate with what already works and not imagine we can reinvent the world
14+
15+
What is the role of Java developers?
16+
17+
We could imitate the Python world and copy their approaches. That approach is doomed to failure and if that's the best we can do (a) I'm very worried about the future and (b) go learn Python (you should know it anyway).
18+
19+
Or we could do more than play catchup. We could bring our assets to a far superior approach
20+
21+
The future of Gen AI for business is substantially on the JVM.
22+
23+
Embabel is a framework that attacks every one of these challenges
24+
- Unique innovative planning element that is smart but deterministic. Actions/Goals allow an extensible system better than FSM of LangGraph or Crew AI but will always do the same thing
25+
- Emphasis on strong typing and tooling
26+
- Brings structure to LLM interactions vs just text (consider Embabel vs Python Crew AI examples)
27+
- Ability to mix code actions and LLM invocation seamlessly for the maximum predictability possible (because of structure)
28+
- Emphasis on domain modelling and potential to integrate with what's already there
29+
- Builds on Spring for easy adoption in Java
30+
- Lovely modern API in Java or Kotlin
31+
- Highly testable
32+
33+
Once more the Java community can do with Spring and open source did in
34+
taking back control from vendors and demonstrating what works
35+
36+
As an example of Embabel's power, this slide deck was built by Embabel.
37+
The Decker agent illustrates the core ideas. Pull example of how
38+
Agents and Goals and AchievesGoal work.
39+
40+
Conclusion:
41+
42+
You could go with vendor snake oil or start from scratch
43+
with an unimaginative python framework. Massive risk.
44+
Or try Embabel, the best agent framework everywhere.
45+
Put a little Gen AI into your apps today and then grow towards the full potential of unlocking your business value
46+
47+
header: |
48+
---
49+
marp: true
50+
title: Gen AI Grows Up: Building Production-Ready Agents on the JVM
51+
theme: default
52+
paginate: false
53+
class: invert
54+
size: 16:9
55+
---
56+
57+
images:
58+
embabel:
59+
useWhen: start of deck on title slide, end of deck. it's a tall image
60+
url: https://raw.githubusercontent.com/embabel/embabel-agent/refs/heads/main/embabel-agent-api/images/315px-Meister_der_Weltenchronik_001.jpg
61+
spring:
62+
useWhen: on first slide mentioning spring
63+
url: https://upload.wikimedia.org/wikipedia/commons/4/44/Spring_Framework_Logo_2018.svg
64+
kotlin:
65+
useWhen: background of first slide mentioning kotlin
66+
url: https://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Kotlin_Icon.svg/1024px-Kotlin_Icon.svg.png?20171012085709
67+
# java:
68+
# - useWhen: x
69+
# url: https://upload.wikimedia.org/wikipedia/en/3/30/Java_programming_language_logo.svg
70+
spring-ai:
71+
useWhen: first slide mentioning Spring AI
72+
url: https://raw.githubusercontent.com/spring-io/spring-io-static/refs/heads/main/blog/tzolov/20250520/spring-ai-logo.png
73+
74+
75+
outputFile: goto.md
76+
77+
references:
78+
- type: github
79+
url: https://github.com/embabel/embabel-agent
80+
description: Embabel Agent Framework repository
81+
- type: github
82+
url: https://github.com/embabel/embabel-agent-examples
83+
description: Embabel Agent Framework examples repository
84+
- type: github
85+
url: https://github.com/embabel/decker
86+
description: The implementation of the presentation builder used to create this slide deck
87+
- type: webpage
88+
url: https://gotocph.com/2025/sessions/3893/gen-ai-grows-up-building-production-ready-agents-on-the-jvm
89+
description: GOTO Copenhagen 2025 session details
90+
91+
coStar:
92+
context: talk at Goto Copenhagen 2025
93+
objective: >
94+
inspire the audience to look to the JVM for production ready Gen AI
95+
and to try Embabel
96+
Convey that Embabel is truly innovative
97+
style: Rod Johnson on programming
98+
tone: informative and entertaining. be provocative and challenge the audience
99+
audience: Enterprise developers considering Gen AI

pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,30 @@
4242
<version>${embabel-agent.version}</version>
4343
</dependency>
4444

45+
<dependency>
46+
<groupId>com.embabel.agent</groupId>
47+
<artifactId>embabel-agent-code</artifactId>
48+
<version>${embabel-agent.version}</version>
49+
</dependency>
50+
51+
<dependency>
52+
<groupId>com.embabel.agent</groupId>
53+
<artifactId>embabel-agent-rag-lucene</artifactId>
54+
<version>${embabel-agent.version}</version>
55+
</dependency>
56+
57+
<dependency>
58+
<groupId>com.embabel.agent</groupId>
59+
<artifactId>embabel-agent-rag-tika</artifactId>
60+
<version>${embabel-agent.version}</version>
61+
</dependency>
62+
63+
<dependency>
64+
<groupId>com.embabel.agent</groupId>
65+
<artifactId>embabel-agent-rag-pipeline</artifactId>
66+
<version>${embabel-agent.version}</version>
67+
</dependency>
68+
4569
<dependency>
4670
<groupId>org.springframework.boot</groupId>
4771
<artifactId>spring-boot-configuration-processor</artifactId>
@@ -52,6 +76,7 @@
5276
<groupId>com.embabel.agent</groupId>
5377
<artifactId>embabel-agent-test</artifactId>
5478
<version>${embabel-agent.version}</version>
79+
<scope>test</scope>
5580
</dependency>
5681

5782
<dependency>

src/main/kotlin/com/embabel/decker/Decker.kt

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,58 +24,16 @@ import com.embabel.agent.domain.io.FileArtifact
2424
import com.embabel.agent.domain.library.ResearchReport
2525
import com.embabel.agent.domain.library.ResearchTopics
2626
import com.embabel.agent.prompt.persona.Actor
27-
import com.embabel.agent.prompt.persona.CoStar
2827
import com.embabel.agent.prompt.persona.RoleGoalBackstory
29-
import com.embabel.common.ai.prompt.PromptContributor
30-
import com.fasterxml.jackson.annotation.JsonIgnore
3128
import org.slf4j.LoggerFactory
3229
import org.springframework.boot.context.properties.ConfigurationProperties
3330
import org.springframework.boot.context.properties.NestedConfigurationProperty
3431
import org.springframework.validation.annotation.Validated
3532

36-
data class ImageInfo(val url: String, val useWhen: String)
37-
3833
data class ResearchResult(
3934
val topicReports: List<ResearchReport>,
4035
)
4136

42-
/**
43-
* @param brief the content of the presentation. Can be short
44-
* or detailed
45-
* @param autoIllustrate ask the LLM to provide illustrations. Not yet dependable
46-
*/
47-
data class PresentationRequest(
48-
val slideCount: Int,
49-
val presenterBio: String,
50-
val brief: String,
51-
val softwareProject: String?,
52-
val outputDirectory: String = "/Users/rjohnson/Documents",
53-
val outputFile: String = "presentation.md",
54-
val header: String,
55-
val images: Map<String, ImageInfo> = emptyMap(),
56-
val autoIllustrate: Boolean = false,
57-
//val slidesToInclude: String,
58-
val coStar: CoStar,
59-
) : PromptContributor by coStar {
60-
61-
@JsonIgnore
62-
val project: Project? =
63-
softwareProject?.let {
64-
Project(it)
65-
}
66-
67-
/**
68-
* File name for interim artifact with raw deck
69-
*/
70-
fun rawOutputFile(): String {
71-
return outputFile.replace(".md", ".raw.md")
72-
}
73-
74-
fun withDiagramsOutputFile(): String {
75-
return outputFile.replace(".md", ".withDiagrams.md")
76-
}
77-
}
78-
7937
@Validated
8038
@ConfigurationProperties(prefix = "decker")
8139
data class DeckerConfig(
@@ -124,14 +82,14 @@ class Decker(
12482
): ResearchResult {
12583
val topicReports = researchTopics.topics.parallelMap(context) {
12684
config.researcher.promptRunner(context)
127-
.withToolObject(presentationRequest.project)
85+
.withReferences(presentationRequest.references())
12886
.withPromptContributor(presentationRequest)
12987
.create<ResearchReport>(
13088
"""
13189
Given the following topic and the goal to create a presentation
13290
for this audience, create a research report.
133-
Use web tools to research and the findPatternInProject tool to look
134-
within the given software project.
91+
Use web tools to research and the find tools to look
92+
within the given references.
13593
Always look for code examples in the project before using the web.
13694
Topic: ${it.topic}
13795
Questions:
@@ -152,7 +110,7 @@ class Decker(
152110
): SlideDeck {
153111
val slideDeck = config.creator.promptRunner(ai)
154112
.withPromptContributor(presentationRequest)
155-
.withToolObject(presentationRequest.project)
113+
.withReferences(presentationRequest.references())
156114
.create<SlideDeck>(
157115
"""
158116
Create content for an impactful slide deck based on the given research.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.embabel.decker
2+
3+
import com.embabel.agent.api.common.LlmReference
4+
import com.embabel.agent.prompt.persona.CoStar
5+
import com.embabel.common.ai.prompt.PromptContributor
6+
7+
/**
8+
* @param brief the content of the presentation. Can be short
9+
* or detailed
10+
* @param autoIllustrate ask the LLM to provide illustrations. Not yet dependable
11+
*/
12+
data class PresentationRequest(
13+
val slideCount: Int,
14+
val presenterBio: String,
15+
val brief: String,
16+
val references: List<ReferenceSpec>,
17+
val outputDirectory: String = "/Users/rjohnson/Documents",
18+
val outputFile: String = "presentation.md",
19+
val header: String,
20+
val images: Map<String, ImageInfo> = emptyMap(),
21+
val autoIllustrate: Boolean = false,
22+
//val slidesToInclude: String,
23+
val coStar: CoStar,
24+
) : PromptContributor by coStar {
25+
26+
fun references(): List<LlmReference> =
27+
references.map { it.reference() }
28+
29+
30+
/**
31+
* File name for interim artifact with raw deck
32+
*/
33+
fun rawOutputFile(): String {
34+
return outputFile.replace(".md", ".raw.md")
35+
}
36+
37+
fun withDiagramsOutputFile(): String {
38+
return outputFile.replace(".md", ".withDiagrams.md")
39+
}
40+
}
41+
42+
data class ImageInfo(val url: String, val useWhen: String)
43+

src/main/kotlin/com/embabel/decker/Project.kt

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.embabel.decker
2+
3+
import com.embabel.agent.api.common.LlmReference
4+
import com.embabel.coding.tools.git.RepositoryReferenceProvider
5+
import com.fasterxml.jackson.annotation.JsonSubTypes
6+
import com.fasterxml.jackson.annotation.JsonTypeInfo
7+
8+
@JsonTypeInfo(
9+
use = JsonTypeInfo.Id.NAME,
10+
include = JsonTypeInfo.As.PROPERTY,
11+
property = "type"
12+
)
13+
@JsonSubTypes(
14+
JsonSubTypes.Type(value = GitHubRepository::class, name = "github"),
15+
JsonSubTypes.Type(value = WebPage::class, name = "webpage")
16+
)
17+
sealed interface ReferenceSpec {
18+
fun reference(): LlmReference
19+
}
20+
21+
data class GitHubRepository(
22+
val url: String,
23+
val description: String = "GitHub repository at $url",
24+
) : ReferenceSpec {
25+
override fun reference(): LlmReference =
26+
RepositoryReferenceProvider.create().cloneRepository(url = url, description = description)
27+
}
28+
29+
data class WebPage(
30+
val url: String,
31+
val description: String = "GitHub repository at $url",
32+
) : ReferenceSpec {
33+
override fun reference(): LlmReference =
34+
TODO()
35+
}

src/main/kotlin/com/embabel/decker/SymbolSearch.kt

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)