惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Securelist
博客园 - Franky
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
量子位
Hugging Face - Blog
Hugging Face - Blog
有赞技术团队
有赞技术团队
V
V2EX
宝玉的分享
宝玉的分享
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
G
Google Developers Blog
B
Blog
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
小众软件
小众软件
博客园 - 【当耐特】
H
Help Net Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
博客园 - 叶小钗
Jina AI
Jina AI
Cloudbric
Cloudbric
N
Netflix TechBlog - Medium
Hacker News - Newest:
Hacker News - Newest: "LLM"
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
I
Intezer
IT之家
IT之家
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hackread – Cybersecurity News, Data Breaches, AI and More
WordPress大学
WordPress大学
W
WeLiveSecurity
G
GRAHAM CLULEY
J
Java Code Geeks
H
Heimdal Security Blog
Cyberwarzone
Cyberwarzone
MyScale Blog
MyScale Blog
Latest news
Latest news
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
Martin Fowler
Martin Fowler
V
Visual Studio Blog
Webroot Blog
Webroot Blog
P
Palo Alto Networks Blog
T
Tor Project blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Top Gen AI Frameworks for Java in 2026: A Hands-On Comparison
Xavier Porti · 2026-05-05 · via DEV Community

Introduction

Java has always been a serious language for production systems, and in 2026, the Generative AI ecosystem has finally caught up. For years, Java developers watched from the sidelines as Python and TypeScript accumulated framework after framework for building LLM-powered applications. Today, the picture is very different. Java has multiple mature, actively maintained AI frameworks, each with its own philosophy and trade-offs.

This article covers the four frameworks I have personally used to ship Java AI applications: Genkit Java, Spring AI, LangChain4j, and Google ADK Java. Each one represents a meaningfully different bet on what a Java AI framework should be, and understanding those differences will save you from picking the wrong tool.


Genkit Java

History and Direction

Genkit started life as a TypeScript-first framework launched by Google at I/O 2024. The Java SDK arrived as a community-maintained effort, built and maintained by developers within the Google ecosystem who wanted to bring the same developer experience to Java that Genkit had established in TypeScript. As of 2026, Genkit Java is unofficial, it is not an official Google product, but it is actively maintained, follows the core Genkit design closely, and ships its own plugin ecosystem.

The framework's first stable release landed in early 2026 after months of preview use. Its ambition mirrors the TypeScript SDK's: bring Genkit's multi-level abstractions (vanilla generation, typed flows, agents), its broad provider-neutral plugin model, and, crucially, the Genkit Developer UI to Java developers. The Java SDK ships with Spring Boot and Jetty server plugins, making it a natural fit for teams that already run Java services in production. The Javadoc and architecture are clean and idiomatic Java, this does not feel like a port; it feels designed for the language.

The direction is clear: maintain parity with the TypeScript Genkit SDK's abstractions while embracing Java idioms (builder patterns, typed schemas via Java classes, annotation-free configuration). Support for evaluation, MCP (Model Context Protocol), RAG with pgvector and Pinecone, and multi-agent patterns is already in place.

What Makes Genkit Java Stand Out

Like its TypeScript counterpart, Genkit Java provides three levels of abstraction in a single SDK: direct model calls, typed flows (observable pipelines), and agents. This is unique in the Java AI space, no other Java framework gives you all three in one coherent API.

Supported languages: Java 21+ (primary). Deploys to Spring Boot, Jetty, or Firebase Cloud Functions.

Vanilla Generation

import com.google.genkit.Genkit;
import com.google.genkit.ai.GenerateOptions;
import com.google.genkit.plugins.googlegenai.GoogleGenAIPlugin;

Genkit genkit = Genkit.builder()
    .plugin(GoogleGenAIPlugin.create())
    .build();

String text = genkit.generate(GenerateOptions.builder()
    .model("googleai/gemini-flash-latest")
    .prompt("Explain the CAP theorem in two sentences.")
    .build()).getText();

