Setup · 18:30
Introduction and setup
API keys and project.
- Build AI apps without a PhD.
- Get API keys.
- Create a Spring Boot project.
| Step | Action |
|---|---|
| Keys | OpenAI/Anthropic |
| Project | Spring Initializr |
Do this in your own tools, step by step. Ticks are saved on this device.
Framework?
Spring AI.
Project via?
Spring Initializr.
0:00 Like many of you, I watched the AI revolution unfold and thought, "This is amazing, but how do I actually use this in my Java applications?" That question led me on a journey, and today I'm excited to share what I've learned. Here's the reality. Most AI content is either too theoretical, Python focused, or requires deep machine learning knowledge. But as Java developers, we don't need to train models from scratch. We need to integrate these powerful AI capabilities into our existing applications using the tools and frameworks we already know.
0:46 The AI landscape is moving really, really fast. Companies need developers who can implement these AI features. And the good news for you is you don't need to switch to another language or become a data scientist. With Spring AI, your existing Java skills are exactly what you need to build production ready AI applications. So if you're ready to add AI capabilities to your Java applications, you're in the right place. Let's dive into the course overview and I'll show you exactly what we'll cover.
1:08 All right, welcome to this course, AI for Java Developers, building intelligent applications with Spring AI. My name is Dan Vega. I'm a Spring Developer Advocate at Brocom. I'll tell you a little bit more about me in a minute here. So, why are we here talking today? We are talking about Spring AI and recently Spring AI hit 1.0, which mean it is generally available. We hit that 1.0 milestone. And I'll leave this if you go over to the spring.io blog, there's a really good post on kind of the efforts that went through this.
1:31 And we also did a uh really interesting interview with Mark Pollock and Christian Toolsof on the spring office hours podcast about the 1.0 release. So if you're interested in hearing more of the backstory and how we kind of got here, uh you can take a listen to that. So, I want to start with an introduction just kind of who I am and what we're going to do in this course. Again, you can skip forward. There'll be timestamps below, but I think some of this is going to be important, so try not to go too far.
2:19 Uh, just really quick about me. Uh, my name is Danvega. You can learn more about me at danvega.dev. I'm a husband and a father. We live outside of Cleveland, Ohio. I'm a Java champion. I've been doing this for 23 24 years. Oh, I hate putting that number up there. It makes me feel old. Um, I've worn a lot of hats in this industry. One of my favorite is the one that I'm wearing right now, which is that of a Spring developer advocate because long before somebody was paying me to do so, I have been an advocate for Java and Spring.
2:41 One thing I like to share with you is that you don't need permission to advocate for the things that you're passionate about. Um, you can if you like a particular tool or a framework or a language, go talk about it. Give a lunch and learn to your office, give a meetup in your local community, uh, talk at a conference, create a video, write a blog post, share the things you're passionate about. You never know where that's going to lead you.
3:25 I'm also a soontobe author. Uh, the fundamentals of software engineering from coder to engineer. Uh, I am writing that currently. We are kind of in production with that. That is with my good friend Nate Chuda and we will doing some talks later this year depending on when you're watching this. I believe that the fundamentals of software engineering are more important than ever. I think some people are going the other way and saying I don't need to know the fundamentals and I completely disagree with that.
3:48 So I think this is a timely book. Uh if you're on the O'Reilly platform, you can go ahead and get it in early release now. I mentioned this thing called the spring office hours a little bit ago. This is a podcast. This is a a way for us to kind of keep everyone up to date with things that are going on in the Spring ecosystem. It's not just Spring Framework and Spring Boot. It's not just Spring AI.
4:15 There are a ton of projects in the ecosystem. And we have interviews with Spring team members. We talk to different guests and we try to keep you up to date with everything that's going on. So if you want to learn more about that, it's a free resource, spring offstars.io. Another free resource is the byite-sized AAI newsletter. You can learn more about it at byte-sizedai.dev. This is a newsletter that I put together to just write about the things that I find interesting in the world of AI and just give me a reason to kind of stay up todate on everything that's happening.
4:38 So again another free resource if you're interested. Okay. So I think we need to start with an agenda. What are we going to cover in this course? So I want to start with what is AI? We are going to jump into a little bit of theory and just talk about some of the terms that you're going to come across. I think you know AI is is is kind of an umbrella over a lot of different things.
5:02 It's a really broad discipline and there are some things that matter to you when we get into like generative AI. So we'll talk about things like machine learning and deep learning at a high level. I just want you to understand what these things are so when they come up in conversation you understand what is happening there. So we'll talk about some things in in AI. We'll also cover some like important concepts like prompt engineering. Uh so we'll take a look at that as well as like large language models and some other things.
5:50 So uh once we do that we'll go into getting started. I want to talk about like getting started with okay I need an API key for something like open AAI how do I do that we'll talk about how to create a new project using the spring initializer we'll talk about how to like write your first application that talks to a large language model and then we'll kind of cover some other things there but this is going to be very much a project or or code that we are working on together there'll be some code throughout the course that I might just show but early on we're going to write a lot of this code together and then we'll jump into some of the Spring AI features.
6:12 So, I think um one of the things that you'll hear me say a lot throughout this course is that if all we needed to do was hit the rest endpoints of these large language models and get a response back, we wouldn't need frameworks like Spring AI. But Spring AI is much more than a facility for making REST calls. It is a way to solve a lot of the problems that are going to come up as we start to build geni genai applications.
6:36 So we know about proprietary models like open AAI's GPT 4.1 3.03 all of them. Uh there are uh other frontier models out there like anthropic cloud and Google gemini. There are also open source models out there that you can run on your local machine and not share any of your data with some of the big companies out there with. So we'll take a look at some pros and cons, how to run them on our local machine and even how to use those models then in our spring applications.
7:21 LMS are great. They have some limitations. They have things like hallucinations and not being able to get current events. So, we need to figure out how we can augment the these limitations. So, we'll dive this is going to be a really fun section. We're going to dive into things like prompt guarding and stuffing the prompt and rag and uh tools and MCP and a whole bunch of stuff. So, uh I'm looking forward to that one. Observability, a big important feature.
7:44 You don't know you need it until you need it, right? Um, observability has kind of been rewritten in spring boot 3.0 and above. So, um, 3.0 kind of rewrote the observability story and every kind of release since then, there's been new features for observability. Each of the projects in the Spring ecosystem kind of tap into that observability. Uh, and Spring AI is no different. So now you get uh some really good observability on like what kind of requests are being made especially when we start talking about tokens like we'll learn more about tokens as we get into this but how many tokens on average am I sending to a large language model how many of those are um prompt tokens how many of those are completion tokens these are answers that you're going to want answer or questions you're going to want answers to as you're starting to build uh these generative AI applications we'll look at evaluations So it turns
8:55 out testing large language models is pretty difficult. Uh it's not that easy, right? Um there are two sides of this. Deterministic where we kind of know what the output is going to be. That's a little bit easier. But when it's non-deterministic, we don't know what the uh response is going to be. How do we test that? So Spring AI gives us some uh pretty nice features for doing that. And then we'll take a look at a conclusion.
9:18 We'll kind of wrap this up. We'll take a look at some key features. We'll talk about what's next. I'll tell you what I'm working on next. Um, and then I'll give you some resources. These are really good resources to take what you've learned and continue learning. And uh, yeah, so we'll I'll give you a whole bunch of really good stuff. So once you finish the course, don't skip the conclusion because there'll be a lot of good stuff in there for you to get.
9:41 All right. So I think just as important as what we are going to cover, I think we should talk about what we're not going to cover in this course. So you should be comfortable with Java. We're not going to dive into any uh Java fundamentals. You should be uh comfortable with Spring and know the Spring basics. We are not jumping into anything advanced here. This is really just another vertical integration piece, right? Like if you want to talk to a database, you reach for something like Spring Data.
10:03 There's a programming model there. Uh you can go ahead and take advantage of Spring Data and do some really cool things. This is another vertical, right? like now instead of talking to a database, we're talking to large language models and in that there's a familiar programming model and we are now just taking advantage of another vertical. So if you know the spring basics, you should be able to get up and running with Spring AI. We're not going to dive deep into any machine learning, deep learning, neural networks, uh natural language processing, any of that AI theory.
10:28 We're going to talk about it as a high level so we understand it in conversation and that's really it. We're not going to build our own LMS. We're not going to fine-tune our models. We're not going to talk about how we get this into production. We're just kind of laying the groundwork for building these generative AI applications. So, we're not going to comprehensive coverage of all AI providers. Seems like a new provider comes out with a new model every week and now it's the latest and greatest.
10:50 The benchmarks say so, but we're not going to do that. We're going to look at like one I'll talk about this later, but one of the cool really cool things about Spring AI is that you can kind of just swap models out. So, we're writing code that is not model specific. So, if you want to go choose Google Gemini, uh you can just do some configurations and do that and change that. So, you don't have to change code.
11:13 We're going to get into retrieval augmented generation or rag for short as we get into the LM limitation section. We're going to look at a very basic example. We're not going to get too deep into vector databases and how they work and some different like search functionality we could do. We're going to look at a very basic example to augment anal. And then we're not going to get into complete MCP specification. Again, we'll mention MCP. We'll look at an example of MCP.
12:01 We're not going to go too deep down that rabbit hole of MCP and agents. That's for the next course. So, if you're interested in that, uh, let me know in the comments below. So, I think uh, I have some tips on how to get the most out of this course. So, there are timestamps. Jump to specific topics as needed. But again, if you are new to AI, I would suggest just trying to go through the kind of AI theory stuff and understanding some of these things at a high level.
12:24 Uh so that you know what they are in conversation. There's a whole bunch of resources. There'll be some in the conclusion. There'll be some links and documentation and code in the description below. All of the things that we're going to show off today, uh you should have access to. I want you to learn, build, and share. apply each of these concepts immediately in your own project. Try not to watch the entire course at once and then do stuff as we kind of do things.
12:45 How can I use that immediately in in one of my own projects? And again, some of this a lot of this code we're going to do together. So, code along if you can. If you got two monitors, you got two laptops, whatever, put me on one and start uh typing on the other. Pause and experiment. So, when you get through a certain thing, pause it. Let's try and you know you followed along with me now try to do it yourself maybe try to build out a little feature pause and experiment along the way there's a really great community called the spring AI community that will be in the resources for this course really great great place to kind of ask questions and share some of the things that you're doing start with simple use cases build a basic chatbot before getting into something more complex I like to keep a little journal uh for learning Note your ideas as you um for for projects that you might want to do on your own as
13:55 you're watching along. I like to watch in segments. Uh one section per day is better for retention. I know this when I go to conferences and I sit through just those like 45 minutes to an hour. I'm like overloaded and then I go to the next talk and now I'm overloaded again. Uh so maybe break this up, take what you've learned, kind of apply it and then come back the next day and watch another section. We are going to prepare our environment together.
14:18 So we'll talk about how to get an API key, how to kind of use that in your Spring app, how to create that initial Spring app using the Spring initializer, and make sure we have everything ready to go so we can follow along. Build a portfolio project. Uh create one substantial AI powered app by the end of this course. I think that's a pretty cool goal to have. The Spring AI reference documentation is really great. So we're gonna see it.
14:42 I'm going to show it off a lot throughout this course. It'll be in the resources. Uh I would keep it open. That is a great place to kind of cross reference things. Share your progress. Tweet posts, LinkedIn, whatever you want. Uh blue sky about what you're building for accountability. And if you're doing something based on this course, let me know. Tag me in your tweet. I'd love to see that. And then focus on your domain. Think about each feature applies to your specific industry or work and maybe a hobby project or something like that.
15:05 How can this apply to what you're trying to do? So, quickly just some prerexs. Uh, hey, we need to be familiar with Java and Spring. We need to have an IDE or a text editor, something to write code in. I'm going to use Intelligj, but you can use whatever you'd like. resources, uh, my website, uh, the Spring AI reference documentation, and then this is going to be the repo for all of the code that we're going to go through in this course, the Spring AI workshop repo over on github.com/danvega.
15:30 That's where you'll find a lot of the code, but again, we're going to go through this together. So, I just want you to have that as kind of a backup. All right, with that I think we are ready to dive in and start talking a little bit about what is AI. I think a really good place to start is with the term artificial intelligence. We hear this term thrown around a lot these days, but what is it?
15:52 We're going to talk about AI at a high level. We'll talk about machine learning and deep learning, where LLMs or large language models fit into that. And once we do that, we'll cover some things like prompt engineering, which I think is one of the most um fundamental skills that you can have as someone leveraging AI or building intelligent applications. Prompt engineering becomes very vital to that. We'll talk quickly about Java and AI. Where does that fit into it?
16:41 And we'll talk quickly about Spring AI and then we'll jump into basically getting started and writing some code together after that. While artificial intelligence has seemingly worked its way into every conversation we have, it isn't new. Computer scientists have been chasing this dream since the 1940s or 50s when computers filled entire rooms and had less processing power than the phone in your pocket. Research in AI has progressed in waves of excitement followed by AI winters where progress stalled and funding dried up.
17:04 Then in November of 2022, OpenAI released Chat GBT to the public. Within 5 days, it had a million users. Within two months, 100 million. Suddenly, AI wasn't just a research curiosity, but a tool anyone could harness. So, when it comes to answering the question, what is AI? There isn't a simple answer because it's such a broad discipline. AI is an umbrella term that covers everything from simple rule-based systems to neural networks that attempt to mimic how the human brain processes information.
17:31 So to keep this relevant to us as software developer developers, we're going to focus in on a specific set of techniques that have proven effective at solving some very interesting problems. Learning a new technology can often feel daunting, particularly when it comes to mastering all the terminology that can be found in a new domain. In AI, you'll encounter terms like machine learning, deep learning, generative AI, and natural language processing. At its core, modern AI teaches computers how to recognize patterns and make decisions based on data, unlike traditional programming where we would write stepbystep instructions.
18:18 Now as a software developer you don't need to become an AI researcher but
Get the other 14 chapters, the exam and your certificate for LinkedIn, plus all 700+ AI courses.