Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreSpring AI is an application framework for AI engineering. Its goal is to apply to the AI domain Spring ecosystem design principles such as portability and modular design and promote using POJOs as the building blocks of an application to the AI domain.
At its core, Spring AI addresses the fundamental challenge of AI integration: Connecting your enterprise Data and APIs with the AI Models.
Spring AI provides the following features:
This feature set lets you implement common use cases such as "Q&A over your documentation
" or "Chat with your documentation.
"
Extensive reference documentation, sample applications, and workshop/course material.
You can get started in a few simple steps:
Create a Spring Boot Web application with a Spring AI OpenAI boot starter dependency. This Spring Initializr link can help you bootstrap the application. (With start.spring.io you can select any AI Models or Vector Stores that you want to use in your new applications).
Add your OpenAI key to the application.properties
:
spring.ai.openai.api-key=<YOUR OPENAI KEY>
Add the following snippet to your SpringAiDemoApplication
class:
@Bean
public CommandLineRunner runner(ChatClient.Builder builder) {
return args -> {
ChatClient chatClient = builder.build();
String response = chatClient.prompt("Tell me a joke").call().content();
System.out.println(response);
};
}
Run the application:
./mvnw spring-boot:run
Want to get started in another way? View the Getting Started section in the reference documentation.
Bootstrap your application with Spring Initializr.