Spring AI in Action , written by Craig Walls and published by Manning, is a comprehensive guide for Java developers looking to integrate generative AI capabilities—such as chatbots and text summarization—natively into their applications using Spring and Spring Boot. Repository Resources
Official code samples for the book are hosted on GitHub by the author, Craig Walls (habuma).
Main Samples Repo: habuma/spring-ai-in-action-samples contains the cleaned code for the book's final version.
Extended Examples: habuma/spring-ai-in-action-examples includes code built against different versions of the framework, such as Spring AI 1.1.0. Core Content & Chapters
The book follows a practical, example-driven approach, covering everything from basic setups to advanced orchestration:
Foundations: Getting started with Spring AI, submitting prompts, and evaluating generated responses.
Retrieval-Augmented Generation (RAG): Techniques for "talking with your documents" using vector databases to ground LLM responses in proprietary data.
Advanced Orchestration: Activating tool-driven generation, implementing agents, and using the Model Context Protocol (MCP).
Multimodal AI: Generating and interpreting content across audio and images.
Operations & Safety: Observing AI operations and implementing guardrails to safeguard generative features. PDF and Access Information
While the official reference documentation is primarily HTML, Manning offers the PDF version of the book as part of their LiveBook platform or for download upon purchase of the print or digital edition. Public GitHub repositories typically host only the sample code, not the copyrighted book PDF itself. habuma/spring-ai-in-action-samples - GitHub
While there is no single official "Spring AI in Action" PDF, several GitHub repositories provide the sample code and related resources for the upcoming book Spring AI in Action by Craig Walls. GitHub Repositories Spring AI in Action Examples
: The official code repository for the book. It includes branches for different versions, such as Spring AI 1.1.0 and the main branch aligned with Spring AI 1.0 Spring AI in Action Samples : A placeholder repository managed by the author, Craig Walls (habuma)
, intended to host cleaned example code once the book is finalized. Spring AI RAG Example
: A specific demonstration of Retrieval-Augmented Generation (RAG) using Spring AI with PDF documents as data sources. Key Resources & Blog Posts Reference Documentation : Currently, there is no official PDF download
for the Spring AI reference guide; it is primarily available as HTML documentation Spring AI 101 : A community project by Alexandre Roman
that showcases Spring AI features like prompt templating, stateful chat, and image generation in action. Awesome Spring AI : A curated list on GitHub featuring tutorials and technical guides
for Spring AI 1.0, including RAG and Model Context Protocol (MCP) implementations. Baeldung Introduction : A popular technical
covering the basics of Spring AI and supported models like Anthropic and DeepSeek. Where to find the Book Spring AI in Action is published by Manning Publications
. You can find the most recent updates and early access chapters on the official Manning book page function calling habuma/spring-ai-in-action-samples - GitHub
3) Using GitHub responsibly
- Search GitHub for repositories named after the book to find source code and example projects.
- Verify repository ownership — prefer repos by the book’s authors or the publisher.
- Do not download or share full book PDFs from repositories unless clearly licensed for redistribution.
- Clone or fork repos with code samples for learning; attribute the original authors if you reuse their code.
3. The RAG Blueprint: ThomasVitale/llm-app-java-spring-ai
- URL:
github.com/ThomasVitale/llm-app-java-spring-ai
- What you get: A production-grade application connecting Spring AI to Ollama (local LLM) and PostgreSQL with PGVector.
- Action Item: Study the
CustomerSupportAgent class. It shows how to load PDFs into a vector store and query them.
Conclusion: Your Next Steps
Your search for "spring ai in action pdf github" tells us you are serious about bridging theory and practice. Here is your actionable roadmap:
- Buy the eBook from Manning (wait for a 40-50% sale via their newsletter).
- Clone the official GitHub repo immediately—you can start running code today, even without reading the book.
- Set up your keys (OpenAI/Anthropic/Ollama) and run the
chapter-02 example.
- Submit a PR if you spot a bug—it is the best way to learn.
The convergence of Spring’s robustness and AI’s generative power is the most exciting shift in enterprise Java since Spring Boot itself. Whether you read from a PDF, a printed page, or directly from the source on GitHub, the key is to take action—just as the book title implies.
Happy coding, and may your tokens be cheap and your contexts large.
Title: "Spring AI in Action: How a Team of Developers Built a Smart Chatbot"
Introduction
As the world continues to evolve, artificial intelligence (AI) and machine learning (ML) are becoming increasingly important in various industries. One of the most popular frameworks for building AI-powered applications is Spring, a comprehensive platform for building enterprise-level applications. In this story, we'll explore how a team of developers used Spring AI to build a smart chatbot that can understand and respond to user queries.
The Project
The project, codenamed "SmartBot," aimed to create a conversational AI that can assist customers with their queries. The team consisted of five developers with diverse backgrounds in Java, Python, and natural language processing (NLP). They were tasked with building a chatbot that can:
- Understand user queries
- Provide relevant responses
- Learn from user interactions
The Technology Stack
The team decided to use the following technology stack:
- Spring Boot 2.3.x as the core framework
- Spring AI 1.0.x for building the AI-powered chatbot
- Apache Kafka for message queuing and event-driven architecture
- Docker for containerization
- GitHub for version control and collaboration
The Implementation
The team started by setting up a Spring Boot project with Spring AI dependencies. They configured the AI module to use a pre-trained language model, which would enable the chatbot to understand user queries.
Next, they implemented the chatbot's business logic using Spring AI's conversational API. They defined intents, entities, and actions to handle various user queries. For example, when a user asks, "What's the weather like today?", the chatbot responds with the current weather conditions.
To enable the chatbot to learn from user interactions, the team integrated Apache Kafka to collect and process user feedback. They implemented a feedback loop that allows the chatbot to adjust its responses based on user ratings.
The Code
Here's a sample code snippet that demonstrates the chatbot's implementation:
import org.springframework.ai.core.AI;
import org.springframework.ai.core.AIResponse;
import org.springframework.ai.core.Conversation;
import org.springframework.ai.core.Message;
import org.springframework.ai.core.config.AIConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ChatbotService
@Autowired
private AI ai;
public String respondToUserQuery(String query)
Conversation conversation = new Conversation(query);
AIResponse response = ai.respond(conversation);
return response.getOutput();
The Results
After several weeks of development, the team deployed SmartBot on a cloud-based infrastructure using Docker. They integrated the chatbot with a popular messaging platform, allowing users to interact with it.
The results were impressive:
- User engagement increased by 30%
- Customer satisfaction ratings improved by 25%
- The chatbot handled over 1,000 user queries per day with an accuracy rate of 90%
The Future
The team continues to improve SmartBot by:
- Integrating with more data sources to enhance the chatbot's knowledge base
- Using more advanced NLP techniques to improve the chatbot's understanding of user queries
- Exploring the use of other AI technologies, such as computer vision and speech recognition
Conclusion
In this story, we saw how a team of developers used Spring AI to build a smart chatbot that can understand and respond to user queries. By leveraging Spring AI's conversational API and integrating with other technologies, the team created a highly engaging and effective chatbot. As AI continues to evolve, we can expect to see more innovative applications of Spring AI in various industries.
PDF and GitHub
For those interested in learning more, the team's experience report and code snippets are available on GitHub: https://github.com/spring-ai/spring-ai-in-action. A PDF version of this story can be downloaded from https://spring-ai.github.io/spring-ai-in-action.pdf.
The Spring AI in Action ecosystem represents a major shift for Java developers, moving generative AI capabilities from the Python-centric world into the enterprise-grade Spring framework. Central to this transition is the work of Craig Walls and the corresponding resources available on GitHub. Core Concepts of Spring AI
Spring AI uses familiar Spring ecosystem design principles. These principles include portability, modular design, and POJO-centric development. It offers an abstraction layer. This layer allows developers to interact with major AI providers, such as OpenAI, Google Gemini, and Anthropic. This interaction occurs without being tied to a specific vendor's SDK.
Abstractions: Standardizes interactions for chat models, text-to-image generation, and audio transcription.
Vector Store Integration: Supports providers such as PostgreSQL/PGVector, Pinecone, and Redis for semantic search.
Observability: Integrates with the Spring monitoring stack to track AI call performance and cost. Mastering the Framework: "Spring AI in Action"
The book Spring AI in Action by Craig Walls is a guide to implementing these features. It takes developers from basic examples to more complex enterprise patterns. Key Feature Practical Application RAG Systems Building chatbots that use vector databases. Tool Calling Allowing models to execute local Java code. MCP Integration Providing context to LLMs. Multimodality Generating images from text and processing audio in Java. Navigating the GitHub Repositories
The author maintains two main repositories for the book's example code:
spring-ai-in-action-examples: Contains the code as it appears in the book, built against Spring AI 1.0.3.
spring-ai-in-action-samples: The repository for future updates and example code.
For framework exploration, the official Spring AI examples repository provides patterns for agentic workflows and prompt engineering. Generative AI - Spring
Pattern C: Observability with Micrometer
Spring AI auto-instruments all AI calls. Add micrometer-tracing-bridge-otel to your pom.xml, and you get a Grafana dashboard showing token usage, latency, and cost per request. This is critical for "in production" vs. "in action."
The Core Components in Action
- ChatClient: The fluent API for sending messages.
- EmbeddingClient: Convert text into vectors for semantic search.
- VectorStore: Interface for Chroma, Pinecone, Redis, or Neo4j.
- Model (ChatModel, EmbeddingModel): The underlying driver.