Getting Started with Spring AI
Spring AI brings the power of large language models to Java and Spring Boot applications. It lets you integrate AI capabilities—chat, embeddings, retrieval-augmented generation, agents, and more—using the familiar Spring programming model. This Getting Started section is the entry point of the Spring AI Engineering Handbook. It guides you from understanding Spring AI concepts to building production-ready AI-powered Java applications.
If you are a Java developer or Spring Boot engineer, you can adopt Spring AI naturally. You will use the same dependency injection, auto-configuration, and testing patterns you already trust, while adding AI to your services in a consistent, portable way. This section ensures you have a solid foundation before moving to advanced topics such as RAG, agents, MCP, and enterprise AI architecture.
Learning Path​
The following diagram illustrates the progression from beginner to enterprise AI developer:
What You Will Learn​
By working through this Getting Started section, you will learn:
- The Spring AI architecture and how it fits into the Spring ecosystem
- How to integrate Spring AI with Spring Boot applications
- Dependency management and configuration for multiple AI providers
- The
ChatClientAPI and how to interact with chat models - Fundamentals of prompts, messages, and prompt templates
- How to generate embeddings and use vector databases
- The principles of retrieval-augmented generation (RAG)
- How to build AI agents and use Model Context Protocol (MCP)
- Production considerations for enterprise AI applications
Getting Started Guides​
The following guides provide a structured path through the basics. Start at the top and work your way down.
| Guide | Description |
|---|---|
| Spring AI Learning Path | A complete learning roadmap to Spring AI concepts, ecosystem, and first steps. |
| Spring AI Installation Guide | Set up Spring AI dependencies, Maven/Gradle configuration, and required environment. |
| Your First Spring AI Application | Build your first Spring AI application with Spring Boot and connect to a model provider. |
| Spring AI Project Structure | Understand recommended project organization and application architecture. |
Prerequisites​
To get the most out of this section, you should have:
- Java 17 or later — the baseline for modern Spring AI applications.
- Spring Boot fundamentals — experience with
@SpringBootApplication, dependency injection, andapplication.properties. - Maven or Gradle — ability to manage dependencies and build a project.
- REST API basics — since most AI providers expose REST endpoints.
- Basic AI concepts — high‑level understanding of what large language models do (no deep ML expertise required).
If you are new to Spring Boot, we recommend reviewing the official Spring Boot Getting Started before proceeding.
Spring AI Development Workflow​
A typical development workflow with Spring AI follows a clear progression. The flowchart below illustrates the sequence:
Each step is covered in depth across the Getting Started guides and the subsequent Framework, RAG, and Enterprise AI sections.
Recommended Learning Order​
We recommend the following sequence to build knowledge systematically:
- Understand the Spring AI architecture and its relationship with Spring Boot.
- Build your first
ChatClientapplication and get a response from a model. - Learn prompt design—system messages, user messages, and prompt templates.
- Explore different model providers (OpenAI, Azure, Ollama, etc.) and their configuration.
- Build a RAG application that retrieves documents and grounds answers in your data.
- Understand agents and MCP for autonomous tool use and context exchange.
- Apply enterprise patterns: security, observability, testing, and deployment.
Each stage corresponds to a section of the handbook; the Getting Started guides prepare you for the first three steps, while the rest are covered in the Framework, RAG, Providers, Enterprise AI, and Tutorials sections.
Related Spring AI Handbook Sections​
Once you complete the Getting Started material, the following sections deepen your expertise:
- Framework — Core abstractions: ChatClient, ChatModel, Prompt, Memory, Advisors, Tool Calling, and Streaming.
- RAG — Retrieval‑augmented generation: chunking, embeddings, vector search, and production RAG pipelines.
- Vector Databases — Vector storage and retrieval with PGVector, Milvus, Pinecone, Redis, and others.
- Providers — Integration details for OpenAI, Azure OpenAI, Ollama, Gemini, Claude, DeepSeek, and more.
- Tutorials — End‑to‑end application walkthroughs: chatbots, knowledge bases, agents, and MCP servers.
- Source Code — Deep source‑level analysis of Spring AI internals for advanced engineers and architects.
Frequently Asked Questions​
Is Spring AI only for OpenAI?​
No. Spring AI is designed with provider abstraction. It supports OpenAI, Azure OpenAI, Anthropic Claude, Google Gemini, Ollama, DeepSeek, DashScope, and many others. You can switch providers by changing dependencies and configuration without rewriting application code.
Do I need AI experience before learning Spring AI?​
You should have a basic understanding of what large language models are and how they generate text from prompts. In‑depth machine learning expertise is not required. The Getting Started guides explain AI concepts in the context of Java and Spring.
Is Spring AI suitable for enterprise applications?​
Yes. Spring AI was built for production use. It includes retry and error handling, token usage tracking, structured output, multi‑tenancy patterns, and integration with Spring Security and Micrometer. The Enterprise AI section provides detailed guidance.
What should I learn after Getting Started?​
After completing the Getting Started guides, we recommend moving to the Framework section to master the core APIs. From there, you can explore RAG for knowledge‑based applications, Tutorials for complete project examples, and Source Code for deep internals.
Summary​
Getting Started with Spring AI is the entry point of the Spring AI Engineering Handbook. It gives you the conceptual foundation, a working first application, and a clear path toward advanced topics. As you progress through the guides, you will move from basic project setup to building intelligent, production‑ready systems that leverage the full power of Spring AI.
The following sections await: Framework, RAG, Providers, Enterprise AI, Tutorials, and Source Code—each designed to make you a confident Spring AI engineer.