Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Spring AI Masterclass: LLMs, RAG, MCP, Tools & Chat Memory
Highest Rated
Rating: 4.5 out of 5(509 ratings)
3,702 students

Spring AI Masterclass: LLMs, RAG, MCP, Tools & Chat Memory

Build real AI apps in Java with Spring AI & Spring Boot : LLMs, RAG, Tool Calling, MultiModal, MCP and Long-Term Memory
Last updated 11/2026
English
German [Auto],English [Auto],

What you'll learn

  • Learn to integrate Large Language Models (LLMs) with Spring AI to build interactive chat applications using Java and Spring Boot.
  • Understand and implement Retrieval-Augmented Generation (RAG) to enhance LLM responses using custom and external knowledge sources.
  • Master tool calling with Spring AI to enable your LLM apps to take real-world actions like querying APIs or performing tasks.
  • Build multimodal applications that work with text, images, and audio by leveraging the latest OpenAI capabilities in Spring AI.
  • Learn how to configure and work with Spring AI clients, including prompt templates, message history, and streaming responses.
  • Build and deploy multiple real-world projects that cover chatbots, search assistants, and AI-powered tools using Spring AI.

Course content

27 sections • 153 lectures • 20h 8m total length
  • Course Introduction : Whats built in this course ?8:10
  • Course Roadmap and Objectives5:37

    In this lecture, I will give an introduction to the course.

  • Pre-requestites1:37

    In this lecture, I will cover the prerequisites that are needed for this course.

Requirements

  • Basic knowledge of Java and Spring Boot will help, but the course covers concepts from scratch for new learners.
  • No prior experience with AI, OpenAI, or LLMs is required—everything is explained in a simple, hands-on way.
  • Familiarity with REST APIs and JSON can be helpful, but not mandatory to follow along with the projects.
  • Curiosity and willingness to experiment with code are the most important things you’ll need for this course.

Description

Course Description


  • Unlock the power of Generative AI in your Java applications with Spring AI, OpenAI, Ollama and the Model Context Protocol (MCP)!

  • In this hands-on course, you'll learn how to build intelligent, scalable, production-ready AI applications using the Spring Boot ecosystem.

  • You'll start with your first prompt and go on to build full RAG systems, MCP servers and clients, observable AI services, and applications with short-term and long-term memory, gaining the practical skills to bring LLMs into real-world projects.

Here's a breakdown of what you'll learn in each section:

Course Introduction & Setup


  • Understand the course structure, prerequisites, and how to set up your Java and Spring AI environment.

  • Introduction to Large Language Models (LLMs), OpenAI & ChatGPT

  • Learn the basics of LLMs, their evolution, advantages and challenges, and how OpenAI's ChatGPT fits into modern AI workflows.

Getting Started with Spring AI and OpenAI API

  • Configure your project and IDE, build your first chat app using ChatClient, see how ChatClient auto-configuration works under the hood, and understand prompts, tokens, system/user/assistant messages, OpenAI request parameters, and streaming responses.

  • Global Error Handling with GitHub Copilot

  • Set up GitHub Copilot in IntelliJ and use it to build centralized error handling with ControllerAdvice.

  • Streamlining Message Passing with StringTemplates & PromptTemplates

  • Build prompts with Prompt and ChatClient, and use StringTemplate and PromptTemplate to create dynamic, reusable prompts for LLMs.


Sprng AI Advisors: Enhancing AI Interactions


  • Intercept, log and enhance AI interactions using Spring AI Advisors, including SimpleLoggerAdvisor and your own custom advisor.

Prompt Engineering with Spring AI


  • Master prompt engineering techniques such as zero-shot, few-shot, chain-of-thought and multi-step prompting, and learn how to recognize and mitigate prompt injection.


Generating Structured Data with Spring AI


  • Create structured outputs using prompt engineering and Spring AI's converters, including entity objects, lists and maps, and see how structured outputs work under the hood.


Tool Calling (Function Calling) with Spring AI


  • Connect your AI apps to external systems with tool calling to fetch live data such as system time, weather and currency rates. Learn how tool calling works under the hood, and use Spring Beans, returnDirect, ToolContext and ToolCallbacks.


RAG in Action: Empowering LLMs with External Knowledge


  • Understand Retrieval-Augmented Generation (RAG), grounding, prompt stuffing, and why stuffing the whole context doesn't scale.

