Genkit vs LangChain: Google's Agent Framework vs the Incumbent
TL;DR: Genkit is Google's open-source, Apache-2.0 framework for building AI features as typed flows, with a local Developer UI, built-in tracing and one-line deployment to Firebase or Cloud Run. LangChain is the MIT-licensed incumbent: createAgent for tool-calling agents, LangGraph for stateful graphs, and the largest integration catalog. Choose Genkit for app-embedded AI on Google Cloud or in Go. Choose LangChain plus LangGraph for complex, long-running, multi-agent orchestration.
Key Takeaways
- Genkit and LangChain overlap at the model-call, tool-calling and RAG layer, but Genkit is shaped around shipping AI features inside an app, while LangChain is shaped around composing agents and pipelines.
- Genkit's core unit is the flow: a typed, traced, deployable function. LangChain's core units are the
createAgentloop and, underneath it, a LangGraph state graph with checkpointers. - "Genkit vs LangGraph" is the sharper comparison: LangGraph gives you explicit nodes, edges, cycles and durable checkpoints; Genkit gives you plain async code inside flows, plus a beta
defineAgentAPI with snapshot-based sessions. - Genkit covers more server languages at production grade: JavaScript/TypeScript and Go are stable, Python is in beta and Dart is in preview. LangChain is production grade in Python and JavaScript only.
- LangChain has roughly 15x the npm adoption (about 4.3 million weekly downloads for
langchainvs about 280,000 forgenkitin mid-November 2026) and a far deeper catalog of loaders, vector stores and retrievers. - Neither locks you to a model vendor. Genkit is Gemini-first but runs OpenAI, Anthropic and Ollama models through plugins; LangChain is vendor-neutral by design.
What are Genkit and LangChain?
Both frameworks help developers turn a model API into a product feature: generate text and structured data, call tools, retrieve documents and run multi-step agent logic. They start from different places.
Genkit is an open-source framework from Google, built and used in production by the Firebase team. It was announced as "Firebase Genkit" at Google I/O in May 2024, and the project has since dropped the Firebase prefix, moving its repository to genkit-ai/genkit to signal that it runs anywhere, not just on Firebase. As of November 2026 the JavaScript package genkit is at version 1.44 and the Go module at v1.14, both described by the project as production-ready. The Python SDK (genkit 0.14 on PyPI) is marked Beta, and a Dart SDK is in preview. The repository has about 6,600 GitHub stars and is Apache-2.0 licensed.
Genkit's mental model is small: initialize a genkit() instance with plugins, call ai.generate() for model calls, register tools with ai.defineTool(), keep prompts in .prompt files (Dotprompt), and wrap your logic in ai.defineFlow(). Every flow is typed with Zod schemas, traced automatically, runnable from a local Developer UI, and deployable as an HTTP endpoint or a Firebase callable function.
LangChain is the incumbent open-source framework for LLM applications, MIT licensed, with a Python package (langchain 1.5) and a JavaScript/TypeScript package (langchain 1.6). The Python repository has nearly 150,000 GitHub stars and the JS repository about 18,000. Since the 1.0 releases, the main entry point is createAgent (create_agent in Python), a tool-calling loop extended with middleware. That agent runs on LangGraph (langgraph 1.2 in Python, @langchain/langgraph 1.7 in JS), a lower-level runtime for stateful graphs with checkpointers, interrupts, stores and streaming. Around both sits LangSmith, LangChain's hosted platform for tracing, evaluation and deployment.
So "Genkit vs LangChain" is really two comparisons. At the feature level, Genkit's ai.generate() and flows compete with LangChain's models, tools and createAgent. At the orchestration level, Genkit's flows and beta agents compete with LangGraph.
How do Genkit and LangChain compare at a glance?
| Category | Genkit | LangChain + LangGraph |
|---|---|---|
| Maintainer | Google (Firebase team) | LangChain, Inc. |
| License | Apache-2.0 | MIT |
| Languages | JS/TS and Go (stable), Python (beta), Dart (preview) | Python and JS/TS |
| Latest versions (Nov 2026) |
genkit 1.44 (JS), v1.14 (Go), 0.14 (Python) |
langchain 1.6 JS / 1.5 Python; LangGraph 1.7 JS / 1.2 Python |
| Core abstraction | Flows: typed, traced, deployable functions |
createAgent loop on a LangGraph state graph |
| Agent API |
ai.generate({ tools }); beta ai.defineAgent() with chat sessions |
createAgent({ model, tools, middleware }) |
| Orchestration | Ordinary async code inside flows | Graph API (nodes, edges, cycles) or Functional API |
| Human-in-the-loop | Interrupts (beta): defineInterrupt, restartable tools, toolApproval middleware |
interrupt() plus a checkpointer and thread_id
|
| Persistence | Session stores for agent snapshots; your own database for flow state | Pluggable checkpointers (memory, SQLite, Postgres) and stores |
| Prompt management | Dotprompt .prompt files with schemas and model config |
Prompt templates in code; LangSmith prompt hub |
| Local tooling | Genkit CLI and Developer UI (genkit start) |
LangSmith Studio, LangGraph CLI |
| Observability | OpenTelemetry traces; Genkit Monitoring in the Firebase console | LangSmith (hosted or self-hosted), OpenTelemetry export |
| Deployment | Firebase Functions (onCallGenkit), Cloud Run, Express, any Node or Go host |
Bring your own server, or LangSmith Deployment |
| Integrations | Focused plugin set: Google AI, Vertex AI, OpenAI-compatible, Anthropic, Ollama, Firestore | Hundreds of providers, loaders, vector stores and retrievers |
| Best for | AI features inside web and mobile apps, Google Cloud teams, Go backends | Complex agents, RAG pipelines, long-running multi-agent workflows |
How much code does a basic tool-calling agent take?
For a single agent that calls one tool, the two frameworks are nearly the same length. The difference is what you get around the call.
Here is Genkit, wrapped in a flow so it is traced, testable in the Developer UI and deployable as an endpoint:
import { genkit, z } from "genkit";
import { googleAI } from "@genkit-ai/google-genai";
const ai = genkit({
plugins: [googleAI()],
model: googleAI.model("gemini-2.5-flash"),
});
const getOrderStatus = ai.defineTool(
{
name: "getOrderStatus",
description: "Look up the current status of a customer order by its ID",
inputSchema: z.object({ orderId: z.string() }),
outputSchema: z.object({ status: z.string() }),
},
async ({ orderId }) => ({ status: await db.fetchStatus(orderId) })
);
export const supportFlow = ai.defineFlow(
{
name: "supportFlow",
inputSchema: z.object({ question: z.string() }),
outputSchema: z.string(),
},
async ({ question }) => {
const { text } = await ai.generate({
system: "You are a support agent. Always check order status before answering.",
prompt: question,
tools: [getOrderStatus],
});
return text;
}
);
The same agent in LangChain.js uses createAgent and the tool() helper:
import { createAgent, tool } from "langchain";
import { ChatGoogleGenerativeAI } from "@langchain/google-genai";
import * as z from "zod";
const getOrderStatus = tool(
async ({ orderId }) => db.fetchStatus(orderId),
{
name: "get_order_status",
description: "Look up the current status of a customer order by its ID",
schema: z.object({ orderId: z.string() }),
}
);
const agent = createAgent({
model: new ChatGoogleGenerativeAI({ model: "gemini-2.5-flash" }),
tools: [getOrderStatus],
systemPrompt: "You are a support agent. Always check order status before answering.",
});
const result = await agent.invoke({
messages: [{ role: "user", content: "Where is order #4471?" }],
});
Three details show the design split. Genkit tools declare an outputSchema, so the tool result is typed end to end. Genkit's tool loop lives inside ai.generate(), so an "agent" is just a generate call with tools, and the flow around it is the unit you deploy. LangChain's createAgent returns a compiled graph: it already speaks LangGraph's language of messages, state and threads, which is what lets you add a checkpointer or middleware later without restructuring.
How do Genkit flows compare with LangGraph graphs?
This is the core of the "Genkit vs LangGraph" question, because orchestration is where production complexity accumulates.
A Genkit flow is a typed function. Inside it you write ordinary TypeScript or Go: call ai.generate(), branch with if, loop with for, call other flows, run steps in parallel with Promise.all. Genkit adds input and output validation, a trace span for every model and tool call, streaming via a sendChunk callback, and the ability to serve the flow over HTTP. There is no graph to declare. The mental model is "a backend function that happens to use AI", which is why Genkit is easy to adopt inside an existing service.
A LangGraph graph is a state machine. You define a state schema, add nodes that read and update that state, and connect them with edges, including conditional edges and cycles. You compile the graph, optionally with a checkpointer, and every step's state is saved under a thread_id. That buys you three things plain code does not have by default: you can pause anywhere and resume days later, you can replay or fork from a past checkpoint, and you can visualize the control flow in LangSmith Studio.
import { StateGraph, MessagesAnnotation, MemorySaver, START, END } from "@langchain/langgraph";
const graph = new StateGraph(MessagesAnnotation)
.addNode("classify", classifyTicket)
.addNode("draftReply", draftReply)
.addNode("escalate", escalateToHuman)
.addEdge(START, "classify")
.addConditionalEdges("classify", (state) =>
isUrgent(state) ? "escalate" : "draftReply"
)
.addEdge("draftReply", END)
.addEdge("escalate", END)
.compile({ checkpointer: new MemorySaver() });
await graph.invoke(
{ messages: [{ role: "user", content: "Our API is down" }] },
{ configurable: { thread_id: "ticket-4471" } }
);
The trade-off is direct. For a workflow that runs start to finish in one request, such as summarize, classify, extract and respond, a Genkit flow is shorter and easier to read, because it is just code. For a workflow that loops back on itself, waits on humans, coordinates several agents or must survive a process restart mid-run, LangGraph's explicit state and checkpoints do work you would otherwise build yourself.
Genkit has been closing part of that gap. Its beta ai.defineAgent() bundles a system prompt, tools and an optional session store into a multi-turn chat object. Each turn persists as a resumable snapshot, a failed turn keeps the tool rounds it completed, and the agents middleware in @genkit-ai/middleware exposes sub-agents as delegation tools. That covers durable chat agents and simple multi-agent delegation. It does not give you LangGraph's arbitrary graph topology, time travel or per-node checkpoints.
How do they handle human-in-the-loop approvals?
Both frameworks can pause before a risky tool call and resume with a human decision, but they persist the pause differently.
Genkit uses interrupts, currently a beta feature imported from genkit/beta. You can define a tool that always pauses with ai.defineInterrupt(), or have a regular tool call interrupt() conditionally and later re-run it with .restart(). The toolApproval middleware automates the common case by interrupting any tool not on an approved list:
import { toolApproval } from "@genkit-ai/middleware";
import { restartTool } from "genkit";
let response = await ai.generate({
prompt: "Refund order #4471",
tools: [issueRefund, getOrderStatus],
use: [toolApproval({ approved: ["getOrderStatus"] })],
});
if (response.interrupts.length) {
// Show the pending call to a human, then resume with approval.
response = await ai.generate({
messages: response.messages,
tools: [issueRefund, getOrderStatus],
resume: {
restart: response.interrupts.map((i) => restartTool(i, { toolApproved: true })),
},
use: [toolApproval({ approved: ["getOrderStatus"] })],
});
}
The paused state is the messages array. Your application stores it wherever it likes, in Firestore, Postgres or a session store attached to a Genkit agent, and passes it back on resume.
LangGraph uses interrupt() plus a checkpointer. A node calls interrupt(payload), the graph saves its full state under the thread ID and returns. Later you invoke the graph with new Command({ resume: value }) on the same thread, and execution continues inside that node. LangChain's createAgent exposes the same mechanism through human-in-the-loop middleware, so you can require approval for specific tools declaratively.
The practical difference: in Genkit you own the storage of the paused conversation, which is simple and transparent for request-response apps. In LangGraph the framework owns it, which is more machinery but means a pause can happen in the middle of any multi-step graph, not only at a tool call.
How do RAG and integrations compare?
LangChain wins on breadth, clearly. Its integration catalog spans hundreds of chat models, embedding models, vector stores, document loaders, text splitters and retrievers, in both Python and JS. If your RAG pipeline needs to ingest Confluence, SharePoint, PDFs and a dozen SaaS sources into Pinecone, Weaviate or pgvector, LangChain almost certainly has a loader or store already written. That catalog is the main reason it remains the default choice, and why many teams that use another framework still import LangChain loaders.
Genkit is focused. It provides retriever, indexer and embedder abstractions (ai.retrieve(), ai.index(), ai.embed()) and plugins for Google's stack, including Vertex AI and Firestore vector search, plus community plugins for other stores. Models come from @genkit-ai/google-genai, @genkit-ai/vertexai, @genkit-ai/compat-oai for OpenAI-compatible APIs, and Anthropic and Ollama plugins. Writing a custom retriever is short, but you will write more of them yourself than with LangChain.
Both support the Model Context Protocol. Genkit's @genkit-ai/mcp plugin connects to MCP servers and can expose Genkit tools as one; LangChain uses @langchain/mcp-adapters (langchain-mcp-adapters in Python) to load MCP tools into an agent. For most agent tool access in 2026, MCP narrows the integration gap more than either catalog does.
Which has better developer tooling and observability?
Genkit's strongest differentiator is its local developer loop. Running genkit start -- npx tsx src/index.ts launches a Developer UI where every flow, prompt, tool and model is listed and runnable. You can call a flow with test input, step through its trace span by span, edit a Dotprompt file and re-run it, compare outputs across models, and run evaluations over datasets with the bundled evaluator plugin. It needs no account and no hosted service.
In production, Genkit emits OpenTelemetry traces and metrics. With the @genkit-ai/google-cloud or Firebase plugins, these feed Genkit Monitoring in the Firebase console, which tracks request volume, latency, error rate and token usage per flow. Because it is OpenTelemetry, you can also send traces to any compatible backend.
LangChain's tooling centers on LangSmith: hosted (or self-hosted on enterprise plans) tracing, datasets, evaluations, prompt versioning and annotation queues, plus LangSmith Studio for visualizing and debugging graphs. LangSmith is more powerful for evaluation-heavy teams and for debugging long multi-agent runs, but it is a separate product with its own pricing beyond the free tier. Teams that want open-source tracing often pair LangChain with Langfuse or Phoenix instead; see our LangSmith vs Langfuse vs Phoenix comparison.
Verdict: Genkit gives you the better zero-setup local experience and free production monitoring if you are on Google Cloud. LangChain plus LangSmith gives you the deeper evaluation and long-run debugging platform.
How does deployment differ?
Genkit treats deployment as part of the framework. A flow can be served with startFlowServer() from @genkit-ai/express, mounted in an existing Express app with expressHandler(), deployed as a Firebase callable function with onCallGenkit() from firebase-functions, or containerized for Cloud Run. Firebase client SDKs and genkit/beta/client helpers (streamFlow, remoteAgent) call flows and agents from web and mobile apps with streaming. Firebase deployment also brings App Check and authentication policies to AI endpoints, which matters when a mobile client calls a paid model.
LangChain leaves serving to you, or to LangSmith Deployment. An agent is a library object; you put it behind FastAPI, Express, Next.js route handlers or a queue worker. For durable, long-running agents, LangSmith Deployment (formerly LangGraph Platform) hosts graphs with built-in persistence, task queues and streaming APIs. It is capable, but it is a managed service with usage-based pricing, or a self-hosted enterprise install.
If your app already lives on Firebase or Cloud Run, Genkit's deployment story is close to free. If you are on AWS or Azure, Genkit still runs anywhere Node.js or Go runs, but its biggest convenience advantage shrinks.
Which language support matters for your team?
Language coverage is an underrated deciding factor.
-
Go: Genkit is one of very few agent frameworks with a stable Go SDK. If your backend is Go, Genkit is a natural fit; LangChain has no official Go SDK (the community
langchaingoport is separate and lags the official libraries). - Python: LangChain and LangGraph are at their most mature here, with the largest ecosystem and community. Genkit's Python SDK is still in beta, so a Python-first team should default to LangChain unless it is committed to Google Cloud.
- TypeScript: Both are production grade. Genkit feels more integrated with full-stack apps; LangChain.js offers parity with Python LangChain code.
- Dart and Flutter: Genkit has a preview Dart SDK; LangChain has none.
Which should you choose: Genkit or LangChain?
Choose Genkit if:
- You are adding AI features to a web or mobile app, especially one on Firebase or Google Cloud.
- Your backend is in Go, or you want the same framework across TypeScript and Go services.
- Your workflows mostly finish within a request: generation, extraction, classification, tool-calling chat.
- You value a local Developer UI and free built-in monitoring over a hosted evaluation platform.
- You want a smaller API surface that a team can learn in a day.
Choose LangChain plus LangGraph if:
- You are building complex agents with loops, branching, supervisors or multiple cooperating agents.
- Workflows must pause for hours or days and survive restarts, with replay and time travel.
- Your RAG pipeline needs many data sources and vector stores out of the box.
- Your team is Python-first, or already uses LangSmith for tracing and evaluation.
- You need vendor neutrality across clouds as a hard requirement.
For a broader view including Mastra, Vercel AI SDK and LlamaIndex.TS, see our JavaScript and TypeScript GenAI frameworks comparison. If you are weighing other agent SDKs against LangGraph, our Strands Agents vs LangGraph and Mastra vs LangChain.js comparisons cover the same control-flow trade-off from different angles.
Can you use Genkit and LangChain together?
Yes, and it is a reasonable pattern rather than a workaround. Genkit tool and flow functions are ordinary code, so you can call a LangChain document loader, text splitter or retriever inside a Genkit tool to reuse LangChain's catalog while keeping Genkit's flows, Developer UI and Firebase deployment. Going the other way, a LangGraph node can call a deployed Genkit flow over HTTP, which lets a platform team expose AI capabilities as typed endpoints that an orchestration layer consumes. MCP gives a cleaner seam still: expose tools from one framework as an MCP server and load them into the other.
What does not mix well is two orchestration layers in one process. Pick one framework to own the control flow and persistence, and treat the other as a library of components.
Frequently Asked Questions
What is the difference between Genkit and LangChain?
Genkit is Google's open-source framework for building AI features as typed, traced flows, with a local Developer UI and built-in deployment to Firebase, Cloud Run or any Node.js or Go host. LangChain is a vendor-neutral framework for composing agents and LLM pipelines, with createAgent for tool-calling agents, LangGraph for stateful graphs and the largest integration catalog. Genkit optimizes for shipping app features; LangChain optimizes for orchestration and breadth.
Is Firebase Genkit the same as Genkit?
Yes. The framework launched in 2024 as Firebase Genkit and is now called Genkit, with its repository under genkit-ai/genkit and documentation at genkit.dev. The Firebase team still builds and uses it, and Firebase remains a first-class deployment target, but Genkit runs on any platform and with non-Google models.
Is Genkit better than LangGraph?
Neither is better in general; they suit different workflow shapes. Genkit flows are plain async code, which is simpler for request-scoped workflows and easy to embed in an existing service. LangGraph models workflows as state machines with conditional edges, cycles and per-step checkpoints, which suits long-running, multi-agent and pause-and-resume workflows. Choose Genkit unless your workflow needs durable state between steps.
Does Genkit only work with Gemini models?
No. Genkit is Gemini-first, with first-party Google AI and Vertex AI plugins, but it supports OpenAI and any OpenAI-compatible API through @genkit-ai/compat-oai, Anthropic Claude models through an Anthropic plugin, and local models through Ollama. Model choice is a per-call parameter, so one flow can mix providers.
Is Genkit production ready in 2026?
The JavaScript/TypeScript and Go SDKs are production-ready and used by Google's Firebase in production, with JS at version 1.44 and Go at v1.14 in November 2026. The Python SDK is still beta and Dart is a preview. Some APIs, including agents and interrupts, are imported from genkit/beta, so pin versions and test upgrades if you depend on them.
Can I migrate from LangChain to Genkit?
Yes, at the tool and model layer migration is mostly mechanical, since both use Zod schemas in TypeScript and similar tool definitions. Agents built with createAgent map to ai.generate() with tools, or to ai.defineAgent() for multi-turn chat. LangGraph graphs with cycles and checkpoints need to be redesigned as flow code plus your own persistence, and existing checkpoints cannot be converted.
Sources
- Genkit documentation
- Genkit GitHub repository
- Genkit JavaScript SDK README
- Genkit flows documentation
- Genkit agents documentation
- Genkit JavaScript quickstart
- LangChain.js agents documentation
- LangGraph.js persistence documentation
- LangGraph.js interrupts documentation
- LangChain GitHub repository
- LangGraph GitHub repository
Originally published at fp8.co. Subscribe for weekly AI engineering analysis at fp8.co/newsletters.
Top comments (0)