Spring AI
Spring AI is how you add AI features to a Spring Boot app. It gives you a ChatClient (think: HTTP client but for LLMs), tool calling, memory, RAG, and structured output — all with the Spring patterns you already know.
If you've built a REST API with Spring Boot, you can build an AI-powered one. Same dependency injection, same config, same testing approach.
What's covered here
- Getting Started — what GenAI even is and how the pieces fit
- Essentials — ChatClient, the request flow, key abstractions
- Prompts — system prompts, guardrails, prompt catalogs
- Tools — letting the LLM call your Java methods
- Chat Memory — making conversations persist across requests
- RAG — grounding responses in your own data
- Structured Output — getting Java objects back instead of strings
- Agents — routing, orchestration, and multi-agent patterns
Start with Getting Started if you're new. Jump to Essentials if you already know the concepts and want to write code.