Skip to content

genkit

LLM Frameworks

An open‑source framework for building full‑stack AI‑powered applications with unified SDKs across multiple languages

TypeScript Latest go/v1.11.0 · 2d ago Security brief →

Features

  • Unified API to integrate hundreds of AI models from providers like Google, OpenAI, Anthropic and Ollama
  • Streamlined APIs for structured output, tool calling, multimodal content and RAG workflows
  • Cross‑language SDKs (JavaScript/TypeScript, Go, Python Beta, Dart Preview) with consistent capabilities
  • Ready‑to‑use client helpers for web frameworks (e.g., Next.js) and mobile platforms (iOS, Android)
  • Production‑grade monitoring dashboards for model performance, latency and errors

Security Response History

2 CVEs
CVE Severity Disclosed Patched (this tool) vs Ecosystem Median
CVE-2025-31125 KEV medium
CVSS 5.3
2025-03-31 2026-01-07 9mo / median 9mo
CVE-2023-4863 KEV high
CVSS 8.8
2023-09-13 2026-01-07 2y 4mo / median 2y 4mo

Recent releases

View all 31 releases →
No immediate action
go/v1.11.0 Mixed

Telemetry, Vertex AI, Claude models

Config change
py/v0.8.0 Breaking risk
Breaking upgrade

Plugin rename + Vertex AI regions + Gemini model expansion

No immediate action
v1.40.1 Bug fix

Fix Google GenAI role mapping

Review required
v1.40.0 Mixed
RCE / SSRF

Agents docs + Google‑GenAI removal + snapshot fix

v1.39.0 Breaking risk
⚠ Upgrade required
  • Migrate existing code using `Chat`/`ai.chat()`/`session.chat()` to the new Agents API (`defineAgent`, `agent.chat()`).
  • If using bidirectional actions or flows, review the updated initialization schema support and streaming changes.
Breaking changes
  • Removal of the beta Chat API: `Chat` class, `ai.chat(...)`, and `session.chat(...)` are deleted. Migrate to `ai.defineAgent(...)` and use `agent.chat()` instead.
Notable features
  • Agents – a first‑class multi‑turn agent API with stateful chats, typed custom state (Zod), pluggable persistence, streaming patches, interrupts/resume, abort/detach support, and transport‑agnostic usage.
  • Agents middleware: `agents()` orchestrator for delegating to sub‑agents and `artifacts()` tools for reading/writing session artifacts.
  • FirestoreSessionStore in @genkit-ai/google-cloud (with @genkit-ai/firebase wrapper) persisting agent sessions as incremental JSON Patch diffs with sharded checkpoints.
Full changelog

⚠️ Breaking changes (beta)

  • The beta Chat API has been removed and replaced by the new Agents API (#5248, #5251). The Chat class, ai.chat(...), and session.chat(...) are gone. Migrate to ai.defineAgent(...) and agent.chat() (see Agents below). All removed surface was beta.

This release introduces Agents, a first-class, multi-turn agent API for Genkit JS. Agents bundle a model/prompt, conversational state, tool loops, interrupts, persistence, streaming, and abort/resume into a single ergonomic, transport-agnostic surface that runs identically in-process on the server and over HTTP from the browser.

Highlights

defineAgent — the new Agents API (#5251)

Define a multi-turn agent in a single call, with three levels of control:

// Zero-config
const agent = ai.defineAgent({
  name: 'assistant',
  model: 'googleai/gemini-flash-latest',
  system: 'You are a helpful assistant.',
  tools: [searchTool],
});

// Reuse a registered .prompt (typed promptInput)
const agent = ai.definePromptAgent({ promptName: 'assistant', promptInput: { role: 'pirate' } });

// Full control via a custom turn handler
const agent = ai.defineCustomAgent({ name: 'custom' }, async (runner, input) => { /* ... */ });

Key capabilities:

  • Stateful, multi-turn chatschat() threads state, messages, snapshotId, and sessionId for you (send & stream).
  • Typed custom state with Zod validation (stateSchema).
  • Pluggable persistence via SessionStore (in-memory + file stores included); server-managed sessions resumable by sessionId.
  • Streaming with live custom-state patches over the wire (JSON Patch).
  • Interrupts & resume (restart / respond) for human-in-the-loop tools.
  • Abort, detach (background turns) + heartbeats, and graceful failure that preserves the last-good state.
  • clientTransform to redact/reshape state and stream chunks before they leave the server.
  • Same API server or browserremoteAgent(...) returns the same AgentAPI shape over HTTP.

Agents middleware: delegation & artifacts (#5252)

New @genkit-ai/middleware middlewares for building multi-agent, artifact-producing workflows:

  • agents() — turns an agent into an orchestrator that delegates to other registered agents. Injects a dedicated delegate_to_<agent> tool per sub-agent, auto-discovers descriptions, returns sub-agent interrupts/failures as tool results, and adds guard rails (maxDelegations, historyLength).
  • artifacts() — gives the model read_artifact / write_artifact tools backed by session state, with an <artifacts> listing injected each turn. Pair with agents({ artifactStrategy: 'session' }) so an orchestrator can read artifacts produced by its sub-agents.

useChat adapter for Agents — @genkit-ai/vercel-ai (#5426)

A new plugin providing a Vercel AI SDK ChatTransport that wires useChat directly to Genkit Agents, so you can build rich React chat UIs (Next.js, Vite) with zero custom plumbing:

  • GenkitChatTransport — drop-in ChatTransport, compatible with AI Elements.
  • Server-managed sessions keyed by the useChat id (no client-side snapshot bookkeeping).
  • First-class interrupts mapped onto the AI SDK's native HITL primitives (respond + restart).
  • Mapping utilities to convert between Vercel UIMessage and Genkit MessageData.
  • Ships a full sample app at js/testapps/vercel-ai-elements.

Firestore session store (#5586)

FirestoreSessionStore for persisting agent sessions, in @genkit-ai/google-cloud with a thin @genkit-ai/firebase wrapper. It persists each turn as an incremental JSON Patch diff anchored to periodic, sharded full-state checkpoints, so no document approaches Firestore's 1 MiB limit, per-turn reads/writes stay bounded regardless of session length, and reconstruction is strongly consistent without secondary indexes. Tunable via collection, checkpointInterval, and shardSize.

Supporting changes

  • Initialization data for flows & actions (#5247) — flows/actions can declare an initSchema and receive validated init data (separate from input) over HTTP. Plumbed through genkit/beta/client (runFlow/streamFlow) and the express, fastify, fetch, and next handlers.
  • Bidi actions and flows (#4288) — foundational support for bidirectional (streaming both ways) actions and flows.

Full Changelog: https://github.com/genkit-ai/genkit/compare/v1.38.0...v1.39.0

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

About

Stars
6,254
Forks
792
Languages
TypeScript Go Python
Downloads/week
224,611 ↓13%
NPM Maintainers
4
Contributors
100
TypeScript
Types included ✓

Beta — feedback welcome: [email protected]