Thymeleaf Layouts using Fragment Expressions in Spring Boot GraalVM Native Image

Thymeleaf Layouts using Fragment Expressions in Spring Boot GraalVM Native Image

Typically, in Spring Boot + Thyemleaf applications, we use thymeleaf-layout-dialect to define the common layout of the web pages and it works fine. But when we compile the Spring Boot application to GraalVM native image, it is failing due to this error. I tried many suggestions mentioned in the above issue, but none of them worked for me. Then Oliver Drotbohm suggested me Flexible layouts approach to create layouts support natively provided by Thymeleaf itself.

Continue reading »
Spring AI RAG using Embedding Models and Vector Databases

Spring AI RAG using Embedding Models and Vector Databases

In this article, we will explore the following: Introduction to Embedding Models. Loading data using DocumentReaders. Storing embeddings in VectorStores. Implementing RAG (Retrieval-Augmented Generation), a.k.a. Prompt Stuffing. Sample Code Repository You can find the sample code for this article in the GitHub repository Large Language Models(LLMs) like OpenAI, Azure Open AI, Google Vertex, etc are trained on large datasets. But those models are not trained on your private data, so they may not be able to answer questions specific to your domain.

Continue reading »
Getting Started with Spring AI and Open AI

Getting Started with Spring AI and Open AI

In this article, we will explore the following: Introduction to Spring AI. Interacting with Open AI using Spring AI. Using PromptTemplates. Using OutputConverters. Sample Code Repository You can find the sample code for this article in the GitHub repository Introduction to Open AI and Spring AI ChatGPT took the world by storm when it was released by OpenAI. It was the first time that a language model was able to generate human-like responses to prompts.

Continue reading »
LangChain4j Retrieval-Augmented Generation (RAG) Tutorial

LangChain4j Retrieval-Augmented Generation (RAG) Tutorial

In this article, we will explore the following: Understand the need for Retrieval-Augmented Generation (RAG). Understand EmbeddingModel, EmbeddingStore, DocumentLoaders, EmbeddingStoreIngestor. Working with different EmbeddingModels and EmbeddingStores. Ingesting data into EmbeddingStore. Querying LLMs with data from EmbeddingStore. Sample Code Repository You can find the sample code for this article in the GitHub repository LangChain4j Tutorial Series You can check out the other articles in this series: Part 1: Getting Started with Generative AI using Java, LangChain4j, OpenAI and Ollama Part 2: Generative AI Conversations using LangChain4j ChatMemory Part 3: LangChain4j AiServices Tutorial Part 4: LangChain4j Retrieval-Augmented Generation (RAG) Tutorial Understand the need for Retrieval-Augmented Generation (RAG) In the previous articles, we have seen how to ask questions and get responses from the AI models.

Continue reading »
LangChain4j AiServices Tutorial

LangChain4j AiServices Tutorial

In this article, we will explore the following: Using LangChain4j AiServices to interact with LLMs. How to ask questions and map responses to different formats? Summarizing the given text in different formats. Analyzing the sentiment of the given text. Sample Code Repository You can find the sample code for this article in the GitHub repository In the previous article, we have seen how to have a conversation using LangChain4j ChatMemory and ConversationalChain.

Continue reading »
Generative AI Conversations using LangChain4j ChatMemory

Generative AI Conversations using LangChain4j ChatMemory

In this article, we will explore the following: How to use LangChain4j ChatMemory and ConversationalChain to implement conversation style interaction? How to ask questions using PromptTemplate? In the previous article, we have seen how to interact with OpenAI using Java and LangChain4j. LangChain4j Tutorial Series You can check out the other articles in this series: Part 1: Getting Started with Generative AI using Java, LangChain4j, OpenAI and Ollama Part 2: Generative AI Conversations using LangChain4j ChatMemory Part 3: LangChain4j AiServices Tutorial Part 4: LangChain4j Retrieval-Augmented Generation (RAG) Tutorial Sample Code Repository

Continue reading »
Getting Started with Generative AI using Java, LangChain4j, OpenAI and Ollama

Getting Started with Generative AI using Java, LangChain4j, OpenAI and Ollama

In this article, we will explore the following: Brief introduction to Generative AI? How to interact with Open AI APIs using Java? How to use LangChain4j to interact with OpenAI? How to run a LLM model locally using Ollama? Working with Ollama using LangChain4j and Testcontainers. LangChain4j Tutorial Series You can check out the other articles in this series: Part 1: Getting Started with Generative AI using Java, LangChain4j, OpenAI and Ollama Part 2: Generative AI Conversations using LangChain4j ChatMemory Part 3: LangChain4j AiServices Tutorial Part 4: LangChain4j Retrieval-Augmented Generation (RAG) Tutorial Introduction to Generative AI Unless you are living under a rock, you might have heard about Generative AI.

Continue reading »
Should I use a framework or libraries?

Should I use a framework or libraries?

In the software development world, trends come and go, and often we go through the same cycle again and again. It seems 2024 is the year of “Framework vs Libraries” debate. I mean this debate is not new, but it is getting louder again. For example, most of the Go community prefers to use libraries instead of a framework. The Java community is divided into two groups, one prefers to use Spring Boot or Quarkus or Micronaut, and the other prefers to use libraries.

Continue reading »
Its time to apply KISS principle to career

Its time to apply KISS principle to career

You might have heard from IT employees that there is no work-life balance in IT due to unrealistic deadlines, long working hours, etc. I did work crazy hours in the first 7 or 8 years of my career, but not anymore. Fortunately, I have been working in the companies that value work-life balance, and I never had to work beyond 8 hours in the recent past. However, I have been working on writing blogs, making videos, etc.

Continue reading »
Go for Java/SpringBoot Developers

Go for Java/SpringBoot Developers

I have been using Java for more than 17 years, and I really like Java and its ecosystem. Within the Java ecosystem, Spring Boot is my go-to framework for building applications. I used the Go language for an official project a couple of years ago, and initially I had mixed feelings about it. But the more I use it, the more I like it. I wanted to expand my skill set and decided to get more hands-on experience with Go.

Continue reading »