{"id":30931,"date":"2025-04-28T05:00:00","date_gmt":"2025-04-28T03:00:00","guid":{"rendered":"https:\/\/sii.pl\/blog\/?p=30931"},"modified":"2025-04-24T13:32:52","modified_gmt":"2025-04-24T11:32:52","slug":"artificial-intelligence-in-the-spring-boot-ecosystem","status":"publish","type":"post","link":"https:\/\/sii.pl\/blog\/en\/artificial-intelligence-in-the-spring-boot-ecosystem\/","title":{"rendered":"Artificial Intelligence in the Spring Boot ecosystem"},"content":{"rendered":"\n<p>Artificial intelligence transforms how we build applications, offering new personalization, automation, and data analysis possibilities. Specifically, models like OpenAI&#8217;s GPT-4o are revolutionizing natural language processing (NLP), enabling the creation of intelligent systems for conversations, text analysis, and content generation.<\/p>\n\n\n\n<p>This article aims to answer the following questions:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>How can a Spring-based application be easily and scalably integrated with AI?<\/li>\n\n\n\n<li>Are popular LLMs just glorified internet search engines?<\/li>\n\n\n\n<li>What is Spring Functions, and can a bean be&#8230; a function?<\/li>\n\n\n\n<li>What is prompt enrichment?<\/li>\n<\/ul>\n\n\n\n<p>If you don\u2019t have answers to even one of these questions, you are warmly invited to explore this article.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><strong>AI integration with applications<\/strong><\/strong><\/h2>\n\n\n\n<p>As a foundation for modern applications, the Spring Boot ecosystem becomes an ideal platform for integrating such models. Before diving deeper, however, let&#8217;s take a broader look at the current use of AI.<\/p>\n\n\n\n<p>Popular models like GPT-4o are primarily accessed through graphical interfaces, such as ChatGPT. Users visit a website and type a query in a text box, and the model returns an answer in a chat window. This simple and intuitive approach has revolutionized human-technology interaction.<\/p>\n\n\n\n<p>However, when designing more complex applications where an AI model becomes a core part of the system&#8217;s architecture and functions as an integral part of the backend, communication with the model must occur programmatically. While the graphical interface is a convenient starting point, it doesn&#8217;t support direct integration with microservices, REST APIs, or cloud infrastructure. In other words, <strong>automation, scalability, and seamless system integration are essential in the software world.<\/strong><\/p>\n\n\n\n<p>This brings us to the key topic \u2013 AI integration with applications. With such integration, we can build applications that, among other things:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>handle real-time customer queries (popular chatbots embedded in client domains),<\/li>\n\n\n\n<li>analyze documents or customer reviews, automatically generating summaries or reports,<\/li>\n\n\n\n<li>intelligently process batch data, analyzing hundreds or thousands of documents for trends at speeds unattainable by humans,<\/li>\n\n\n\n<li>enrich communication with the model by augmenting prompts with additional data sources such as REST APIs, databases, or message queues,<\/li>\n\n\n\n<li>analyze IoT data streams in real-time to trigger alerts based on unusual patterns.<\/li>\n<\/ul>\n\n\n\n<p>The key takeaway is that <strong>integrating AI with applications is not meant to replace chatbots like ChatGPT <\/strong><strong>\u2013<\/strong><strong> it fulfills different needs<\/strong>. This is not about competition but rather about <strong>complementary synergy.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong><strong>Demonstration scenario<\/strong><\/strong><\/h2>\n\n\n\n<p>Having laid the groundwork for how AI interacts with applications, let\u2019s examine a demonstration of such integration. The scenario involves a user seeking <strong>recommendations for the latest<\/strong> science fiction books. To make the interaction as seamless as possible, the system allows the user to submit the query as an audio recording, creating an almost conversational experience with the application.<\/p>\n\n\n\n<p>Our task is to receive the audio recording, extract the query (prompt) from it, query the AI model, and then return the response to the user. What might initially seem trivial becomes more challenging once we understand how LLMs work.<\/p>\n\n\n\n<p>Specifically, the model has no internet access \u2013 it relies on a pre-trained dataset it was built on. Querying it for the latest science fiction books is therefore doomed to fail, as shown below:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/sii.pl\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image1-2.png&quot;,&quot;figureClassNames&quot;:&quot;wp-block-image aligncenter size-large&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-30912&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:1685,&quot;targetHeight&quot;:773,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image: Asking the model about science fiction books&quot;,&quot;alt&quot;:&quot;Asking the model about science fiction books&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"470\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image1-2-1024x470.png\" alt=\"Asking the model about science fiction books\" class=\"wp-image-30912\" srcset=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image1-2-1024x470.png 1024w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image1-2-300x138.png 300w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image1-2-768x352.png 768w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image1-2-1536x705.png 1536w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image1-2.png 1685w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image: Asking the model about science fiction books\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Fig. 1 Asking the model about science fiction books<\/figcaption><\/figure>\n\n\n\n<p>This is a fundamental limitation stemming from the model&#8217;s architecture and training. Put simply, <strong>LLMs do not function as internet search engines.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>GPT-4o as an example<\/strong><\/h3>\n\n\n\n<p>GPT-4o is a statistical model trained on a massive dataset up to a specific point in the past. After training, the model is &#8220;frozen&#8221;\u2014it does not dynamically learn new data in real time or retrieve information independently. Unlike search engines or dynamic applications, it cannot communicate with external information sources during runtime.<\/p>\n\n\n\n<p>This limitation, however, is intentional. It ensures better control over the model\u2019s functionality, as the training process is supervised. Interestingly, this design choice is not to prevent the model from becoming an omnipotent sci-fi-like entity but rather to maintain the high quality of its carefully curated training dataset. Allowing it to access the open internet would expose it to low-quality, unstructured data. Additionally, privacy and performance considerations further justify the model\u2019s lack of internet access.<\/p>\n\n\n\n<p>Thus, when designing systems that rely on real-time data, we must employ a technique called &#8220;prompt enrichment,&#8221; which augments the prompt with context that allows the model to infer answers. In our scenario, this means ensuring access to a reliable data source for the latest sci-fi books and incorporating that data into the prompt.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Implementation<\/strong><\/h2>\n\n\n\n<p>The task described earlier is solved by the architecture shown below:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/sii.pl\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image2-2.png&quot;,&quot;figureClassNames&quot;:&quot;wp-block-image aligncenter size-large&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-30914&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:1173,&quot;targetHeight&quot;:892,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image: Architecture&quot;,&quot;alt&quot;:&quot;Architecture&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"779\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image2-2-1024x779.png\" alt=\"Architecture\" class=\"wp-image-30914\" srcset=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image2-2-1024x779.png 1024w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image2-2-300x228.png 300w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image2-2-768x584.png 768w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image2-2.png 1173w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image: Architecture\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Fig. 2 Architecture<\/figcaption><\/figure>\n\n\n\n<p>By leveraging the abstraction layer provided by the TranscriptService and ReasoningService interfaces, we ensure that the application&#8217;s domain logic remains decoupled from a specific model, which here is treated as just an implementation of the problem-solving mechanism we are interested in.<\/p>\n\n\n\n<p>In the above scenario, the responsibility for extracting text from an audio file is delegated to AssemblyAI, a solution specialized in this task. Additionally, this choice was made because of their attractive API usage plans. By diversifying responsibilities this way, we can save on using more resource-intensive models. Resources allocated to GPT integration are focused solely on reasoning and analyzing prompts. Moreover, it is particularly important to consider the costs generated by using these models.<\/p>\n\n\n\n<p>For the functionality of retrieving information about sci-fi books, Google Books API and Spring Functions were utilized. <strong>Spring Functions<\/strong> is part of the Spring ecosystem, allowing the creation of lightweight, reusable functions designed to perform a single, clearly defined task while encapsulating all the logic needed for its execution.<\/p>\n\n\n\n<p>What\u2019s particularly interesting is that <strong>these functions are registered as beans<\/strong>, enabling their reuse in multiple application parts. This approach is further enhanced by Spring Cloud, which supports highly efficient serverless solutions, such as those deployed with AWS Lambda.<\/p>\n\n\n\n<p>In our scenario, Spring also supports leveraging these functions by registering them within the prompt we are constructing as follows:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/sii.pl\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image3-2.png&quot;,&quot;figureClassNames&quot;:&quot;wp-block-image aligncenter size-full&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-30916&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:552,&quot;targetHeight&quot;:297,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image: Prompt registering &quot;,&quot;alt&quot;:&quot;Prompt registering &quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"552\" height=\"297\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image3-2.png\" alt=\"Prompt registering \" class=\"wp-image-30916\" srcset=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image3-2.png 552w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image3-2-300x161.png 300w\" sizes=\"(max-width: 552px) 100vw, 552px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image: Prompt registering \"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Fig. 3 Prompt registering<\/figcaption><\/figure>\n\n\n\n<p>where &#8220;fetchBooks&#8221; is the name of our function and looks as follows:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/sii.pl\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image4-1.png&quot;,&quot;figureClassNames&quot;:&quot;wp-block-image aligncenter size-full&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-30918&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:1021,&quot;targetHeight&quot;:142,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image: \\u0022fetchBooks\\u0022 function &quot;,&quot;alt&quot;:&quot;\\u0022fetchBooks\\u0022 function &quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"1021\" height=\"142\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image4-1.png\" alt=\"&quot;fetchBooks&quot; function \" class=\"wp-image-30918\" srcset=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image4-1.png 1021w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image4-1-300x42.png 300w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image4-1-768x107.png 768w\" sizes=\"(max-width: 1021px) 100vw, 1021px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image: &quot;fetchBooks&quot; function \"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Fig. 4 &#8220;fetchBooks&#8221; function<\/figcaption><\/figure>\n\n\n\n<p>I encourage you to explore and analyze <a href=\"https:\/\/github.com\/BartDro\/SpringAi\" target=\"_blank\" rel=\"noopener\" title=\"\" rel=\"nofollow\" >the full code in the dedicated repository.<\/a><\/p>\n\n\n\n<p>Once this architecture is implemented, we can query the system based on the scenario we&#8217;ve outlined by sending a request to the following endpoint:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/sii.pl\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image5-1.png&quot;,&quot;figureClassNames&quot;:&quot;wp-block-image aligncenter size-full&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-30920&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:717,&quot;targetHeight&quot;:287,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image: Sending a request to the endpoint&quot;,&quot;alt&quot;:&quot;Sending a request to the endpoint&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-full wp-lightbox-container\"><img decoding=\"async\" width=\"717\" height=\"287\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image5-1.png\" alt=\"Sending a request to the endpoint\" class=\"wp-image-30920\" srcset=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image5-1.png 717w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image5-1-300x120.png 300w\" sizes=\"(max-width: 717px) 100vw, 717px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image: Sending a request to the endpoint\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Fig. 5 Sending a request to the endpoint<\/figcaption><\/figure>\n\n\n\n<p>this will result in the following response:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;uploadedSrc&quot;:&quot;https:\\\/\\\/sii.pl\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/04\\\/image6-1.png&quot;,&quot;figureClassNames&quot;:&quot;wp-block-image aligncenter size-large&quot;,&quot;figureStyles&quot;:null,&quot;imgClassNames&quot;:&quot;wp-image-30922&quot;,&quot;imgStyles&quot;:null,&quot;targetWidth&quot;:1436,&quot;targetHeight&quot;:897,&quot;scaleAttr&quot;:false,&quot;ariaLabel&quot;:&quot;Enlarge image: Odpowied\\u017a&quot;,&quot;alt&quot;:&quot;Odpowied\\u017a&quot;}\" data-wp-interactive=\"core\/image\" class=\"wp-block-image aligncenter size-large wp-lightbox-container\"><img decoding=\"async\" width=\"1024\" height=\"640\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on-async--click=\"actions.showLightbox\" data-wp-on-async--load=\"callbacks.setButtonStyles\" data-wp-on-async-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image6-1-1024x640.png\" alt=\"Odpowied\u017a\" class=\"wp-image-30922\" srcset=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image6-1-1024x640.png 1024w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image6-1-300x187.png 300w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image6-1-768x480.png 768w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/image6-1.png 1436w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge image: Odpowied\u017a\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on-async--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"context.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"context.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><figcaption class=\"wp-element-caption\">Fig. 6 Response<\/figcaption><\/figure>\n\n\n\n<p>Evidently, the publication dates are beyond the model&#8217;s last update date, and the included URLs point to a Google domain. This demonstrates that the model provided a contextually enhanced prompt, enabling it to analyze the information and provide a well-informed response.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><a href=\"https:\/\/sii.pl\/en\/job-ads\/\" target=\"_blank\" rel=\"noreferrer noopener\"><img decoding=\"async\" width=\"737\" height=\"170\" src=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/praca-EN-k-4.jpg\" alt=\"job offert\" class=\"wp-image-30933\" srcset=\"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/praca-EN-k-4.jpg 737w, https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/praca-EN-k-4-300x69.jpg 300w\" sizes=\"(max-width: 737px) 100vw, 737px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>While exploring the possibilities of integrating artificial intelligence with Spring Boot-based applications, we demonstrated how language models like GPT-4o can be enriched with external data sources to overcome their inherent limitations.<\/p>\n\n\n\n<p>The key takeaway is understanding that models like GPT-4o lack native internet access due to their architecture and design constraints. In our scenario, where a user seeks recommendations for the latest science fiction books via an audio query, the challenge was the absence of up-to-date data. <strong>The solution involved leveraging &#8220;prompt enrichment,&#8221;<\/strong> where data from the Google Books API was incorporated into the prompt, enabling the model to generate a response based on current information.<\/p>\n\n\n\n<p>This example highlights how Spring Boot and its ecosystem support the development of modern applications that are flexible, scalable, and tailored to dynamic user needs. Implementing such an architecture allows us to build systems capable of processing complex data, performing real-time analysis, and interacting with diverse data sources. As a result, users can experience smarter and more personalized applications that truly address their needs.<\/p>\n\n\n\n<p><strong>This example is evidence that well-designed integration between AI and Spring Boot can deliver tangible value by combining the strengths of AI models with the robustness of proven backend tools<\/strong>. It\u2019s an ideal approach for creating applications suited to today\u2019s technological challenges.<\/p>\n\n\n\n<p>It\u2019s important to remember that such systems are not intended to replace humans but to support them, enabling focus on more meaningful tasks. <strong>This approach brings AI and backend technology together in harmony<\/strong>, delivering solutions that meet real user needs while simplifying the work of developers. This is the beginning of a new era where technology, data, and intelligence work together more naturally than ever before. How we use this potential and the practical solutions we build will define the future.<\/p>\n\n\n\n<p>***<\/p>\n\n\n\n<p>If you&#8217;re interested in AI, be sure to also <a href=\"https:\/\/sii.pl\/blog\/en\/all\/ai-en\/\" target=\"_blank\" rel=\"noopener\" title=\"\">check out other articles by our experts<\/a>.<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-left kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;left&quot;,&quot;id&quot;:&quot;30931&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;1&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;11&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;5\\\/5 ( vote: 1)&quot;,&quot;size&quot;:&quot;18&quot;,&quot;title&quot;:&quot;Artificial Intelligence in the Spring Boot ecosystem&quot;,&quot;width&quot;:&quot;139.5&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} ( {votes}: {count})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 139.5px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 11px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 18px; height: 18px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 14.4px;\">\n            5\/5 ( vote: 1)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Artificial intelligence transforms how we build applications, offering new personalization, automation, and data analysis possibilities. Specifically, models like OpenAI&#8217;s GPT-4o &hellip; <a class=\"continued-btn\" href=\"https:\/\/sii.pl\/blog\/en\/artificial-intelligence-in-the-spring-boot-ecosystem\/\">Continued<\/a><\/p>\n","protected":false},"author":601,"featured_media":30927,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","inline_featured_image":false,"footnotes":""},"categories":[1320],"tags":[2814,1631,1590,1526,1442],"class_list":["post-30931","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hard-development","tag-spring-en","tag-chatgpt-en","tag-tools","tag-guidebook","tag-ai-en"],"acf":[],"aioseo_notices":[],"republish_history":[],"featured_media_url":"https:\/\/sii.pl\/blog\/wp-content\/uploads\/2025\/04\/AI_2.jpg","category_names":["Hard development"],"_links":{"self":[{"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/posts\/30931"}],"collection":[{"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/users\/601"}],"replies":[{"embeddable":true,"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/comments?post=30931"}],"version-history":[{"count":1,"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/posts\/30931\/revisions"}],"predecessor-version":[{"id":30935,"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/posts\/30931\/revisions\/30935"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/media\/30927"}],"wp:attachment":[{"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/media?parent=30931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/categories?post=30931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sii.pl\/blog\/en\/wp-json\/wp\/v2\/tags?post=30931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}