Skip to content

The AI Framework for Java Applications

Build AI-powered applications in Java with a unified API for any model provider. Supports OpenAI, Gemini, Claude, Bedrock, and 15+ more providers out of the box.
import com.google.genkit.Genkit;
import com.google.genkit.plugins.googlegenai.GoogleGenAIPlugin;
Genkit genkit = Genkit.builder()
.plugin(GoogleGenAIPlugin.create())
.build();
String text = genkit.generate(GenerateOptions.builder()
.model("googleai/gemini-3-flash")
.prompt("Why is Genkit awesome?")
.build()).getText();

The fastest way to build AI features into your Java apps.

Unified APIs for any model

Use Google AI, OpenAI, Claude, Bedrock, and Ollama through one SDK. Switch models with a single line change.

Composable workflows

Structure chat, RAG, tool use, and agents with built-in primitives. Define type-safe flows with input/output schemas.

Production-ready tools

Local dev UI, debugging, tracing with OpenTelemetry, and deployment to Spring Boot, Jetty, or Firebase Cloud Functions.

20+ Plugins

Model providers, vector databases, MCP, evaluators, and server frameworks — all as simple plugin integrations.

import com.google.genkit.plugins.jetty.JettyPlugin;
JettyPlugin jetty = new JettyPlugin(JettyPluginOptions.builder()
.port(8080).build());
Genkit genkit = Genkit.builder()
.plugin(GoogleGenAIPlugin.create())
.plugin(jetty)
.build();
genkit.defineFlow("tellJoke", String.class, String.class,
(ctx, topic) -> genkit.generate(GenerateOptions.builder()
.model("googleai/gemini-3-flash")
.prompt("Tell a joke about: " + topic)
.build()).getText());
jetty.start();

Define server-managed agents with memory, tools, and multi-agent delegation. Persist conversations in the store of your choice.

import com.google.genkit.agent.AgentConfig;
import com.google.genkit.ai.agent.*;
Agent<Map<String, Object>> assistant = genkit.beta().defineAgent(
AgentConfig.<Map<String, Object>>builder()
.name("assistant")
.system("You are a helpful assistant. Remember what the user tells you.")
.model("googleai/gemini-3-flash")
.store(sessionStore) // persist sessions in Firestore, DynamoDB, Cosmos DB, PostgreSQL, MongoDB, ...
.build());
AgentChat<Map<String, Object>> chat = assistant.chat();
chat.send("My name is Ada Lovelace.");
String reply = chat.send("What is my name?").text(); // "Your name is Ada Lovelace."