Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Spring AI + RAG: Build Production-Grade AI with Your Data
Rating: 4.7 out of 5(141 ratings)
1,495 students

Spring AI + RAG: Build Production-Grade AI with Your Data

Build production-grade RAG with Spring AI: ingestion, retrieval, evaluation, Docker, AWS deployment, and Ollama
Last updated 9/2026
English
English [Auto],French [Auto],

What you'll learn

  • Design end-to-end RAG systems using Spring AI, following backend system design principles rather than demo-style implementations.
  • Build repeatable ingestion pipelines for PDFs, wiki documents, and database content with clear structure and metadata.
  • Implement effective chunking and embedding pipelines that directly impact retrieval quality and correctness.
  • Design metadata-aware retrieval pipelines and integrate them cleanly into backend chat flows.
  • Control LLM behavior using explicit prompt orchestration, grounding rules, and source-aware answers.
  • Manage the full knowledge lifecycle by safely adding, updating, and deleting data without corrupting retrieval results.

Course content

11 sections • 72 lectures • 8h 17m total length
  • Course Context & What We Are Building3:10

    Understand the NexaCorp use-case, why RAG is needed, and what this course will focus on.
    Sets expectations and explains how the system evolves module by module.

  • Free IntelliJ IDEA (90 Days)0:41

    Get IntelliJ IDEA Ultimate for free and follow this course using a professional development environment.

    Redeem your 90-day access and get started quickly.

  • Create Spring Boot Project & Configure Spring AI3:40

    Create the Spring Boot project, add Spring AI dependencies, and configure the OpenAI provider.

    Verify setup using a simple health check endpoint.

  • Build a Minimal Chat API6:09

    Implement a basic /api/chat endpoint using Spring AI.

    Send prompts to the LLM and validate responses using Postman or curl.

  • Course Source Code & Git Branch Guide1:38
  • Spring AI Concepts & Provider Abstraction3:09

    Understand Spring AI’s core abstractions and provider model.

    Learn how models, clients, and configuration fit together.

  • Sanity Check & Why Plain Chat Is Not Enough2:44

    Confirm the end-to-end AI call works correctly.

    Discuss limitations of plain LLM chat and prepare for RAG in the next module.

Requirements

  • Basic experience with Java and Spring Boot (REST APIs, configuration, project structure).
  • Comfortable working with databases and general backend application concepts.
  • Familiarity with IDE-based development and running applications locally.
  • No prior AI, RAG, or Spring AI experience required — all AI concepts are covered from scratch.

Description

Most RAG courses stop at loading a few documents and asking questions.

This course goes further.

Spring AI + RAG: Build Production-Grade AI with Your Data teaches you how to design, build, test, containerize, deploy, and operate a real Retrieval-Augmented Generation (RAG) system using Spring AI.

You will build an Internal Knowledge Assistant for a fictional company and progressively evolve it from a simple Spring AI application into a production-ready RAG system with multi-source ingestion, metadata-aware retrieval, knowledge lifecycle management, Docker, AWS deployment, and private LLM support using Ollama.

Includes free 90-day access to IntelliJ IDEA Ultimate for a professional development experience.

Includes professionally prepared subtitles in Spanish, Portuguese (Brazil), Japanese, and Chinese.

This is not a prompt-engineering or chatbot tutorial.

It is a backend-first system design course focused on correctness, reliability, maintainability, production readiness, and real deployment.

You will build the same application throughout the course — not a collection of disconnected demos.

What You Will Build

You will build an Internal Knowledge Assistant for a fictional company called NexaCorp.

NexaCorp's knowledge is spread across:

  • PDF policy and compliance documents

  • Internal Markdown wiki documentation

  • Structured database data such as FAQs, release notes, and announcements

The system progressively evolves into a complete RAG application using:

  • Java

  • Spring Boot

  • Spring AI

  • PostgreSQL

  • Redis / vector storage

  • Docker and Docker Compose

  • Amazon Web Services (AWS)

  • Ollama

  • Open-source local LLMs

The same codebase evolves throughout the course, just like a real backend system.

