back
Spring AI in Production
An eight-part series on building AI features in Spring Boot with Spring AI 2.0 — from provider portability and RAG to tool calling, MCP, prompt injection, cost control and agentic patterns.
- 01Spring AI - One Codebase, Many Model ProvidersHow to call an LLM from Spring Boot with ChatClient, and switch between OpenAI, Anthropic and a free local model by changing a single property. Part 1 of a series on shipping AI in Spring.9 min
- 02Spring AI Essentials - Prompts, Advisors and Structured OutputMessage roles, ChatOptions and the cross-provider temperature trap, the advisor chain that wraps every model call, and how to get typed Java records out of an LLM instead of parsing strings.8 min
- 03Spring AI Chat Memory - Making a Stateless Model RememberLLMs forget everything between requests. How ChatMemory, MessageChatMemoryAdvisor and a JDBC repository fix that in Spring AI 2.0, plus the conversation-id change and the tool-call gotcha that catch people out.8 min
- 04Spring AI RAG - Talking to Your Own DocumentsRetrieval-augmented generation in Spring Boot, from a zero-infrastructure SimpleVectorStore to the ETL pipeline, chunking, metadata filtering and the modular RetrievalAugmentationAdvisor.8 min
- 05Spring AI Tool Calling - Giving the Model the Power to ActHow @Tool turns a Java method into something an LLM can invoke, what actually happens on the wire, why ToolContext is an authorization boundary, and how to fail gracefully.8 min
- 06Spring AI and MCP - Tools That Outlive One ApplicationWhy the Model Context Protocol exists, how to consume a third-party MCP server from Spring Boot, how to build and secure your own, and the two-thirds of MCP that most coverage skips.8 min
- 07Spring AI in Production - Prompt Injection and Cost ControlThe two things that decide whether an AI feature survives production. Prompt injection including poisoned RAG documents, guardrails as advisors, and the caching and routing that keep the bill honest.10 min
- 08Spring AI Agentic Patterns - and When Not to Build an AgentPrompt chaining, routing, parallelization, orchestrator-workers and evaluator-optimizer in Spring Boot, plus approval gates, durable run state, and an honest case against reaching for an agent at all.9 min