❯ Guillaume Laforge

Java

An ADK Java agent powered by Gemma 4

Today, DeepMind announced the release of Gemma 4, a very impressive and powerful new version of the Gemma family of models. As I’ve been contributing to ADK Java a fair bit recently, I was curious to see how I would configure ADK Java agents to work with Gemma 4.

In this article, we’ll explore 3 paths:

  • Calling the AI Studio API surface directly,
  • Calling Gemma 4 hosted via a vLLM instance thanks to the LangChain4j bridge.
  • Calling Gemma 4 locally via Ollama

With the appropriate model weights format, we’ll also be able to run Gemma 4 locally via Ollama. But that’s for another day.

Read more...

Creating a Wikipedia MCP Server in Java in a Few Prompts with Skills

Since I started using Model Context Protocol (MCP) to equip my AI agents with useful tools, I’ve been looking for ways to quickly build and iterate on local servers. A few weeks ago, I shared how to easily build a local MCP server in Java with a custom skill in Gemini CLI. Today, I wanted to put that skill to the test by creating a Wikipedia MCP server.

What’s impressive is that I didn’t even have to leave my terminal or read documentation. The entire process was a conversation with Gemini CLI, leveraging its ability to search the web, find libraries, and even check migration guides!

Read more...

Building my Comic Trip agent with ADK Java 1.0

I’m happy to echo here the release of ADK for Java v1.0, Google’s Agent Development Kit framework to build AI agents in Java. I spent a lot of time on this project. I also wrote the announcement blog post on the Google for Developers blog. And I’ve recorded this YouTube video highlighting some of the new features of the framework, in which I’m demonstrating some of them via an app I built: my Comic Trip agent (pun intended).

Read more...

Generating music with Lyria 3 and the Gemini Interactions Java SDK

Generative AI isn’t just about text or images (with Nano Banana) but it’s also great at generating videos (with Veo 3). And now with the recently released Lyria 3 model from DeepMind, you can create some engaging and creative music with lyrics (generated, or your own) or invent a calming instrumental track to loop in the background of your online TikTok or YouTube Shorts.

And of course, if you’re a Java developer like me, you can do all that in Java!

Read more...

Extracting JSON from LLM chatter with JsonSpotter

LLMs are great at generating structured data, in particularly those which support a strict JSON output mode (sometimes also called structured decoding), but sometimes they give you a bit more than the requested JSON. You get a Markdown code block wrapped in “Here’s the data you asked for:” and “Hope this helps!”. If you’re lucky, the JSON is valid. If you’re not, it has trailing commas or comments that break standard parsers.

Read more...

Easily Build a Local MCP Server in Java with a Skill inside Gemini CLI

Recently, I’ve been exploring the Model Context Protocol (MCP) and how to easily create custom servers to extend the capabilities of AI assistants like Gemini CLI which I use daily.

I wanted a way to build these servers in Java without the heavy boilerplate of a traditional Maven or Gradle project, or with a complex framework. The solution? Combining JBang, LangChain4j, and… 🥁… a custom Gemini CLI skill!

In this post, I’ll walk you through how I streamlined the creation of MCP STDIO servers, by creating an agent SKILL.md to replicate what I had learned in my previous article.

Read more...

Zero Boilerplate Java STDIO MCP Servers with LangChain4j and JBang

By now, you’re certainly all familiar with the Model Context Protocol (MCP)? It’s the standard for connecting Large Language Models (LLMs) to tools and data. But if you look at the current ecosystem, you’ll see a lot of Python and TypeScript…

As a Java developer, you might be wondering: How can I easily and quickly run my own MCP servers?

On this blog, I’ve explained how to develop MCP servers with Quarkus and Micronaut. But thanks to a recent community contribution to LangChain4j, and the simplicity of JBang, building a local MCP server in Java is even easier and with zero boilerplate.

Read more...

Advanced RAG — Understanding Reciprocal Rank Fusion in Hybrid Search

Today, let’s come back to one of my favorite generative AI topics: Retrieval Augmented Generation, or RAG for short.

In RAG, the quality of your generation (when an LLM crafts its answer based on search results) is only as good as your retrieval (the actually retrieved search results).

While vector search (semantic) and keyword search (BM25) each have their strengths, combining them often yields the best results. That’s what we often call Hybrid Search: combining two search techniques or the results of different searches with slight variations.

Read more...

A Javelit Frontend for the Deep Research Agent

A month ago, I wrote about building a research assistant in Java, using the Gemini Interactions API, and the Deep Research agent. Today I wanted to revisit this project, but with the goal to make it more user-friendly, with a Javelit based frontend.

The Research Pipeline: From Query to Infographic

  • First, the user enters the subject of the research.
  • A button action triggers the research of possible topics about that subject (ie. the different possible facets or angles of the subject), using Gemini 3 Flash with Google Search activated.
  • The user selects the facets they’re interested in, to restrict the research to only those aspects.
  • Then the Deep Research agent kicks in, via the Gemini Interactions API, and spends a few minutes researching the topic.
  • Once the final report is ready, Gemini 3 Pro creates a solid summary.
  • The summary is used to generate a sketchnote with Nano Banana Pro.

A Look at the User Interface

Let’s say, as a user, I want to research information about the OpenClaw / MoltBot / ClawdBot personal AI assistant (unless it has again changed its name? 😃)

Read more...

Implementing an arXiv MCP Server with Quarkus in Java

For my recent presentation at SnowCamp on AI Standards & Protocols for AI Agents, I decided to build an MCP server to access the arXiv research paper website where pre-print versions are published and shared with the community.

My goal was to shed light on some lesser-known aspects of the Model Context Protocol:

  • 🛠️ While the majority of MCP servers use the tools feature to expose actions that LLMs can request to call,
  • 📄 An MCP server can also share resources (and resource templates), exposing various static assets the AI app might be interested in,
  • ✏️ And prompts (and prompt templates) that users can access and reuse to utilize the MCP server effectively.
Info

For the impatient, feel free to go straight to the GitHub repository for the full source code. The README.md file gives instructions on how to build, run, configure, and use the server.

Read more...