What Makes This Course Different

  • RAG is treated as a system, not a prompt trick

  • The course follows a backend-first architecture

  • Ingestion, chunking, embeddings, retrieval, and prompting are separate system pipelines

  • Metadata is treated as a first-class concern

  • Knowledge can be added, updated, and deleted safely

  • Retrieval is metadata-aware and test-driven

  • LLM behavior is controlled through explicit prompt orchestration and grounding rules

  • Answers can include source attribution and citations

  • The application is prepared for production deployment

  • Configuration and secrets are separated from application code

  • The complete application is containerized with Docker

  • The containerized application is deployed to AWS

  • You learn how to use managed PostgreSQL, managed Redis, ECS/Fargate, ECR, Secrets Manager, and an Application Load Balancer

  • You learn how to run the same RAG system using a private LLM with Ollama

  • You learn how Ollama can run locally as well as on an AWS GPU-enabled EC2 instance

  • Spring AI's model abstraction allows the RAG application to switch model providers without rewriting the core RAG pipeline

  • No Python

  • No LangChain

  • No demo-only shortcuts

By the end, you will not just know how to "use Spring AI."

You will understand how to design, build, operate, containerize, deploy, and evolve an AI system as a real backend application.

What You Will Learn

RAG Architecture & Foundations

  • How to design a production-oriented RAG architecture

  • How to identify the boundaries of a RAG system

  • How RAG differs from a simple LLM chat application

  • How data sources map to different knowledge and query requirements

  • How the major components of a RAG system work together

Data Ingestion

  • How to design reliable, repeatable ingestion pipelines

  • How to ingest PDF documents

  • How to extract and normalize text from PDFs

  • How to ingest Markdown-based wiki content

  • How to ingest structured database content

  • How to preserve metadata throughout the ingestion pipeline

  • How to design ingestion for idempotency

  • How to orchestrate multiple data sources through a unified pipeline

Chunking

  • Why chunking matters to retrieval quality

  • Why naive fixed-size chunking can break meaning

  • Fixed-size chunking

  • Chunking with overlap

  • Structure-aware chunking for Markdown/wiki content

  • Pragmatic chunking strategies for PDFs

  • Handling database records as retrieval-ready chunks

  • How to design a unified chunking orchestration pipeline

  • Why chunk metadata matters for downstream retrieval

Embeddings & Vector Storage

  • Why embeddings are needed for semantic retrieval

  • How embeddings fit into the RAG architecture

  • Spring AI's embedding abstractions

  • Building an embedding pipeline

  • Persisting embeddings in vector stores

  • Storing metadata alongside embeddings

  • Designing repeatable and traceable vector storage

Retrieval

  • How retrieval differs from simple vector similarity search

  • Designing a structured retrieval pipeline

  • Query embedding generation

  • Top-K similarity search

  • Metadata-aware filtering

  • Source and document filtering

  • Time-sensitive knowledge handling

  • Ranking and pragmatic re-ranking strategies

  • Handling retrieval results as structured objects

  • Integrating retrieval into a backend chat flow

  • Validating retrieval across multiple data sources

Prompt Orchestration & Reliability

  • Why prompt orchestration matters in RAG systems

  • Designing a stable prompt contract

  • Separating system instructions, retrieved context, and user questions

  • Externalizing system prompts

  • Building prompt-ready context from retrieved chunks

  • Grounding the LLM with explicit rules

  • Handling empty or insufficient context

  • Safe "I don't know" behavior

  • Source attribution and citations

  • Validating prompts and generated behavior

Knowledge Lifecycle

  • Why RAG knowledge cannot be treated as static data

  • Designing knowledge lifecycle operations

  • Adding new knowledge

  • Updating existing knowledge

  • Deleting knowledge safely

  • Establishing stable document identity

  • Idempotent ingestion

  • Removing old chunks and embeddings

  • Re-ingesting updated knowledge

  • Keeping vector stores consistent as knowledge changes

  • Creating explicit operational entry points

Containerization & Production Readiness

  • What changes when moving a RAG application from local development to production

  • Spring Boot production configuration

  • Spring profiles

  • Environment variables

  • External configuration

  • Separating secrets from application code

  • Creating a Dockerfile

  • Building and running the RAG application as a container

  • Container environment variables and ports

  • Container logs

  • Docker Compose

  • Running Spring Boot, PostgreSQL, and Redis as a complete multi-container stack

  • Spring Boot Actuator

  • Application health

  • Database and Redis health

  • Liveness and readiness

  • Production readiness checks

Deploying RAG to AWS

  • AWS architecture for a production-style RAG application

  • Publishing Docker images to Amazon ECR

  • Moving PostgreSQL to Amazon RDS

  • Moving Redis to managed AWS infrastructure

  • Deploying Spring Boot with Amazon ECS / Fargate

  • Configuring containers, networking, CPU, memory, and environment variables

  • Connecting the application to RDS and Redis

  • Managing sensitive configuration with AWS Secrets Manager

  • Configuring an Application Load Balancer

  • Health checks and public API access

  • Testing the complete deployed RAG application

  • Troubleshooting deployed application issues

  • AWS resource cleanup and cost awareness

  • Understanding how Spring AI can also work with Amazon Bedrock

