This version is still in development and is not considered stable yet. For the latest stable version, please use Spring AI 2.1.0!

What is Spring AI

Spring AI is an application framework for building AI-powered applications with Spring. It provides portable abstractions for AI models, vector stores and tools, so the code you write does not depend on one provider.

Spring AI addresses the fundamental challenge of AI integration: connecting your enterprise data and APIs with AI models.
Spring AI connects your application to AI models Spring AI sits between your application and AI models. In one direction it gives the model context: prompts, your documents and the conversation memory. In the other direction it brings answers and actions to your application: structured output, tool calling and the Model Context Protocol. Context for the model prompts · your documents · conversation memory Answers and actions for your application structured output · tool calling · Model Context Protocol Your application Your datadocuments · databases Your APIsservices · methods ChatClient Advisors Prompts Tool calling MCP Memory RAG Structured output Observability AI models Chat Embedding Image Audio Moderation Decision Anthropic · OpenAI · Google Amazon Bedrock · Mistral AI Ollama · and more

Spring AI sits between your application and the models. In one direction it gives a model the context it needs: your prompts, your documents and the memory of the conversation. In the other direction it brings the work of the model into your application: answers as Java types, and calls to your own methods and services.

What You Can Build

Building Blocks

The following map shows the parts of Spring AI. Green parts belong to Spring AI, and blue parts are projects of the Spring AI Community. A light-blue model provider is a community-maintained integration that its provider maintains in its own repository. Select a part to go to its documentation.

The building blocks of Spring AI Spring AI consists of the ChatClient and its building blocks (advisors, prompts, structured output, multimodality, tool calling and tool search, memory) with the agent harness built on them, the model APIs for chat, embedding, image, audio, moderation and decision models with their providers, vector stores, the ETL pipeline and retrieval augmented generation, the Model Context Protocol, the Session API, observability, evaluation, and resilience and safety. The Spring AI Community adds Agent Utils, A2A, ACP, the ACP Harness Client, Amazon Bedrock AgentCore, MCP Security, Decision Extensions and Session Extensions. Qxotic jinfer is a community-maintained model provider. ChatClient a chain of advisors around the chat model AdvisorsPromptsStructured OutputMultimodalityTool Calling & Tool SearchMemory Agent Harnessagents and workflow patterns Models Model APIs ChatEmbeddingImageAudioModerationDecision Model providers OpenAIAnthropicGoogle GenAIGoogle Vertex AIAmazon BedrockMistral AIOllamaDeepSeekElevenLabsStability AISystem OneTransformers (ONNX)PostgresMLOpenAI-compatible Qxotic jinfer Data and Retrieval Vector Stores21 stores, one portable API PGVectorRedisElasticsearchOpenSearchMongoDB AtlasNeo4jMilvusQdrantWeaviatePineconeChromaand more ETL PipelineDocument ReadersRetrieval Augmented GenerationModular RAGSemantic Cache Model Context Protocol: clients, servers, annotations, both protocol generations Observability: metrics and traces for the ChatClient, models, tools and vector stores Session APIEvaluationResilience and Safety Spring AI Community Agent Utilsready-made agent tools Agent SkillsSub-AgentsWeb Search and FetchFile System and ShellLong-Term MemoryStopping the Loop Agent2Agent (A2A)Agent Client Protocol (ACP)ACP Harness ClientAmazon Bedrock AgentCoreMCP SecurityDecision ExtensionsSession Extensions

The table describes the main building blocks:

Building block What it does

ChatClient

A fluent API for talking to a chat model, similar in style to WebClient and RestClient.

Model APIs

Portable interfaces for chat, embedding, image, audio, moderation and decision models. Chat, text-to-speech and transcription models can also stream their output.

Prompts

Messages and templates for the text that is sent to a model.

Advisors

Interceptors around a model call that add memory, retrieval, tool calling, logging and other recurring patterns.

Tool calling

Lets the model request the execution of your @Tool methods to fetch information or take action. A person can approve a tool call before it runs, and tool search keeps the prompt small when there are many tools.

Model Context Protocol

Client and server support for consuming MCP servers and exposing Spring services to the AI ecosystem, for both generations of the protocol, including the 2026-07-28 revision.

Memory

Keeps a conversation across requests. Session memory stores it as a log of events, compacts it when it grows, and lets the model search it.

Retrieval augmented generation

Brings your data to the model, with an ETL pipeline for ingestion and a portable vector store API with metadata filters.

Structured output

Maps model output to Java types.

Agents

Combines these blocks into applications in which the model decides what to do next, and into workflows of several model calls.

Evaluation and testing

Utilities for evaluating generated content and for running models and stores locally in tests.

Observability

Metrics and traces for AI operations.

Resilience and safety

Retries failed model calls, and blocks unwanted input with guardrails and moderation models.

Spring Boot auto-configuration and starters are available for the model providers, the vector stores, MCP clients and servers, and session storage. See Modules and Starters.

Requirements

Spring AI requires Java 17 or later and Spring Boot 4. Project Setup lists the supported Spring Boot versions and the dependency management.

Supported Providers

Spring AI integrates with the major model providers, including Anthropic, OpenAI, Google, Amazon Bedrock, Mistral AI and Ollama, and with a wide range of vector stores. Each integration follows the same portable API, and also exposes the provider-specific options when you need them.

Projects maintained by the community extend Spring AI, for example with ready-made agent tools and with security for MCP. They are marked "(Community)" in these docs and listed under Community-Maintained Integrations.

Where to Go Next