Spring AI is the official Spring framework for building AI-powered applications. Released GA in May 2025, it gives Spring Boot developers a familiar, idiomatic way to integrate LLMs, vector stores, and agentic workflows — with the same auto-configuration and portability model Spring teams already know.
Why It's in Adopt
If your team writes Spring Boot, Spring AI is the obvious starting point. It follows every Spring convention you already know:
- Auto-configuration via
spring.ai.*properties - Spring Bean lifecycle for AI components
@Autowiredinjection ofChatClient,EmbeddingModel,VectorStore- Spring Data-style abstractions for vector stores
It reached 1.0 GA in May 2025 after two years of development, and 1.1 GA followed in November 2025 with MCP client support. Spring AI 2.0 development is now underway targeting Spring Framework 7 / Spring Boot 4.
Key Capabilities
Multi-provider support: One API, any model. Swap between OpenAI, Anthropic, Azure OpenAI, Amazon Bedrock, Google Vertex AI, and Ollama by changing a dependency and a property — no code changes.
@Autowired ChatClient chatClient;
String answer = chatClient.prompt()
.user("Explain dependency injection in one sentence.")
.call()
.content();
Structured output: Map LLM responses directly to POJOs — no manual JSON parsing.
record BookRecommendation(String title, String author, String reason) {}
BookRecommendation rec = chatClient.prompt()
.user("Recommend a Java book for senior engineers")
.call()
.entity(BookRecommendation.class);
Vector store abstraction: 20+ backends behind one interface — pgvector, Redis, MongoDB Atlas, Chroma, Weaviate, Cassandra, Pinecone, and more. Common filter expression language works across all of them.
RAG pipeline: Built-in ETL framework for ingesting documents into vector stores from files, URLs, S3, Azure Blob, GitHub, JDBC, Kafka, and more.
Chat memory: MessageWindowChatMemory (last N messages) or VectorStoreChatMemoryAdvisor (semantic memory retrieval). JDBC, Cassandra, and Neo4j backends.
MCP client: Spring AI 1.1 adds MCP client support — Spring beans can consume any MCP server as a tool, connecting your Spring application to the entire MCP ecosystem.
Observability: Full Micrometer tracing with spans for each model interaction. Works with Zipkin, Jaeger, Grafana Tempo.
When You'll Outgrow Spring AI
Spring AI is the right starting point for Spring teams, but it has real limitations you'll hit as complexity grows:
- Multi-agent orchestration. Spring AI's
ChatClientis designed for single-agent, request-response workflows. If you need agents that delegate to sub-agents, maintain shared state across agent boundaries, or implement complex routing (e.g., "triage agent picks specialist agent"), you'll find yourself building that plumbing from scratch. LangChain4j's agent primitives are more mature here. - Streaming + tool calls. Streaming responses that also invoke tools is still rough in Spring AI. If your use case requires real-time token streaming and mid-stream function calling (e.g., a chatbot that searches while typing), expect workarounds.
- Model-specific features. Spring AI's abstraction layer means you lose access to provider-specific capabilities. Anthropic's extended thinking, OpenAI's structured JSON mode with strict schemas, or Google's grounding with search — using these requires dropping down to the provider SDK, which defeats the portability promise.
- Vector store performance tuning. The abstraction layer covers 20+ backends, but performance tuning (index types, distance metrics, HNSW parameters) requires backend-specific configuration that Spring AI's common interface doesn't expose. For production RAG with performance requirements, you'll end up configuring the backend directly.
The decision framework:
| Scenario | Recommendation |
|---|---|
| Existing Spring Boot app, need to add AI features | Spring AI |
| Greenfield AI-first application with complex agent workflows | Evaluate LangChain4j |
| Need model-specific features (extended thinking, grounding) | Use provider SDK directly |
| Multi-agent system with shared state | LangChain4j or custom build |
For engineering managers: Starting with Spring AI and outgrowing it is an incremental migration, not a rewrite. Spring AI and LangChain4j coexist in the same Spring Boot app — you can use Spring AI for simple chat/RAG features and add LangChain4j for complex agent workflows without ripping anything out. The real cost of outgrowing Spring AI isn't code — it's the learning curve. Your team will need engineers who understand both frameworks, which means training time or hiring for LangChain4j experience (a smaller talent pool than Spring AI, since Spring developers outnumber LangChain4j developers significantly). Plan for 2–4 weeks of ramp-up per engineer if you make the jump.
What to Watch
Spring AI 2.0 will target Spring Boot 4 and Java 25+. The team is investing heavily in agentic workflow support (multi-step agents, tool execution loops) — this is the area that currently needs the most development compared to LangChain4j's more mature agent primitives. If Spring AI 2.0 closes the agent gap, the "outgrow" scenarios above may shrink significantly.
Getting Started
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
</dependency>
spring.ai.openai.api-key=${OPENAI_API_KEY}
spring.ai.openai.chat.model=gpt-4o
Key Characteristics
| Property | Value |
|---|---|
| Status | GA (1.1.1 as of Dec 2025) |
| Requires | Spring Boot 3.x, Java 17+ |
| Backed by | Broadcom / VMware (Spring team) |
| MCP support | Yes (1.1+, client side) |