Favicon of Spring AI

Spring AI

An open-source Java AI framework connects Spring applications to Ollama or cloud models, with document retrieval, tool calling and MCP support.

Screenshot of Spring AI website

Spring AI is an open-source Java framework for developers adding AI to Spring applications. It connects application data and APIs to models through a common interface, with Ollama support for local LLM use and integrations with cloud providers such as OpenAI, Anthropic and Amazon Bedrock. The framework runs within your application; your choice of model provider determines whether model requests stay local or go to a cloud service.

Its shared APIs let developers change providers while retaining access to provider-specific features. It supports streaming responses, embeddings, image generation, speech transcription and speech synthesis, as well as moderation. Structured output maps model responses into typed Java objects that application code can use.

For applications that answer questions about documents, Spring AI includes document ingestion and retrieval augmented generation (RAG). It connects to vector stores including PostgreSQL/PGVector, Chroma and Qdrant, with a shared interface for filtering metadata. Conversation memory can persist in databases such as JDBC-backed stores, MongoDB or Redis.

Tool calling lets models request functions in your application. MCP support lets Spring applications consume MCP servers or expose their own services to AI clients. Spring Boot integration handles model and vector-store setup, while observability and evaluation utilities help developers inspect AI operations and assess generated content. The project uses the Apache 2.0 license.

Similar to Spring AI