System.out.println(text);

Enter fullscreen mode Exit fullscreen mode

Typed Flows — Observable Pipelines

Flows are the heart of Genkit Java. They wrap your AI logic in a named, typed, traceable unit that is automatically exposed as an HTTP endpoint and visible in the Dev UI.

import com.google.genkit.Genkit;
import com.google.genkit.flow.FlowOptions;
import com.google.genkit.plugins.googlegenai.GoogleGenAIPlugin;
import com.google.genkit.plugins.jetty.JettyPlugin;
import com.google.genkit.plugins.jetty.JettyPluginOptions;

record TranslateRequest(String text, String targetLanguage) {}
record TranslateResponse(String translation, String detectedLanguage) {}

JettyPlugin jetty = new JettyPlugin(JettyPluginOptions.builder().port(8080).build());

Genkit genkit = Genkit.builder()
    .plugin(GoogleGenAIPlugin.create())
    .plugin(jetty)
    .build();

genkit.defineFlow(
    FlowOptions.<TranslateRequest, TranslateResponse>builder()
        .name("translateText")
        .inputClass(TranslateRequest.class)
        .outputClass(TranslateResponse.class)
        .build(),
    (ctx, request) -> {
        var response = genkit.generate(GenerateOptions.builder()
            .model("googleai/gemini-flash-latest")
            .prompt("Translate '%s' to %s. Return JSON with 'translation' and 'detectedLanguage'."
                .formatted(request.text(), request.targetLanguage()))
            .outputClass(TranslateResponse.class)
            .build());
        return response.getOutput(TranslateResponse.class);
    }
);

jetty.start();

Enter fullscreen mode Exit fullscreen mode

Tools and Agents

import com.google.genkit.ai.tool.ToolDefinition;

var weatherTool = genkit.defineTool(
    ToolDefinition.<String, String>builder()
        .name("getWeather")
        .description("Returns current weather for a city.")
        .inputClass(String.class)
        .outputClass(String.class)
        .build(),
    (ctx, city) -> "Sunny, 24°C in " + city
);

// Use the tool inside a flow or agent
var result = genkit.generate(GenerateOptions.builder()
    .model("googleai/gemini-flash-latest")
    .prompt("What's the weather like in Tokyo?")
    .tools(List.of(weatherTool))
    .build());

Enter fullscreen mode Exit fullscreen mode

The Dev UI — Same Power as TypeScript

One of Genkit Java's most compelling features is that the same Genkit Developer UI used by the TypeScript SDK works directly with Java applications. You install the Genkit CLI (Node.js-based) and start your Java app through it:

npm install -g genkit
genkit start -- mvn exec:java

Enter fullscreen mode Exit fullscreen mode

The Dev UI opens at http://localhost:4000 and gives you:

  • Flow runner — execute any flow interactively with custom inputs and inspect typed outputs.
  • Trace explorer — full OpenTelemetry traces for every generate and flow call, showing latency, token counts, and exact prompts.
  • Model playground — test any registered model directly.
  • Tool testing — stub and test tools in isolation.
  • Dotprompt editor — edit .prompt files live with variable injection.

This is the single biggest advantage Genkit Java has over every other Java AI framework: a zero-config, local developer UI that replaces the need for LangSmith or Grafana during development.

Provider Support

Genkit Java ships plugins for: Google GenAI (Gemini), OpenAI, Anthropic (Claude), AWS Bedrock, Azure AI Foundry, Ollama, xAI (Grok), DeepSeek, Cohere, Mistral, and Groq. All accessed through the same genkit.generate() interface.

Vector store plugins cover: Firebase Firestore, Weaviate, PostgreSQL (pgvector), Pinecone, and a local in-memory store.

Pros and Cons

