Skip to content

Instantly share code, notes, and snippets.

View glaforge's full-sized avatar

Guillaume Laforge glaforge

View GitHub Profile
@glaforge
glaforge / index.html
Created February 8, 2026 16:10
Reciprocal Rank Fusion Simulator (SPA)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Reciprocal Rank Fusion Simulator</title>
<script>
// Avoids a flash of the wrong theme.
if (localStorage.getItem('theme') === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark')
@glaforge
glaforge / README.md
Last active January 15, 2026 10:04
A2A / MCP GitHub repository links
@glaforge
glaforge / MoonExpert.java
Created September 28, 2025 16:59
ADK class invoking the MoonPhases MCP server implemented with Micronaut, using the Streamable HTTP transport
import com.google.adk.agents.BaseAgent;
import com.google.adk.agents.LlmAgent;
import com.google.adk.tools.BaseTool;
import com.google.adk.tools.mcp.McpToolset;
import com.google.adk.tools.mcp.SseServerParameters;
import com.google.adk.tools.mcp.StreamableHttpServerParameters;
import com.google.adk.web.AdkWebServer;
import java.util.List;
## Google: Market Research Report (Q2 2025)
Executive Summary:
This report provides an overview of Google, its recent performance,
and current market position. Google, a subsidiary of Alphabet Inc.,
continues to be a dominant force in the technology industry, driven
by its core search engine, cloud services, and advancements in
artificial intelligence. Recent financial results for Q2 2025
exceeded expectations, demonstrating strong growth across key
@glaforge
glaforge / SequentialFlow.java
Created July 28, 2025 14:49
SequentialFlow.java class illustrating ADK AI agent sequential flows in Java
var companyProfiler = LlmAgent.builder()
.name("company-profiler")
.description(
"Provides a general overview of a company.")
.instruction("""
Your role is to provide a brief overview of the
given company.
Include its mission, headquarters, and current CEO.
Use the Google Search Tool to find this information.
""")
@glaforge
glaforge / ScienceTeacherAgent.java
Created May 21, 2025 15:49
A science teacher agent written in Java, using ADK (Agent Development Kit)
package agents;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.util.Scanner;
import com.google.adk.agents.BaseAgent;
import com.google.adk.agents.LlmAgent;
import com.google.adk.events.Event;
import com.google.adk.runner.InMemoryRunner;
import com.google.adk.sessions.Session;
@glaforge
glaforge / CustomMcpClient.java
Created April 2, 2025 20:39
Raw MCP client / server example with the MCP JAVA SDK and LangChain4j's MCP client module
import dev.langchain4j.agent.tool.ToolExecutionRequest;
import dev.langchain4j.mcp.McpToolProvider;
import dev.langchain4j.mcp.client.DefaultMcpClient;
import dev.langchain4j.mcp.client.McpClient;
import dev.langchain4j.mcp.client.transport.McpTransport;
import dev.langchain4j.mcp.client.transport.http.HttpMcpTransport;
import dev.langchain4j.model.vertexai.VertexAiGeminiChatModel;
import dev.langchain4j.service.AiServices;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.tool.ToolProvider;
public class SentenceWindowRetrieval {
public static void main(String[] args) throws IOException {
Document capitalDocument = Document.from("...");
VertexAiEmbeddingModel embeddingModel = VertexAiEmbeddingModel.builder()
.project(System.getenv("GCP_PROJECT_ID"))
.endpoint(System.getenv("GCP_VERTEXAI_ENDPOINT"))
.location(System.getenv("GCP_LOCATION"))
.publisher("google")
@glaforge
glaforge / new-store.md
Created February 16, 2025 13:30
Create a new embedding store

Okay, here's a breakdown of how to create a new LangChain4j embedding store module for Google Cloud Firestore, along with the key steps and considerations, mirroring the structure of existing modules like langchain4j-milvus.

Project Structure

Your project structure should follow the established pattern. I'll create a simplified version based on the most relevant parts from the provided file listing. The full structure would be much larger (like the main langchain4j project), but this captures the essentials:

langchain4j/
└── langchain4j-embedding-store-google-firestore/  (or similar name)
    ├── pom.xml                                     (Your module's Maven build file)