Favicon of Spring AI

Spring AI

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

Screenshot of Spring AI website

Spring AI is a Java framework for developers adding AI features to Spring applications. It connects models with application data and APIs for tasks such as answering questions about documents.

  • Model connections: Work with Ollama, OpenAI, Anthropic or Amazon Bedrock through shared APIs that support streaming responses and access to provider-specific features.
  • Documents and memory: Build document assistants with ingestion and retrieval augmented generation (RAG), connect stores such as PostgreSQL/PGVector, Chroma and Qdrant, and save conversation memory in database backends.
  • Tool calling and MCP: Let models request application functions, connect applications to MCP servers, or expose Spring services to AI clients through the Model Context Protocol.
  • Typed output and media: Map model responses into Java objects and use supported providers for embeddings, image generation, audio transcription, speech synthesis and moderation.
  • Monitoring and evaluation: Inspect AI operations and assess generated content with evaluation utilities.

The framework integrates with Spring Boot for model and vector-store connections. It's open source under the Apache 2.0 license.

Similar to Spring AI