Building RAG Applications (Retrieval-Augmented Generation)


  • Build an end-to-end RAG-powered Q&A system using PgVector, document indexing, semantic retrieval and generation, and see how embeddings are created under the hood.

Document Ingestion Strategies


  • Ingest and chunk PDFs, Word files and plain text using different document readers and splitters, including paragraph and token-based chunking.


Exploring Multimodality: Image Generation


  • Generate images from natural language prompts with OpenAI's image models, customize them with image options, and save Base64 outputs to the file system.

Exploring Multimodality: Vision Capabilities


  • Analyze images using LLMs, upload images as files or multipart requests, and build a real-world invoice processing use case.


Exploring Multimodality: Audio Capabilities


  • Convert text into realistic speech using TTS, and transcribe or translate speech to text using the Whisper API.

Set Up Claude Code as a Coding Assistant


  • Install and configure Claude Code and use it as an AI-powered coding assistant in your development workflow.


Spring AI Observability using OpenTelemetry


  • Add end-to-end observability to Spring AI applications with OpenTelemetry. Cover logs, metrics and traces, Logback integration, and Grafana dashboards, then build custom metrics using MeterRegistry, the Observation API and @Observed.


MCP: Model Context Protocol Fundamentals


  • Understand MCP's architecture, its key components, how AI benefits from MCP, and how the HTTP and STDIO transports work in Spring AI.


Build a Weather MCP Server using Spring WebMVC


  • Build a Weather MCP Server with MCP tools, test it with MCP Inspector, compare Plain HTTP with Streamable HTTP, write integration tests with WireMock, and understand sync vs async MCP servers.


Build a Currency Converter MCP Server using Spring WebFlux


  • Build a reactive MCP Server with the WebFlux starter, connect it to a live currency exchange API, and test it with MCP Inspector and WireMock.


MCP Client using Spring WebMVC


  • Build Spring AI MCP clients that connect to multiple MCP servers, invoke tools from natural-language prompts, log tool calls with ToolCallback, and manage stateful and stateless connections.


MCP Client using Spring WebFlux

  • Build a fully reactive MCP client that uses McpAsyncClient to connect an LLM to multiple MCP servers and exposes both regular and streaming chat endpoints.


REST API + MCP Server: They Can Coexist


  • Add an MCP server to an existing Inventory REST API without changing its behavior, reuse the existing service layer, and integrate it with a Spring MCP client.


Chat Memory using Spring AI


  • Learn why LLMs forget and how Spring AI manages conversational context with ChatMemory, ChatMemoryRepository and MessageChatMemoryAdvisor.

  • Use in-memory storage, PostgreSQL persistence with JdbcChatMemoryRepository, message eviction, and manual memory management with ChatModel.

  • Then build semantic chat memory on PgVector, inspecting similarity scores, adding similarity thresholds and de-duplication, and weighing the trade-offs.


Long-Term Memory: Episodic, Semantic and Procedural

  • Give your AI application memory that lasts beyond a single conversation.

  • Build episodic memory (dated conversation summaries recalled later), semantic memory (a user profile the model updates through a tool) and procedural memory (business procedures loaded on demand with a human in the loop), then see all of them at work in a chat UI.


Building Local AI Apps with Spring AI and Ollama

  • Run LLMs locally using Ollama, integrate them with Spring AI, and build applications that don't depend on external APIs.


Appendix: Foundations of Generative AI

Look deeper at how LLMs are trained and how GPT models evolved from GPT-1 to today.

By the end of this course, you'll be able to build full-stack AI-powered applications with Java and Spring Boot, using cloud models, local models, vision, audio, RAG, MCP, observability, and short-term and long-term memory.

You'll walk away with the confidence and experience to bring Generative AI into production-ready Java applications.


Who this course is for:

  • Java developers curious about building AI-powered apps using Spring AI and modern generative AI techniques.
  • Beginners looking to get started with Spring AI, LLMs, and practical generative AI use cases without needing prior AI experience.
  • Backend engineers and full-stack developers wanting to integrate OpenAI’s LLMs into real-world Spring Boot applications.
  • Tech enthusiasts and students eager to explore hands-on projects involving chatbots, RAG, tool calling, and multimodality.
  • Professionals interested in learning how to build production-ready AI applications with Spring Boot and OpenAI.
  • Anyone looking to future-proof their Java skills by diving into the world of generative AI and building practical AI tools.