The age of artificial intelligence (because the search for regular intelligence hasn't gone well..) is nearly at hand, and it's everywhere! But is it in your application? It should be. AI is about integration, and here the Java and Spring communities come second to nobody. In this talk, we'll demystify the concepts of modern day Artificial Intelligence and look at its integration with the white hot new Spring AI project, a framework that builds on the richness of Spring Boot to extend them to the wide world of AI engineering.
Introduction to Spring AI
In the talk "Bootiful Spring AI," Josh Long, a key figure in the Spring community, introduces the audience to Spring AI, a revolutionary toolset aimed at Java and Spring developers. He emphasizes the role of Spring AI in simplifying AI engineering patterns, making them accessible to a broader audience. As Spring AI approaches its general availability (GA) release, Long discusses its potential to democratize AI model integration and usage.
The Motivation Behind Spring AI
Josh Long begins by addressing the challenges inherent in current AI models, such as their stateless nature and limitations in data handling. "As amazing as AI technologies are, they’re not perfect," Long notes, highlighting how these models often generate overly confident but incorrect responses. This underscores the need for mechanisms to enhance AI interactions, including prompt memory, data augmentation, and output evaluation.
Practical Applications with a Fictitious Scenario
To demonstrate Spring AI's capabilities, Long presents a fictitious dog adoption application based on the humorous story of Prancer, a "neurotic, man-hating, animal-hating, children-hating dog." This scenario serves as a relatable example to explore Spring AI's features. Starting with project setup using start.spring.io, Long illustrates the rapid bootstrapping of a Spring AI application by selecting dependencies like OpenAI, Spring Data JDBC, and PGVector.
Enhancing AI Interactions
Long delves into the technical aspects of maintaining conversational context with AI models. By introducing "advisors," he shows how Spring AI can address the statelessness of models, enabling persistent chat memory either in memory or through durable storage solutions like SQL or Redis. Additionally, by applying system prompts, developers can tailor model responses to specific contexts, such as simulating a knowledgeable employee at a fictional dog shelter.
Integrating Real Data and AI Tools
Long explains the integration of real data through Spring Data JDBC and vector stores, enabling Retrieval Augmented Generation (RAG). This equips AI models with up-to-date data through semantic search, as Long describes: "We'll tell the model, should you get a request that necessitates the need for data, go ahead and get it from the vector store." Furthermore, he demonstrates extending AI capabilities with tools, such as scheduling dog adoption appointments, emphasizing the importance of descriptive schemas.
Future Directions and Interoperability
As the session concludes, Long discusses exporting business logic as an MCP (Model Context Protocol) service, highlighting Spring AI's MCP SDK and native support for MCP-based integration. This positions Spring AI as a seamless solution for Java-based MCP service development. Long encourages developers to experiment with Spring AI and hints at future possibilities like agentic programming for more complex workflows.
About The Speaker
Josh Long
Spring Developer Advocate, Broadcom
Josh (@starbuxman) has been the first Spring Developer Advocate since 2010. Josh is a Java Champion, author of 7 books (including "Reactive Spring") and numerous best-selling video training (including "Building Microservices with Spring Boot Livelessons" with Spring Boot co-founder Phil Webb), and an open-source contributor (Spring Boot, Spring Integration, Axon, Spring Cloud, Activiti, Vaadin, etc), a Youtuber (Coffee + Software with Josh Long as well as my Spring Tips series ), and a podcaster ("A Bootiful Podcast").
THE WEEKLY DIGEST
Subscribe
Sign up to be notified when we post.
Subscribe