GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pumpupai/spring-ai: An Application Framework for AI Engineering

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

4,451 Commits
4,451 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.mvn
.mvn
 
 
advisors
advisors
 
 
auto-configurations
auto-configurations
 
 
design
design
 
 
document-readers
document-readers
 
 
mcp
mcp
 
 
memory-repositories
memory-repositories
 
 
models
models
 
 
session-repositories/spring-ai-session-jdbc
session-repositories/spring-ai-session-jdbc
 
 
spring-ai-bom
spring-ai-bom
 
 
spring-ai-client-chat
spring-ai-client-chat
 
 
spring-ai-commons
spring-ai-commons
 
 
spring-ai-docs
spring-ai-docs
 
 
spring-ai-integration-tests
spring-ai-integration-tests
 
 
spring-ai-model
spring-ai-model
 
 
spring-ai-rag
spring-ai-rag
 
 
spring-ai-retry
spring-ai-retry
 
 
spring-ai-session
spring-ai-session
 
 
spring-ai-spring-boot-docker-compose
spring-ai-spring-boot-docker-compose
 
 
spring-ai-spring-boot-testcontainers
spring-ai-spring-boot-testcontainers
 
 
spring-ai-template-st
spring-ai-template-st
 
 
spring-ai-test
spring-ai-test
 
 
spring-ai-tool-search-tool
spring-ai-tool-search-tool
 
 
spring-ai-vector-store
spring-ai-vector-store
 
 
src
src
 
 
starters
starters
 
 
vector-stores
vector-stores
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.sdkmanrc
.sdkmanrc
 
 
AGENTS.md
AGENTS.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
commercial-settings.xml
commercial-settings.xml
 
 
mvnw
mvnw
 
 
mvnw.cmd
mvnw.cmd
 
 
pom.xml
pom.xml
 
 
release-train-settings.xml
release-train-settings.xml
 
 
settings.xml
settings.xml
 
 

Repository files navigation

Spring AI build status Maven Central

The Spring AI project provides a Spring-friendly API and abstractions for developing AI applications.

Its goal is to apply Spring ecosystem design principles, such as portability and modular design, to the AI domain and promote using strongly-typed data structures and APIs as the building blocks of an application.

At its core, Spring AI addresses the fundamental challenge of AI integration: connecting your enterprise Data and APIs with the AI Models.

The building blocks of Spring AI: the ChatClient and its features, the model APIs and providers, vector stores and retrieval, the Model Context Protocol, the Session API, observability, evaluation and resilience, and the Spring AI Community projects

Getting Started

Create a project on start.spring.io with the Spring Web and OpenAI dependencies, set the spring.ai.openai.api-key property, and inject the auto-configured ChatClient.Builder:

@RestController
class ChatController {

    private final ChatClient chatClient;

    ChatController(ChatClient.Builder chatClientBuilder) {
        this.chatClient = chatClientBuilder.build();
    }

    @GetMapping("/ai")
    String ask(@RequestParam(defaultValue = "Tell me a joke") String message) {
        return this.chatClient.prompt()
            .user(message)
            .call()
            .content();
    }

}

The Quickstart explains each step and runs the same code against a local model. From there, continue with:

  • Project Setup - the BOM, the starters and the repositories.
  • Choosing a Model Provider - what each provider supports.
  • The tutorials: Chat with Your Documents, Give the Model Tools, A Conversational App with Sessions and Build and Use an MCP Server.

Spring Boot version compatibility:

Spring AI Branch Spring Boot
2.1.x main 4.2.x
2.0.x 2.0.x 4.1.x
1.1.x 1.1.x 3.5.x

Features

This is a high level feature overview. The reference documentation follows the same structure.

ChatClient

  • ChatClient - Fluent API for communicating with AI chat models, with synchronous and streaming calls, idiomatically similar to the WebClient and RestClient APIs.
  • Advisors - Encapsulate recurring generative AI patterns, transform the data sent to and from the model, and provide portability across models and use cases.
  • Prompts and Templates - Messages, prompt templates and prompt engineering patterns.
  • Structured Output - Mapping of AI model output to POJOs.
  • Multimodality - Images, audio and other media next to text in a message.
  • Tool Calling - Permits the model to request the execution of client-side tools and functions, with Tool Search for large tool sets and Tool Call Confirmation to let a person approve a call.
  • Memory - The Session API keeps a conversation as an append-only log of events, with turn-aware compaction, recall and a JDBC repository.
  • Agents - The advisor chain of a ChatClient and its tools form the agent harness, with examples of the common workflow patterns.

Models

  • Portable Model APIs across AI providers:
    • Chat
    • Embedding
    • Image
    • Text to Speech and Audio Transcription
    • Moderation
    • Decision
  • Support for all major AI Model providers such as Anthropic, OpenAI, Amazon Bedrock, Google, Ollama, Mistral AI, DeepSeek, and more. Access to model-specific features is also available.

Data and Retrieval

  • Support for all major Vector Store providers such as Amazon Bedrock Knowledge Base, Amazon S3, Apache Cassandra, Azure Vector Search, Chroma, Couchbase, Elasticsearch, GemFire, MariaDB, Milvus, MongoDB Atlas, Neo4j, OpenSearch, Oracle, Oracle Coherence, PostgreSQL/PGVector, Pinecone, Qdrant, Redis, Typesense, and Weaviate.
  • Portable Vector Store API across providers, including a novel SQL-like metadata filter API.
  • Document ingestion ETL framework for Data Engineering, with document readers for PDF, Markdown, HTML, Office formats and more.
  • Retrieval Augmented Generation (RAG) - Out-of-the-box RAG flows as advisors, and a modular architecture to build your own.
  • Semantic Caching - Returns a cached response to a semantically similar request.

Model Context Protocol

  • MCP (Model Context Protocol) - First-class support via Boot Starters and MCP Java Annotations for building AI applications that consume MCP servers or expose Spring-based services to the AI ecosystem, for both the modern and the legacy generation of the protocol.

Across the Application

  • Observability - Metrics and traces for the ChatClient, advisors, models, tool calls and vector stores.
  • Evaluation and Testing - Utilities to help evaluate generated content and protect against hallucinated responses, with Testcontainers and Docker Compose support.
  • Resilience and Safety - Retry of failed model calls, and guardrails for unwanted content.
  • Spring Boot Auto Configuration and Starters for all AI Models and Vector Stores - use start.spring.io to select the Model or Vector Store of choice.

Community

  • Community-maintained projects add agent tools, MCP security, agent protocols and more model and vector store integrations. They follow their own release schedule and support terms, which that page describes.

Project Resources

  • Reference documentation
  • Javadoc
  • Upgrade notes
  • Modules and Starters - Every artifact, with its auto-configuration and starter.
  • Samples and Workshops
  • Spring AI Examples - Contains example projects that explain specific features in more detail.
  • Awesome Spring AI - A curated list of awesome resources, tools, tutorials, and projects for building generative AI applications using Spring AI
  • Spring AI Community - A community-driven organization for building Spring-based integrations with AI models, agents, vector databases, and more.

Building from source

You don’t need to build from source to use Spring AI. If you want to try out the latest and greatest, Spring AI can be built and published to your local Maven repository:

./mvnw clean install

This command builds all modules, runs unit tests, and publishes artifacts to your local Maven repository.

Please read our contribution guidelines for more details.

Contributing

We welcome contributions of all kinds! Please read our contribution guidelines before submitting a pull request or an issue.

About

An Application Framework for AI Engineering

spring.io/projects/spring-ai

Resources

Readme
License

Contributing

Contributing
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.