
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.
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 the Spring Boot project, add Spring AI dependencies, and configure the OpenAI provider.
Verify setup using a simple health check endpoint.
Implement a basic /api/chat endpoint using Spring AI.
Send prompts to the LLM and validate responses using Postman or curl.
Understand Spring AI’s core abstractions and provider model.
Learn how models, clients, and configuration fit together.
Confirm the end-to-end AI call works correctly.
Discuss limitations of plain LLM chat and prepare for RAG in the next module.
Revisit the NexaCorp problem and define clear system boundaries.
Understand what the Internal Knowledge Assistant should and should not do.
Explore all fixed data sources used throughout the course.
Learn how different question types map to different knowledge sources.
Set up PostgreSQL using Docker and load course data using SQL scripts.
Inspect structured knowledge directly from the database.
Run Redis locally using Docker and connect via Redis Insight.
Understand Redis’ future role in the RAG system.
Test plain LLM chat against internal questions and observe failures.
Build a clear mental model of why RAG is required.
Learn what ingestion means in a RAG system and why it must be a pipeline.
Understand repeatability, idempotency, and common ingestion failures.
Load PDF documents and extract raw text using PDFBox.
Understand why PDF text is noisy and difficult to work with.
Ingest clean Markdown-based wiki documents.
Preserve structure and compare wiki ingestion with PDFs.
Ingest structured database records for RAG usage.
Handle time-sensitive data like announcements correctly.
Combine all ingestion sources into a single orchestration pipeline.
Produce a unified IngestedDocument model with content and metadata.
Understand why chunking is mandatory for RAG systems.
See how naive fixed-size chunking breaks semantic meaning.
Implement a basic fixed-size chunker.
Use it as a baseline to evaluate chunking limitations.
Add overlap to fixed-size chunking to reduce boundary issues.
Learn why overlap alone does not solve semantic problems.
Chunk wiki documents using their inherent structure.
Understand why semantic chunking works well for Markdown.
Handle PDFs realistically using pragmatic chunking strategies.
Prioritize traceability and metadata over perfect semantics.
Chunk database records so they participate in retrieval uniformly.
Treat each database record as an atomic chunk.
Unify all chunkers behind a single orchestration pipeline.
Produce a consistent list of Chunk objects across all sources.
Inspect chunk metadata across PDFs, wiki, and database sources.
Understand why metadata is critical for retrieval and filtering.
Understand why keyword search fails for AI systems and how embeddings enable semantic understanding. Learn where embeddings fit in a production-grade RAG architecture.
Implement an embedding pipeline using Spring AI to convert document chunks into vector representations. Generate embeddings in a test-driven, backend-friendly way.
Learn what vector databases do, how similarity search works, and why metadata matters. Compare common vector store options used with Spring AI.
Store embeddings and metadata into a real vector database using Spring AI. Ensure idempotent writes and prepare the system for retrieval in later modules.
Understand what retrieval really means in RAG systems and how it differs from simple similarity search. Learn how retrieval fits into end-to-end AI workflows.
Define clean retrieval outputs instead of returning raw text. Design retrieval models that preserve metadata and support reliable downstream processing.
Implement basic semantic retrieval using embeddings and vector similarity search with Spring AI. Retrieve top-K relevant chunks for a user query.
Prevent incorrect knowledge by applying metadata filters during retrieval. Learn how source type, document identity, and time sensitivity affect results.
Introduce ranking as a separate system concern. Apply simple, practical ranking strategies without heavy machine-learning re-rankers.
Wire the retrieval pipeline into a Spring Boot chat service. Maintain clean separation between controllers, services, and retrieval logic.
Validate retrieval behavior end to end using tests. Inspect retrieved context, verify metadata integrity, and confirm cross-source retrieval works correctly.
Understand why naive prompts fail in real systems and why prompt orchestration is a backend reliability concern, not just prompt wording.
Learn how to design stable prompt models that clearly separate system instructions, retrieved context, and user questions.
Define global system rules that control how the LLM behaves, independent of retrieval or user input.
Convert retrieved chunks into deterministic, prompt-ready context while preserving metadata and traceability.
Implement grounding rules that force the LLM to answer only from retrieved knowledge or safely respond with “I don’t know.”
Generate source-attributed answers using metadata so responses are traceable, explainable, and trustworthy.
Integrate Chat Prompt in Chat Service. Inspect and validate final prompts to ensure reliable behavior before scaling, optimizing, or hardening the system.
Understand why real RAG systems fail over time without proper handling of updates, deletions, and stale knowledge.
Introduce a dedicated lifecycle service to explicitly manage ingestion and deletion without mixing concerns.
Implement stable document identity and idempotent ingestion so the same knowledge is not duplicated or corrupted.
Learn how deleting knowledge affects chunks and embeddings, and how to prevent removed content from being retrieved.
Handle updates by safely removing old embeddings and re-ingesting new content without partial or mixed states.
Integrate all the lifecycle operations together. Expose minimal, explicit API endpoints to trigger lifecycle operations in a controlled and auditable way.
Understand what changes when a locally running RAG application moves toward production, including infrastructure, configuration, secrets, containers, and health checks.
Configure Spring Boot for different environments using profiles, environment variables, and externalized configuration while keeping secrets out of source code.
Create a Docker image for the existing Spring AI RAG application and run and validate the application inside a container.
Use Docker Compose to run the Spring AI application, PostgreSQL, and Redis together as a production-like local environment.
Add Spring Boot Actuator health checks and understand liveness, readiness, and dependency health for container and cloud platforms.
Review configuration, secrets, infrastructure, containers, health checks, and startup requirements before deploying the RAG application to the cloud.
Understand the AWS architecture and key services required to deploy the RAG application, including networking, compute, databases, Redis, secrets, and load balancing.
Create an Amazon ECR repository and publish the Dockerized RAG application so it can be deployed to AWS.
Move PostgreSQL to Amazon RDS, configure connectivity, and load the existing NexaCorp schema and data into the managed database.
Set up managed Redis on AWS, configure connectivity, and verify the Redis capabilities required by the RAG vector store.
Deploy the containerized Spring AI RAG application to ECS/Fargate and connect it to the AWS-hosted PostgreSQL and Redis services.
Secure sensitive configuration using AWS Secrets Manager and inject secrets into the ECS application without storing credentials in the image or configuration.
Configure an Application Load Balancer to expose the ECS-hosted RAG application and validate health checks and public API access.
Safely remove the AWS resources created during deployment and understand resource dependencies, deletion order, and cost management.
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.