Building a RAG in Java
Ground a large language model in your data — on the JVM. A code-first training that builds a real retrieval-augmented-generation pipeline end to end, with the security lens baked in: no prototype that leaks, a system you can ship.
What your team can do after
A working pipeline and the judgement to run it — not a notebook demo.
Design a RAG pipeline
Decide when RAG beats fine-tuning, and lay out the pipeline: ingest → chunk → embed → retrieve → augment → generate → cite — with the trade-offs at each stage.
Ingest and embed on the JVM
Build ingestion in Java — document loaders, chunking strategies and embeddings — with LangChain4j (and the plain-Java equivalents), not a Python side-car.
Retrieve and rank
Wire a vector store, tune top-k and filters, and add metadata / hybrid retrieval so the model sees the right context, not just the nearest vectors.
Ground answers, cut hallucinations
Assemble grounded prompts, return citations, and detect when the context does not support the answer — the difference between a demo and a trustworthy assistant.
Evaluate and secure it
Measure relevance and groundedness, and defend the pipeline: prompt injection via retrieved content, data exfiltration, and access-scoped retrieval (tenant- and role-aware).
Agenda
Six modules, each ending in a hands-on lab that grows one working RAG service in Java.
- RAG, and when to use it
Architecture, RAG vs. fine-tuning vs. long-context, cost and latency.
Lab: map a real use case to a pipeline design. - Ingestion & embeddings
Loaders, chunking strategies, embedding models — in Java with LangChain4j.
Lab: build an ingestion pipeline over your own documents. - Vector stores & retrieval
Vector databases, similarity search, metadata filters, hybrid and re-ranking.
Lab: wire a store and tune retrieval quality. - Grounding & citations
Prompt assembly, context windows, source attribution, refusal when unsupported.
Lab: return grounded answers with citations. - LLM integration in Java
Chat models behind one interface — API providers and local models (Ollama), streaming, tools.
Lab: swap providers without touching the pipeline. - Evaluation & security
Relevance / groundedness evals; prompt-injection and exfiltration defenses; access-scoped retrieval.
Lab: add an eval harness and a retrieval guardrail.
Who it's for
Java developers and teams building LLM features on the JVM — search, assistants, copilots and agents grounded in their own data, without bolting on a separate Python stack.
Prerequisite: everyday Java; basic LLM familiarity helps but is not required. Pairs naturally with AI-Security for Developers.
Logistics
📋 Course details
- Formats
- On-site · live-online · on-demand (in preparation)
- Price
- On request — tailored to each client
- Duration
- Typically 1–2 days — depth and agenda tailored to your team
- Languages
- English or German
- Group size
- Private team cohorts or individual seats on scheduled dates
- Trainer
- Sven Ruppert — long-time Java developer and speaker