Private LLMs with Ollama

  • What local and private LLMs are

  • Why organizations may choose private LLM infrastructure

  • Ollama architecture

  • Running open-source LLMs locally

  • Connecting Spring AI to Ollama

  • Replacing a public LLM provider with Ollama

  • Running the complete RAG application with a local LLM

  • Understanding public vs private LLM architectures

  • Data privacy and infrastructure considerations

  • Hosting Ollama on an AWS GPU-enabled EC2 instance

  • Connecting the Spring AI RAG application to AWS-hosted Ollama

  • Using Ollama for both embedding generation and LLM inference

  • Understanding the operational and cost considerations of GPU infrastructure

Course Modules Overview

This course is organized as a progressive backend system build, where each module introduces a new system concern and builds directly on the previous work.

  • Module 1 — Project Setup & Spring AI Sanity Check
    Build the Spring Boot foundation, configure Spring AI, connect to an LLM, and create the initial chat endpoint.

  • Module 2 — RAG Readiness: Use-Case, Data & Infrastructure
    Define the NexaCorp use-case, understand the data sources, set up PostgreSQL and Redis, and establish the RAG mental model.

  • Module 3 — Data Ingestion Pipelines
    Build ingestion pipelines for PDFs, Markdown wiki content, and database data, then unify them into a repeatable ingestion flow.

  • Module 4 — Chunking Strategies
    Explore fixed-size, overlap, structure-aware, PDF, and database chunking strategies and build a unified chunking pipeline.

  • Module 5 — Embeddings & Vector Storage
    Generate embeddings and persist chunks with metadata in a vector store, making the system retrieval-ready.

  • Module 6 — Retrieval Pipelines & Integration
    Build metadata-aware retrieval, similarity search, ranking, and integrate retrieval into the backend chat flow.

  • Module 7 — Prompt Orchestration & Reliability
    Introduce explicit prompt contracts, grounding rules, controlled generation, and source-attributed answers.

  • Module 8 — Knowledge Lifecycle & Operational Ingestion
    Make the RAG system operational by supporting safe knowledge addition, updates, deletion, identity, idempotency, and re-ingestion.

  • Module 9 — Containerization & Production Readiness
    Prepare the application for production with environment-specific configuration, Docker, Docker Compose, health checks, readiness, and a production-readiness checklist.

  • Module 10 — Deploying the RAG Application to AWS
    Deploy the containerized RAG application to AWS using ECR, RDS, managed Redis, ECS/Fargate, Secrets Manager, and an Application Load Balancer.

  • Module 11 — Private LLMs with Ollama: Local & AWS
    Run an open-source LLM locally with Ollama, integrate it with Spring AI, run the complete RAG system privately, and host Ollama on an AWS GPU-enabled EC2 instance.


Course Outcome

After completing this course, you will be able to:

  • Design production-oriented RAG systems

  • Build multi-source ingestion pipelines

  • Choose and implement appropriate chunking strategies

  • Build embedding and vector-storage pipelines

  • Design metadata-aware retrieval

  • Build structured retrieval pipelines

  • Implement grounded and source-attributed generation

  • Manage the lifecycle of knowledge as it changes

  • Prepare Spring AI applications for production

  • Containerize RAG applications using Docker

  • Run a complete RAG stack using Docker Compose

  • Deploy a containerized RAG application to AWS

  • Work with AWS services such as ECR, RDS, ECS/Fargate, managed Redis, Secrets Manager, and Application Load Balancer

  • Run Spring AI with a private LLM using Ollama

  • Run an open-source LLM locally

  • Host Ollama on AWS GPU infrastructure

  • Connect a RAG application to a remote private LLM

  • Understand the architectural trade-offs between public and private LLM deployments

Most importantly, you will develop the mental model and engineering discipline required to build AI systems as real backend systems — not just prototypes or demos.

The course takes you from:

Spring AI → RAG → Ingestion → Chunking → Embeddings → Retrieval → Reliable Generation → Knowledge Lifecycle → Docker → AWS → Private LLMs

So you don't just learn individual RAG techniques.

You learn how the entire system fits together and evolves toward production.

Who this course is for:

  • Java and Spring Boot developers who want to integrate RAG into backend applications
  • Backend engineers adding AI capabilities to existing systems and services
  • Developers who care about system design, correctness, and long-term maintainability
  • Engineers who want to understand how RAG works end-to-end, from ingestion to retrieval and controlled generation