✅ Pros ❌ Cons
Best-in-class Dev UI with local trace explorer Unofficial/community-maintained (not a Google product)
Multi-level abstractions: vanilla, flows, agents Artifacts on GitHub Packages (requires auth to pull)
Broadest provider support in Java ecosystem Java 21+ required
Spring Boot and Jetty deployment plugins Smaller community than LangChain4j or Spring AI
OpenTelemetry built in Still SNAPSHOT versioned (1.0.0-SNAPSHOT)
Idiomatic Java with builder patterns

Spring AI

History and Direction

Spring AI was announced by the Spring team (Broadcom) in mid-2023 and reached its 1.0 GA release in mid-2024. It is the most enterprise-grade option in this comparison, built by the same team that maintains Spring Framework, Spring Boot, and Spring Data, which together underpin a vast proportion of the world's Java server-side applications.

The founding premise of Spring AI is that AI integration in Java applications should feel like every other Spring integration: auto-configured, testable, portable, and production-ready out of the box. The project draws inspiration from LangChain and LlamaIndex but explicitly avoids being a port, it is designed from the ground up to be idiomatic Spring. If you have written Spring applications, Spring AI will feel immediately familiar: @Autowired AI clients, Spring Boot starters, application.properties configuration, and Advisor patterns that mirror Spring's existing interception model.

Spring AI's direction through 2025 and into 2026 has been to deepen its observability story (Micrometer-native metrics and traces), expand its ChatClient fluent API, and ship more vector store integrations. The framework is now the de facto standard for teams that are already invested in the Spring ecosystem and want to add AI capabilities without introducing a foreign dependency philosophy.

What Makes Spring AI Stand Out

Spring AI's killer feature is Spring Boot integration depth. There is no framework on this list, in any language, that integrates AI capabilities as seamlessly into an existing application framework as Spring AI does with Spring Boot. Auto-configuration, conditional beans, health indicators, Actuator endpoints for AI metrics, everything a Spring developer expects, applied to AI.

