RAG in Java with LangChain4j: Teaching a Local LLM About a Company That Doesn’t Exist

Chunks, vectors, a bit of geometry, and no magic. Everything runs on your laptop. Ask an LLM “When does the nightly settlement batch run at Harbourline Payments?” and one of two things happens. The polite model says it doesn’t know. The confident model says “Usually around midnight!” with the energy of a student who didn’t read the book but really wants a good mark. Both are fair, because Harbourline Payments doesn’t exist. I made it up. It’s a fictional company with a fictional engineering handbook: founders, services, deploy rules, on-call pay, and even a famous incident called “the Double Tap”. No model has seen this text during training. ...

October 17, 2026 · 12 min · Vitalii Sukach

Building an MCP Server in Java with Spring AI: Let Claude Code Use Your Database Without Seeing a Password

Four annotated methods, one security config, and no JSON-RPC code of your own. In my previous article I built an MCP server from scratch in Python. I wrote the JSON-RPC 2.0 message handling, declared tool schemas by hand and wired up the STDIO transport myself. It’s a good way to learn how the protocol works on the wire. Python isn’t the only option, though. Most of the systems I work on are Java and Spring, and that’s where the data lives. So this time I built the same kind of server in Java. ...

September 25, 2026 · 10 min · Vitalii Sukach

The Java Memory Model, Explained Without the Headache

What actually happens to your data between two threads — and the small set of tools that let you control it Ask ten Java developers what “the Java Memory Model” means and you’ll get two different answers. Half of them will draw a box called Heap and another called Stack. The other half will start talking about volatile and happens-before. Both groups are talking about something real, but only the second group is talking about the actual Java Memory Model (JMM). The first group is describing the runtime data areas — where objects physically live. ...

September 3, 2026 · 9 min · Vitalii Sukach

DateTime Handling in Java and PostgreSQL: A Practical Guide

Everything I wish someone had told me before I stored a meeting time in a timestamp column. There is a specific kind of bug that only shows up in production, only in October, and only for users in one country. It gets closed as “not reproducible” twice before someone finally sits down with a coffee and reads the column definition. It is almost always a datetime bug. The frustrating part is that both Java and PostgreSQL have excellent date/time support. java.time is one of the best-designed APIs in the JDK. PostgreSQL’s temporal types are precise and well documented. The bugs happen at the seam — in the assumptions each side makes about what the other means, and in the two or three words in the type names that mean the opposite of what you’d guess. ...

August 15, 2026 · 16 min · Vitalii Sukach

From Source to Running JVM: How Gradle Builds Your Java Application

Build phases, task graphs, dependency resolution, and what actually happens when the JVM opens your JAR You type gradle build, wait a few seconds, and out comes a JAR. Most Java developers use this pipeline every day without ever looking inside it. But when a build gets slow, a dependency conflict appears, or a NoClassDefFoundError shows up in production at 2 AM, understanding the machinery underneath is the difference between guessing and fixing. ...

July 19, 2026 · 8 min · Vitalii Sukach