
Begin your journey with Spring AI by exploring the course structure, key learning objectives, and the practical applications you'll build—from prompt engineering to Retrieval-Augmented Generation (RAG). This overview sets the stage for integrating large language models into real-world Spring Boot applications.
In this lecture, I will cover the prerequisites that are needed for this course.
In this lecture, all the slides that are used in this course are available.
In this lecture, the source code thats done in this course are available.
Explore the pre-LLM era, How we interact with computers for solutions ? How its changed since the release of ChatGPT.
Trace the evolution of Large Language Models, from early iterations to the cutting-edge architectures shaping today's AI landscape.
Examine the benefits, hurdles, and diverse applications of LLMs, showcasing their impact across various industries and use cases.
Learn how to sign up for ChatGPT, navigate its features, and begin experimenting with this powerful AI tool in practical scenarios.
Learn the basics of Spring AI and its integration with OpenAI to build intelligent applications seamlessly.
Set up your OpenAI account and explore the Playground to experiment with generative AI capabilities.
Install and configure Java efficiently using SDKMan to prepare your development environment.
Create and configure your Java project with Gradle and IntelliJ for streamlined development.
Build a chat-based AI application using Spring's ChatClient to interact with OpenAI's platform.
Use Insomnia to test and debug your AI chat endpoints effectively.
Dive into the inner workings of ChatClient's auto-configuration to understand its architecture and functionality.
Understand the key concepts of prompts, tokens, and tokenization and how they impact AI responses.
Explore the temperature parameter to control the creativity of OpenAI's generated responses.
Learn how to manage response length effectively using the max_tokens parameter.
Learn the roles of system, assistant, and user messages in structuring AI interactions effectively.
See practical examples of system, assistant, and user messages in action to design structured conversations
Implement real-time streaming to display OpenAI responses incrementally as they are generated.
Learn how to install, configure, and authorize GitHub Copilot in IntelliJ IDEs
Use @ControllerAdvice and @ExceptionHandler to create centralized error handling in your Spring Boot application
Learn how to construct effective prompts using the Prompt and ChatClient to streamline AI interactions
Learn to design and implement a robust endpoint that leverages string templates to dynamically generate and customize code for various use cases.
Learn how to effectively utilize PromptTemplate to structure and streamline the exchange of messages in AI applications
Learn how to use StringTemplate to dynamically inject values into prompts, making them more flexible, reusable, and context-aware.
Understand the fundamentals of Spring AI Advisors and how they can be used to modify AI interactions.
Explore the SimpleLoggerAdvisor to log requests and responses, aiding in debugging and monitoring AI interactions.
Learn how to create a custom advisor to tailor AI interactions to specific application needs.
This lecture teaches how to create clear, structured prompts that lead to accurate and meaningful AI outputs.
Dive into a practical example by creating a travel plan prompt, showcasing prompt engineering techniques in a real-world scenario.
Explore the concept of prompt injection, its potential risks and the techniques to mitigate prompt injection..
This lecture explains zero-shot and few-shot prompting techniques to improve AI performance with minimal examples.
This lecture explains zero-shot and few-shot prompting techniques to improve AI performance with minimal examples.
Learners will explore how Chain of Thought Prompting helps guide AI through logical, step-by-step problem-solving.
Learn how to craft and utilize multi-step prompts to guide LLMs through complex tasks, achieving more detailed and accurate responses.
Understand how LLMs generate structured data and why it's crucial for AI-driven applications.
Explore how the entity() function and BeanOutputConverter work together to produce structured outputs seamlessly in Spring AI.
Learn how few-shot examples enhance prompt engineering to produce more accurate structured outputs.
Explore how the entity() function and BeanOutputConverter work together to produce structured outputs seamlessly in Spring AI.
Get an inside look at how Spring AI handles structured outputs behind the scenes, from prompt to parsed response.
Learn how to use ParameterizedTypeReference to handle structured outputs involving collection types like lists and maps effectively.
Learn how to generate and parse structured outputs of type Map using Spring AI, ideal for handling key-value data responses.
Understand the fundamentals of function calling and why it's essential for AI integration. Discover how OpenAI uses function calling to access and manipulate external data.
Learn how to use OpenAI's function calling to fetch system details like name and time. This lecture demonstrates how AI can interact with your device for dynamic information retrieval.
Go behind the scenes to understand how tool calling operates internally—covering request preparation, function resolution, and response parsing in Spring AI.
See tool calling in action as you integrate with OpenExchangeRates to fetch real-time currency exchange rates using Spring AI.
Learn how to fetch real-time weather data using function-based tool calling with OpenAI, demonstrating practical integration for dynamic responses
Explore how Spring Beans can be used with tool calling to retrieve live weather data in a modular and scalable way.
Discover how to generate structured outputs using tool calling, enabling reliable parsing of data from external APIs.
Learn how to customize tool calling behavior using ToolContext and the returnDirect flag to control response handling and execution flow.
Course Description
Unlock the power of Generative AI within your Java applications using Spring AI, OpenAI, and Ollama!
In this hands-on course, you’ll learn how to build intelligent, scalable AI-driven applications using the robust Spring Boot ecosystem. From crafting prompts to building full RAG-based systems, you’ll gain practical skills to integrate 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, applications, and how OpenAI’s ChatGPT fits into modern AI workflows.
Getting Started with Spring AI and OpenAI API
Configure your project and IDE, create your first chat-based app using ChatClient, and understand prompts, tokens, and OpenAI request parameters.
Working with Chat Models and OpenAIChatModel
Customize LLM responses using ChatOptions, enable streaming, and build responsive AI chat applications.
Prompt Engineering with Spring AI
Master prompt engineering techniques like zero-shot, few-shot, chain-of-thought, and multi-step prompting to guide AI outputs effectively.
Generating Structured Data with Spring AI
Learn to create structured outputs using prompt templates and Spring’s converters, including lists, maps, and entity objects.
Tool Calling (Function Calling) with Spring AI
Integrate external systems into your AI apps with OpenAI’s tool calling—fetch live data like weather, currency rates, and more.
Building RAG Applications (Retrieval-Augmented Generation)
Build an end-to-end RAG-powered Q&A system using PgVector, document chunking, indexing, and semantic retrieval.
Document Ingestion Strategies
Explore how to ingest and chunk various document types including PDFs, Word files, and plain text using different readers and splitters.
Exploring Multimodality: Vision Capabilities
Leverage OpenAI’s image models to generate, analyze, and process images including real-world examples like invoice parsing.
Exploring Multimodality: Audio Capabilities
Convert text to realistic voice using TTS, and transcribe or translate speech to text using the Whisper API.
Building Local AI Apps with Spring AI and Ollama
Run LLMs locally using Ollama, integrate it with Spring AI, and build applications without relying on external APIs.
By the end of this course, you’ll be equipped to build full-stack AI-powered applications using Java and Spring Boot, with integrations that span cloud-based models, local deployments, vision, audio, and retrieval-augmented techniques.
You’ll walk away with the confidence and experience to bring Generative AI into production-ready Java applications.