Supported languages: Java (primary). Also supports Kotlin (via Spring's Kotlin DSL). Runs anywhere Spring Boot runs: embedded Tomcat, Jetty, Undertow, GraalVM native images.

// application.properties
// spring.ai.openai.api-key=${OPENAI_API_KEY}
// spring.ai.openai.chat.options.model=gpt-4o

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.web.bind.annotation.*;

@RestController
public class ChatController {

    private final ChatClient chatClient;

    public ChatController(ChatClient.Builder builder) {
        this.chatClient = builder.build();
    }

    @GetMapping("/chat")
    public String chat(@RequestParam String message) {
        return chatClient.prompt()
            .user(message)
            .call()
            .content();
    }
}

Enter fullscreen mode Exit fullscreen mode

Structured Output

Spring AI's BeanOutputConverter maps model responses directly to Java POJOs, using the class schema to generate format instructions automatically.

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.converter.BeanOutputConverter;

record MovieReview(String title, int rating, String summary, List<String> pros) {}

BeanOutputConverter<MovieReview> converter = new BeanOutputConverter<>(MovieReview.class);

MovieReview review = chatClient.prompt()
    .user(u -> u.text("Review the movie Inception. {format}")
        .param("format", converter.getFormat()))
    .call()
    .entity(MovieReview.class);

System.out.println(review.title() + " — " + review.rating() + "/10");

Enter fullscreen mode Exit fullscreen mode

RAG with Advisors

Spring AI's Advisors API is one of its most elegant features. Advisors wrap ChatClient calls with cross-cutting concerns, RAG retrieval, chat memory, logging, guardrails, in a declarative, composable way.

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.QuestionAnswerAdvisor;
import org.springframework.ai.vectorstore.VectorStore;

@Service
public class DocumentQAService {

    private final ChatClient chatClient;

    public DocumentQAService(ChatClient.Builder builder, VectorStore vectorStore) {
        this.chatClient = builder
            .defaultAdvisors(new QuestionAnswerAdvisor(vectorStore))
            .build();
    }

    public String answerQuestion(String question) {
        return chatClient.prompt()
            .user(question)
            .call()
            .content();
    }
}

Enter fullscreen mode Exit fullscreen mode

Observability

Spring AI ships with Micrometer integration out of the box. Every chat call generates spans (Spring Boot tracing) and metrics (prompt token count, completion token count, model latency) visible in any Micrometer-compatible backend: Prometheus, Grafana, Zipkin, or Datadog. There is no separate Dev UI, observability is handled by your existing Spring Boot infrastructure.

Broad Vector Store and Model Support

Spring AI supports 10+ model providers (OpenAI, Anthropic, Google Vertex AI, Amazon Bedrock, Azure OpenAI, Mistral, Ollama, Groq, and more) and 20+ vector stores (PGVector, Pinecone, Weaviate, Redis, Elasticsearch, MongoDB Atlas, Chroma, and more), the broadest integration coverage of any Java AI framework.

Pros and Cons

✅ Pros ❌ Cons
Deepest Spring Boot integration, feels native No standalone Dev UI for flow inspection
Micrometer-native observability Agent abstractions are less mature than LangChain4j
Broadest model and vector store integrations Advisors pattern has a learning curve
Production-tested by the Spring ecosystem Heavier spring context overhead for simple use cases
GraalVM native image support No flow/pipeline abstraction like Genkit
Idiomatic Java and Kotlin support

LangChain4j

History and Direction

LangChain4j was started in early 2023 by a small community of Java developers who noticed that the LLM framework explosion happening in Python had no Java equivalent. Despite the name, the project is not a mechanical port of LangChain Python, it is a fusion of ideas from LangChain, Haystack, LlamaIndex, and original innovation, packaged in a way that makes sense for Java.

It grew quickly through 2023 and 2024, driven by its comprehensive integration list (20+ LLM providers, 30+ vector stores) and its clean two-level abstraction model: low-level primitives for maximum control and high-level AI Services for rapid development. The AI Services pattern, where you define an interface with annotations and LangChain4j implements it for you at runtime, became the framework's signature feature and arguably the most Java-idiomatic approach to LLM integration in the ecosystem.

By 2025, LangChain4j had formal integrations with Quarkus, Spring Boot, Micronaut, and Helidon, covering every major Java application framework. The team's direction in 2026 is focused on deepening agentic capabilities (multi-step tools, planning loops, MCP support) and improving the observability story, which has historically been a weaker point compared to Spring AI's Micrometer integration or Genkit's Dev UI.

What Makes LangChain4j Stand Out

LangChain4j's AI Services pattern is its defining feature. Instead of writing imperative LLM call code, you declare an interface, annotate it with @SystemMessage, @UserMessage, and memory annotations, and LangChain4j generates the implementation. The result is AI code that reads like a Java service contract, clean, testable, and completely familiar to Java developers.

Supported languages: Java (primary). Kotlin extensions available (coroutine-based async support). Integrates with Spring Boot, Quarkus, Micronaut, Helidon.

import dev.langchain4j.service.AiServices;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.model.openai.OpenAiChatModel;

interface TranslationAssistant {
    @SystemMessage("You are a professional translator. Translate text accurately and naturally.")
    String translate(@UserMessage String text, @V("language") String targetLanguage);
}

var model = OpenAiChatModel.withApiKey(System.getenv("OPENAI_API_KEY"));

TranslationAssistant assistant = AiServices.builder(TranslationAssistant.class)
    .chatLanguageModel(model)
    .build();

String result = assistant.translate("The quick brown fox jumps over the lazy dog", "Spanish");
System.out.println(result);

Enter fullscreen mode Exit fullscreen mode

Memory and Streaming

import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import dev.langchain4j.service.MemoryId;

interface ConversationalAssistant {
    @SystemMessage("You are a helpful assistant.")
    String chat(@MemoryId String userId, @UserMessage String message);
}

ConversationalAssistant assistant = AiServices.builder(ConversationalAssistant.class)
    .chatLanguageModel(model)
    .chatMemoryProvider(memoryId -> MessageWindowChatMemory.withMaxMessages(20))
    .build();

// Each userId gets its own isolated memory
assistant.chat("user-42", "My name is Alice.");
String response = assistant.chat("user-42", "What's my name?");
// Returns: "Your name is Alice."

Enter fullscreen mode Exit fullscreen mode

RAG Pipeline

import dev.langchain4j.data.document.loader.UrlDocumentLoader;
import dev.langchain4j.data.document.splitter.DocumentSplitters;
import dev.langchain4j.store.embedding.inmemory.InMemoryEmbeddingStore;
import dev.langchain4j.rag.content.retriever.EmbeddingStoreContentRetriever;

// Ingest documents
var documents = UrlDocumentLoader.load("https://example.com/docs");
var splitter = DocumentSplitters.recursive(500, 50);
var segments = splitter.splitAll(documents);

var embeddingModel = OpenAiEmbeddingModel.withApiKey(apiKey);
var embeddingStore = new InMemoryEmbeddingStore<TextSegment>();
EmbeddingStoreIngestor.ingest(segments, embeddingStore, embeddingModel);

// Build RAG-enabled assistant
interface DocsAssistant {
    String answer(@UserMessage String question);
}

var retriever = EmbeddingStoreContentRetriever.builder()
    .embeddingStore(embeddingStore)
    .embeddingModel(embeddingModel)
    .maxResults(3)
    .build();

DocsAssistant assistant = AiServices.builder(DocsAssistant.class)
    .chatLanguageModel(model)
    .contentRetriever(retriever)
    .build();

Enter fullscreen mode Exit fullscreen mode

Two Abstraction Levels

LangChain4j explicitly offers two levels:

  • Low levelChatModel, UserMessage, AiMessage, EmbeddingStore: full control, more code.
  • High levelAiServices: declarative interfaces, minimal boilerplate.

This mirrors what Genkit Java achieves differently. Where Genkit gives you flows and agents as pipeline concepts, LangChain4j uses interface-based AI Services as its high-level abstraction, very idiomatic in Java terms.

Pros and Cons

✅ Pros ❌ Cons
AI Services pattern is uniquely Java-idiomatic No built-in Dev UI or trace explorer
Largest integration ecosystem (20+ models, 30+ stores) Observability requires external tooling (no Micrometer by default)
Two clear abstraction levels (low and high) Agent capabilities still maturing (2026)
Spring Boot, Quarkus, Micronaut, Helidon integrations Large number of modules can be overwhelming
Kotlin coroutine support Less opinionated, more choices to make yourself
Strong RAG tooling out of the box

Google ADK Java

History and Direction

Google ADK (Agent Development Kit) launched in 2024 as a Python-first agent framework targeting enterprise deployments on Google Cloud. Java was a late addition to the multi-language roadmap, with ADK Java 1.0 shipping in early 2026 alongside ADK Go 1.0. The Java SDK arrival was significant: it signaled that Google views ADK as a serious enterprise runtime, not just a Python scripting tool.

ADK Java follows the same design philosophy as the Python SDK: everything is an agent, workflow, or tool. The framework is optimized for building reliable, evaluatable, production-grade multi-agent systems and deploying them to Google Cloud infrastructure, primarily Vertex AI Agent Engine, Cloud Run, and GKE. Like its Python counterpart, ADK Java carries the weight of Google Cloud gravity. The best developer experience, the smoothest deployment path, and the most mature observability story all assume you are running on GCP.

ADK Java 1.0 includes the full agent runtime (LLM agents, sequential/loop/parallel workflow agents), tool calling, MCP support, A2A (Agent-to-Agent) protocol, session/memory management, and streaming. The Java API closely mirrors the Python API in structure, which means the mental model transfers well, but also means the Java SDK carries a style that reflects Python-first design decisions.

ADK Java's Position: Agent-Only, Enterprise-Grade

Like its Python counterpart, ADK Java is an agent framework, it has no vanilla generation primitive or flow abstraction outside the agent model. Its raison d'être is spinning up reliable, evaluatable agents and deploying them at enterprise scale. If you are building a multi-agent system on Google Cloud and Java is your language of choice, ADK Java 1.0 is Google's recommended path.

Supported languages: Java (with ADK Java 1.0). Also: Python (primary), TypeScript, Go.

import com.google.adk.agents.LlmAgent;
import com.google.adk.tools.GoogleSearchTool;
import com.google.adk.runner.InMemoryRunner;
import com.google.genai.types.Content;

var researchAgent = LlmAgent.builder()
    .name("researcher")
    .model("gemini-flash-latest")
    .instruction("You help users research topics thoroughly and accurately.")
    .tools(List.of(new GoogleSearchTool()))
    .build();

var runner = new InMemoryRunner(researchAgent);

var session = runner.sessionService().createSession(
    researchAgent.name(), "user-1"
).blockingGet();

var userMessage = Content.fromParts(Part.fromText(
    "What are the latest developments in fusion energy?"
));

runner.runAsync(researchAgent.name(), session.id(), userMessage)
    .blockingForEach(event -> {
        if (event.finalResponse()) {
            System.out.println(event.stringifyContent());
        }
    });

Enter fullscreen mode Exit fullscreen mode

Multi-Agent Orchestration

ADK Java's multi-agent capabilities match the Python SDK's, including sequential, parallel, and loop orchestration.

import com.google.adk.agents.SequentialAgent;

var researcher = LlmAgent.builder()
    .name("researcher")
    .model("gemini-flash-latest")
    .instruction("Research the given topic and provide key facts.")
    .build();

var writer = LlmAgent.builder()
    .name("writer")
    .model("gemini-flash-latest")
    .instruction("Write a clear, well-structured article from the research provided.")
    .build();

var editor = LlmAgent.builder()
    .name("editor")
    .model("gemini-flash-latest")
    .instruction("Polish and format the article for publication.")
    .build();

var pipeline = SequentialAgent.builder()
    .name("contentPipeline")
    .subAgents(List.of(researcher, writer, editor))
    .build();

Enter fullscreen mode Exit fullscreen mode

Vertex AI Lock-In

ADK Java's production deployment story is built around Vertex AI Agent Engine and Google Cloud. While you can run ADK Java locally (via the ADK CLI or directly) and deploy to Cloud Run or GKE independently, the managed evaluation tools, performance dashboards, and enterprise support all assume GCP. This is the clearest example in the Java AI space of a framework built to serve a platform rather than being platform-neutral.

Pros and Cons

✅ Pros ❌ Cons
Official Google support with production SLA Tightly coupled to Vertex AI and GCP
Best multi-agent orchestration in Java Agent-only framework, no vanilla generation or flows
A2A protocol for agent interoperability Python-first design reflected in Java API style
Full evaluation tools (user simulation, custom metrics) Requires GCP for full observability and deployment features
Scales to enterprise on Google Cloud Youngest Java SDK (1.0 released 2026)
Streaming support (Gemini Live API)

Head-to-Head Comparison

Developer Experience

Framework DX Highlights Shortcomings
Genkit Java Dev UI for local tracing is unmatched. Idiomatic Java builder API. GitHub Packages auth friction; unofficial status
Spring AI Feels native to any Spring Boot codebase. Zero-surprise API. No visual Dev UI; observability via Micrometer only
LangChain4j AI Services pattern is the cleanest Java-native AI abstraction No Dev UI; agent features still maturing
ADK Java Powerful multi-agent tooling. Official Google support. GCP-centric; Python-style reflected in Java API

Abstraction Levels

Genkit Java is the only Java AI framework that provides all three levels: vanilla generation, typed flows (pipelines), and agents. Spring AI covers generation and a basic agent model via tools, but lacks a flow abstraction. LangChain4j provides two levels (low-level primitives and high-level AI Services) but is agent/service focused. ADK Java is agent-only.

Observability

Framework Local Dev Production
Genkit Java Dev UI with trace explorer OTEL-compatible export
Spring AI Logs and Actuator endpoints Micrometer (Prometheus, Grafana, Datadog)
LangChain4j Logging only Manual OTEL setup
ADK Java ADK Web UI Cloud Trace + Vertex (GCP)

Framework Neutrality

Genkit Java and LangChain4j are built to be provider-neutral: they support every major model and deploy to any infrastructure. Spring AI is similarly neutral on model providers, though it carries Spring's opinionated application framework as a dependency, a worthwhile trade for most Java shops. ADK Java carries the heaviest platform dependency: its full value is unlocked on Google Cloud.

Java Ecosystem Fit

Framework Spring Boot Quarkus Micronaut Native Image
Genkit Java ✅ Plugin
Spring AI ✅ Native ✅ GraalVM
LangChain4j ✅ Module ✅ Extension ✅ Module Partial
ADK Java

Which Framework Should You Choose?

Choose Genkit Java if:

  • You want to iterate on your AI fast and get feedback with less back and forth — Genkit was built from the ground up for powerful local tooling and observability, and the Dev UI is genuinely transformative.
  • You need multiple abstraction levels (vanilla calls, typed flows, and agents) in one SDK.
  • Provider neutrality matters: you need to swap or mix Gemini, Claude, OpenAI, and Bedrock.
  • Your team also writes TypeScript and wants a consistent framework story across both stacks.

Choose Spring AI if:

  • You are already running Spring Boot and want AI to feel like any other Spring integration.
  • Micrometer-native metrics and traces plugging into your existing Prometheus/Grafana stack are a priority.
  • You need the broadest model and vector store coverage with production-grade auto-configuration.
  • GraalVM native images are a requirement for your deployment targets.

Choose LangChain4j if:

  • You want the most Java-idiomatic high-level AI abstraction: interface-based AI Services with annotations.
  • You need the largest integration ecosystem and don't want to be tied to any application framework.
  • Your team works across Spring Boot, Quarkus, Micronaut, and Helidon, LangChain4j is the most framework-agnostic.
  • RAG pipelines with rich document ingestion and retrieval are a core use case.

Choose ADK Java if:

  • You are building enterprise-grade multi-agent systems and Google Cloud is your runtime.
  • You need official Google support and SLA-backed infrastructure for agent deployment.
  • Multi-agent orchestration (sequential, parallel, loop) and the A2A interoperability protocol matter.
  • Your team is already using the ADK Python SDK and wants to extend to Java services.

Conclusion

Java's AI framework landscape in 2026 is surprisingly rich. The four frameworks covered here serve genuinely different needs, and unlike in the JavaScript world where Genkit, Vercel, Mastra, LangChain, and ADK overlap significantly, the Java options each occupy a clearer niche.

For enterprise Spring Boot teams, Spring AI is the obvious choice, zero friction, production-ready observability via Micrometer, and the broadest integration matrix. For teams that value developer experience above all, Genkit Java's Dev UI is a category apart and worth the unofficial status trade-off. For framework-agnostic Java developers who want the most idiomatic Java AI service abstraction, LangChain4j's AI Services pattern is hard to beat. And for Google Cloud enterprise workloads that need reliable multi-agent orchestration at scale, ADK Java 1.0 is where Google is putting its weight.

The most important thing is that you no longer have an excuse to reach for Python just because it has better AI tooling. Java's time in generative AI has arrived.


Last updated: April 2026. Framework versions referenced: Genkit Java 1.0.0-SNAPSHOT, Spring AI 1.x, LangChain4j 0.36.x, Google ADK Java 1.0.