Skip to content

Releases: genkit-ai/genkit

Genkit JS and CLI 1.41.0

Choose a tag to compare

@pavelgjpavelgj released this 11 Aug 00:44

JS SDK

  • New GPT-5.x models in the OpenAI-compatible plugin. Added gpt-5.2, gpt-5.4, gpt-5.4-mini, gpt-5.4-nano, and gpt-5.5 to compat-oai, so you can reach the latest OpenAI models without waiting on a plugin bump. (#5389)

  • Per-request Anthropic API keys. The Anthropic plugin now resolves the API key lazily at request time instead of only at init, so you can override the key per call. Handy for multi-tenant setups and key rotation. (#4298)

  • Clearer retry and fallback logs. The retry and fallback model middleware now emit structured warnings explaining what happened: which attempt, how long the backoff is, why a retry was skipped, and which model it's falling back to. AbortError and ToolInterruptError are now correctly treated as non-retryable. (#5449)

  • Fixed audio transcription file extensions.compat-oai speech-to-text now derives the right file extension from the content type (.mp3, .wav, .webm, and friends) instead of a generic name, which fixes transcription failures with providers that key off the extension. (#3367)

  • More reliable agent resume.validateResumeAgainstHistory now searches history newest-first, fixing an edge case when resuming interrupted conversations. (#5832)

  • Options for checkOperation and cancelOperation. You can now pass options (including per-request client config) when polling or cancelling long-running operations. Auth and secrets are also now scrubbed from context logging. (#5972)

  • Security hardening for background operations (heads up: minor breaking change). The google-genai plugin no longer persists clientOptions in operation metadata, which previously risked leaking API keys if you returned a full operation object to a client. If you use per-request overrides (like a custom API key) with long-running models, you now need to pass those same overrides to each checkOperation/cancelOperation call. (#5992)

  • ROUGE evaluator fix on Vertex AI. Corrected the type used by the ROUGE score evaluator and cleaned up duplicated evaluator types. (#3592)

CLI

  • Structured output now survives "Export to .prompt". When you export from the Dev UI model runner, the output schema is included in the front matter (written as Picoschema) instead of being dropped, so exported prompts keep their structured output config. (#5506)

  • Cleaner trace:get output.genkit trace:get <id> gets a readable tree view, and --format json gives you clean JSON that's easy to pipe into other tools. (#5848)

  • More reliable startup in ephemeral runtimes. The CLI now waits for actions to finish registering before proceeding, fixing flaky behavior where actions weren't yet available. (#5949)

Dev UI

This release makes the runners smarter about structured output, sharpens live streaming in the Agent Runner, and clears up a bunch of rough edges in traces, tools, and datasets.

Highlights

  • See and edit output config in the Model Runner. The Model Runner now has an editable Output panel. When you load a generation from a trace, you can inspect the inherited format and JSON schema, tweak them, or switch back to plain text for a freeform prompt. The schema shows up as readable JSON Schema instead of a raw Zod blob, and a reset restores the inherited config.
  • Structured JSON output, rendered properly. Model Runner output that comes back as JSON is now rendered as clean, formatted JSON instead of a wall of text.
  • Output conformance in the Prompt Runner. The Prompt Runner now supports output conformance, so prompts that define a structured schema behave consistently with the rest of the tooling.
  • Live streaming patches in the Agent Runner. Agent Runner now supports customPatch streaming, so incremental updates from your agent show up in the UI as they arrive.

Improvements & Fixes

  • No more garbled streamed text. Fixed a decoding bug where multi-byte characters (CJK, emoji, accented letters) split across network chunks would render as . Streamed output now decodes cleanly across chunk boundaries.
  • Structured output + tools now play nicely together. Schemas are sent under the field the generate action actually reads, so structured output no longer accidentally suppresses tool calls. The tool loop runs and applies the structured result on the final turn.
  • Real-time span metadata in traces. In-progress spans now keep their initial metadata (name, path, type) instead of dropping it, and show a clean -- placeholder for duration until the span completes.
  • Agent Runner session fixes. Switching from multi-turn (bidi) to single-turn mode no longer trips strict backends (e.g. Python/Pydantic) with extra_forbidden errors, session IDs update correctly when a bidi stream ends, and context is preserved when starting a new chat or loading a trace.
  • Manual tool responses are now sent as proper messages, and tool action cards render correctly when resuming or adding a model message with tool requests.
  • Interruptions callout added to the Tools page so it's clearer what's happening when a tool interrupts.
  • Dataset sample editor restored to its cleaner previous style, plus tidier JSON editor spacing.

New Contributors

Full Changelog: v1.40.1...v1.41.0

Genkit Python SDK v0.9.0

Choose a tag to compare

@huangjeff5huangjeff5 released this 31 Jul 22:28
5df1a38

Release Highlights: Genkit Python SDK v0.9.0

We are excited to announce the v0.9.0 release of the Genkit Python SDK! This landmark update introduces the official launch of Agents—bringing first-class, stateful multi-turn AI workflows to Python—alongside a complete plugin package reorganization on PyPI, enhanced observability, and improved provider compatibility.


Major Features

Official Agents Launch

  • Stateful Multi-Turn Workflows: Introduces core Agent and Session abstractions, providing a stateful, streaming layer built on top of generate.
  • Pluggable Session Persistence: Support for both server-managed session stores (InMemorySessionStore, FileSessionStore, etc.) and client-managed state snapshotting.
  • Human-in-the-Loop Interruption: Built-in support for tool approval and turn interrupts/resumes, allowing human intervention before executing sensitive operations.
  • Remote Agent Client & Transports: Seamless communication with local or remote agents over HTTP/WebSocket transports via remote_agent with automatic session history management (#5541).
  • Artifacts & Custom State: Stream, list, and persist session artifacts and custom state updates across multi-turn agent turns.

Plugin Package Reorganization & PyPI Launch

  • All plugins are now organized into dedicated, publishable PyPI packages (genkit-*).
  • Backward Compatibility: Existing/legacy plugin packages will continue to work seamlessly. When loaded, a friendly warning will prompt developers to update their dependencies to the new package names:
    • genkit (Core SDK)
    • genkit-anthropic (formerly genkit-plugin-anthropic)
    • genkit-django (formerly genkit-plugin-django)
    • genkit-evaluators (formerly genkit-plugin-evaluators)
    • genkit-fastapi (formerly genkit-plugin-fastapi)
    • genkit-flask (formerly genkit-plugin-flask)
    • genkit-google-cloud (formerly genkit-plugin-google-cloud)
    • genkit-google-genai (formerly genkit-plugin-google-genai)
    • genkit-middleware (formerly genkit-plugin-middleware)
    • genkit-ollama (formerly genkit-plugin-ollama)
    • genkit-openai (formerly genkit-plugin-openai)
    • genkit-vertexai (formerly genkit-plugin-vertexai)

Improvements & Bug Fixes

  • Session Management & Tracing: Recorded session state on runTurn spans and added support for client-managed sessionIds (#5871).
  • Gemini Compatibility:
    • Normalized request message roles strictly to model or user for strict API compatibility (#5823).
    • Switched tool request references to model call IDs (#5830).
  • Observability: Seeded span attributes at trace start so live traces render immediately in the Developer UI (#5808).
  • Runtime & CLI: Muted dev server health poll logs (#5867) and ensured reliable CLI runtime metadata cleanup on SIGINT/SIGTERM (#5773).
  • Anthropic Plugin: Added stable and beta API selection (#5752) and extended thinking capabilities.

Genkit Go v1.11.0

Choose a tag to compare

@apascal07apascal07 released this 24 Jul 17:15
bc4c733

What's Changed

  • feat(go): implement telemetry label propagation via context by @MichaelDoyle in #5666
  • feat(go/plugins/googlegenai): add Vertex AI multi-region and apiVersion support by @adesinah in #5772
  • feat(go/plugins/anthropic): register latest Claude models by @adesinah in #5519
  • fix(go/ai): allow media URLs in prompts without a content type by @apascal07 in #5793
  • fix(go/googlegenai): map tool role to user for Gemini content API by @pavelgj in #5782
  • fix(go/plugins/ollama): register embedders by model name, not server address by @IzaakGough in #5648
  • fix(agents): reject empty prompt-agent turns by @adesinah in #5744
  • docs(go): add experimental tools example and refresh README by @apascal07 in #5640

New Contributors

Full Changelog: go/v1.10.0...go/v1.11.0

Genkit Python SDK v0.8.0

Choose a tag to compare

@huangjeff5huangjeff5 released this 22 Jul 14:52
af7303e

Genkit Python SDK v0.8.0 Release Notes

Genkit Python SDK v0.8.0 is here! This targeted release focuses on expanded model support and multi-region routing in our Google GenAI & Vertex AI integration, along with a cleaner, modernized plugin packaging architecture for Python developers.

Important

Staged Rollout & Release Rationale: This release deliberately scopes published distributions to our foundational packages: genkit (core) 0.8.0, genkit-google-genai0.8.0, and a transition tombstone for genkit-plugin-google-genai0.8.0.

Why a staged release? We are modernizing our plugin architecture and aligning naming conventions across our entire suite (genkit-<provider>). Rather than holding up critical Gemini updates and compatibility fixes while we await internal naming review for the remaining plugins, we are releasing core and google-genai today. Once package naming review completes, a fast-follow release will upgrade the remaining plugins to 0.8.0.

Impact & Compatibility: All other plugin packages remain at 0.7.0 on PyPI. They have been verified and smoke-tested to interoperate seamlessly against core 0.8.0—requiring zero updates or intervention from developers using those integrations.


What's New

Expanded Google AI & Vertex AI Support

This release broadens model coverage and feature capabilities in genkit-google-genai:

  • Vertex AI Multi-Region Support: Added multi-region support with dynamic per-request location overrides, making it straightforward to route deployments across Google Cloud regions (#5763).
  • Multimodal Embeddings: Supported Vertex AI multimodal embeddings via :predict (#5649) and registered Gemini embedding-2 (#5596).
  • Expanded Model Catalog: Registered Gemini 3.1 text models (#5559, #5588), Gemini 3.x image generation suites (#5579), tuned Gemini endpoints (#5182), and Veo 3.x generative video models (#5174).

Breaking Changes & Migration

Package Rename & Namespace Modernization (#5703)

To align with standard Python ecosystem conventions, the Google GenAI plugin has been transitioned from genkit-plugin-google-genai to genkit-google-genai, and its primary module import path from genkit.plugins.google_genai to genkit_google_genai.

  • Core Namespace Clean-up: Core (genkit) no longer ships or initializes a central genkit.plugins namespace. Old genkit.plugins.* import paths are now dynamically served by individual installed plugin packages via standard Python namespace packaging—eliminating tight coupling and dependency bloat in core.
  • Zero-Downtime Transition (Tombstoning): Installing the legacy genkit-plugin-google-genai==0.8.0 package deploys a lightweight compatibility tombstone that automatically re-exports all classes from the new module while raising an actionable DeprecationWarning. Existing apps will continue running without immediate code changes, allowing teams to migrate incrementally.

Recommended Migration Step:

# Swap dependency naming in your project workspace
uv remove genkit-plugin-google-genai
uv add genkit-google-genai
-fromgenkit.plugins.google_genaiimportGoogleAI, VertexAI+fromgenkit_google_genaiimportGoogleAI, VertexAI

Refined Middleware Lifecycle Hooks (#5694)

For improved separation of concerns between conversational orchestration and transport layers, GenerateHookParams passed to wrap_generate no longer includes the transport request. It now provides clean access to options (GenerateActionOptions), iteration, and message_index.

  • Action Required for Custom Middleware Authors: Middleware inspecting params.request inside wrap_generate should transition to params.options. If you need direct access to raw HTTP model payloads, migrate your interceptor to wrap_model (via ModelHookParams.request) or wrap_tool (ToolHookParams) for tool execution intercepts.

Fixes & Polish

  • Gemini Tool Role Compatibility: Solved 400 Bad Request API rejections on Gemini 3.6 / gemini-flash-latest by mapping tool execution history turns from Role.TOOL to "user", ensuring compatibility with Gemini's strict turn-role validation (#5780).
  • Streaming Usage & Telemetry: Reported accurate finish reasons and cumulative token usage on Gemini generate_stream executions (#5736).
  • Model Discovery & Embedders: Fixed runtime discovery for Vertex AI models referenced by name (#5575) and ensured only callable Vertex embedders are listed in registries (#5695).
  • Generate Option Types: Updated output_instructions parameter in ai.generate() to accept boolean flags (#5681).
  • Core Stability: Resolved edge-case streaming syntax evaluation failures and a runtime crash on missing default parameter values (#5340).
  • Developer Experience: Added helpful onboarding feedback when GEMINI_API_KEY is missing from the environment (#5665), and promoted generic "latest" Gemini model aliases in documentation (#5540).

Genkit JS 1.40.1

Choose a tag to compare

@pavelgjpavelgj released this 21 Jul 19:33

What's Changed

  • fix(js/plugins/google-genai): map tool role to "user" for Gemini compatibility by @pavelgj in #5777

Full Changelog: v1.40.0...v1.40.1

Genkit JS and CLI 1.40.0

Choose a tag to compare

@pavelgjpavelgj released this 17 Jul 00:20

What's Changed

  • docs(js/genkit): add Agents section to README by @pavelgj in #5641
  • chore(js/plugins/google-genai): remove shutdown veo models by @ifielker in #5680
  • fix(agents)!: return not found for missing snapshots by @MichaelDoyle in #5715
  • feat(js/testing): mockModel + echoModel for genkit/testing by @cabljac in #5475
  • feat(js/plugins/anthropic): Support for Claude sonnet 5 by @ifielker in #5747
  • fix(genkit-tools): prevent path traversal and bind to localhost by @pavelgj in #5751
  • feat(js/plugins/vertexai/modelgarden): support for claude-sonnet-5 by @ifielker in #5721
  • fix(js): serialize callable middleware functions in reflection v2 listValues by @MichaelDoyle in #5748
  • feat(js/plugins/google-genai): Multi-region support by @ifielker in #5753
  • fix(compat-oai): accumulate streamed tool-call arguments in chunks by @pavelgj in #5754

New Contributors

Full Changelog: v1.39.0...v1.40.0

Genkit JS and CLI 1.39.0

Choose a tag to compare

@pavelgjpavelgj released this 26 Jun 19:17

⚠️ 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-configconstagent=ai.defineAgent({name: 'assistant',model: 'googleai/gemini-flash-latest',system: 'You are a helpful assistant.',tools: [searchTool],});// Reuse a registered .prompt (typed promptInput)constagent=ai.definePromptAgent({promptName: 'assistant',promptInput: {role: 'pirate'}});// Full control via a custom turn handlerconstagent=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 useChatid (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: v1.38.0...v1.39.0

Genkit Go v1.10.0

Choose a tag to compare

@apascal07apascal07 released this 26 Jun 20:37
2b555af

This release brings a first-class, experimental Agents API to Genkit Go. Agents bundle a model/prompt, conversational state, tool loops, interrupts, persistence, streaming, and abort/resume into a single ergonomic surface that runs identically in-process and over HTTP, one turn per request. The whole genkit/exp and ai/exp surface is in preview and gated behind a new WithExperimental() init option, so its APIs may change between minor releases.

Highlights

Agents — DefineAgent, DefinePromptAgent, DefineCustomAgent (#4462)

Define a multi-turn agent in a single call, with three levels of control: an inline prompt, a prompt from the registry, or a fully custom turn loop.

chatAgent:=genkit.DefineAgent(g, "chat",
aix.InlinePrompt{
ai.WithModelName("googleai/gemini-flash-latest"),
ai.WithSystem("You are a sarcastic pirate. Keep responses concise."),
},
aix.WithSessionStore(localstore.NewInMemorySessionStore[any]()),
)
// Single-turn:out, _:=chatAgent.RunText(ctx, "What is Go?")
fmt.Println(out.Message.Text())
// Multi-turn with streaming:conn, _:=chatAgent.Connect(ctx)
conn.SendText("What is Go?")
forchunk, _:=rangeconn.Receive() {
ifchunk.ModelChunk!=nil { fmt.Print(chunk.ModelChunk.Text()) }
ifchunk.TurnEnd!=nil { break }
}

Key capabilities:

  • Stateful, multi-turn chatsConnect / RunText thread messages, custom state, and session/snapshot IDs for you.
  • Typed custom state — the State type parameter is inferred from the typed agent options; a mismatch is a compile-time error.
  • Pluggable persistence via SessionStore (in-memory + file stores in ai/exp/localstore); resume by WithSessionID, WithSnapshotID, or client-kept WithState.
  • Live custom state — mutating state with Session.UpdateCustom auto-streams the delta to the client as an RFC 6902 JSON Patch; redaction-aware.
  • Background agentsDetach hands the rest of the work to the server, returning a pending snapshot ID the client can poll, fetch, or abort; detached turns heartbeat so a wedged worker becomes observable.
  • WithStateTransform / WithStreamTransform to redact or reshape state and stream chunks before they leave the server.
  • Graceful failure — an in-band turn error resolves as a failed AgentOutput with the last-good state preserved, costing only the failed turn.

Experimental tools, interrupts & streaming (#4797)

A new genkitx.DefineTool collapses DefineTool and DefineMultipartTool into one API with a plain context.Context signature, plus typed interrupts and partial (progress) streaming. These are intended to become the primary tool APIs in a future major release.

// Simple tool — plain context, multipart via tool.AttachParts.weatherTool:=genkitx.DefineTool(g, "getWeather", "Fetches the weather for a city",
func(ctx context.Context, inWeatherInput) (string, error) {
returnlookup(in.City), nil
},
)
// Interruptible tool — the *Res param is non-nil on resume.transferTool:=genkitx.DefineInterruptibleTool(g, "transfer", "Transfers money",
func(ctx context.Context, inTransferInput, confirm*Confirmation) (string, error) {
ifconfirm==nil&&in.Amount>100 {
return"", tool.Interrupt(TransferInterrupt{Amount: in.Amount})
}
return"completed", nil
},
)
restart, _:=transferTool.Resume(interrupt, Confirmation{Approved: true})

Tools can also stream progress mid-execution with tool.SendPartial; on the client these arrive as tool-response chunks distinguished by Part.IsPartial(). Interruptible tools work the same way inside an agent conversation, with the client resuming over the same connection via conn.SendResume.

Agent middleware: delegation & artifacts (#5603)

A new experimental plugins/middleware/exp package adds two composable generate middlewares for the agent APIs:

  • Agents — turns each referenced agent into a delegate_to_<name> tool and injects a <sub-agents> listing, so an orchestrator can delegate to registered sub-agents. Guard rails via MaxDelegations and HistoryLength.
  • Artifacts — gives the model read_artifact / write_artifact tools backed by the active session's artifacts. Pair with Agents{ArtifactStrategy: ArtifactStrategySession} so an orchestrator can read artifacts its sub-agents produced.
orchestrator:=genkit.DefineAgent(g, "orchestrator",
aix.InlinePrompt{
ai.WithModelName("googleai/gemini-flash-latest"),
ai.WithSystem("Delegate to the appropriate sub-agent, then synthesize an answer."),
ai.WithUse(
&middlewarex.Agents{
Agents: []aix.AgentRef{researcher.Ref(), engineer.Ref()},
ArtifactStrategy: middlewarex.ArtifactStrategySession,
},
&middlewarex.Artifacts{Readonly: true},
),
},
aix.WithSessionStore(store),
)

go/samples/basic-agents gains an orchestrator agent demonstrating delegation end to end.

Firestore session store (#5614)

FirestoreSessionStore, a Cloud Firestore-backed SessionStore in plugins/firebase/exp, persists each session as a chain of per-turn JSON Patch diffs anchored to periodic, sharded full-state checkpoints. 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 WithCollection, WithCheckpointInterval, and WithShardSize, with WithSnapshotPathPrefix for multi-tenant isolation.

g:=genkit.Init(ctx, genkit.WithExperimental(),
genkit.WithPlugins(&firebase.Firebase{ProjectId: "my-project"}))
store, _:=firebasex.NewFirestoreSessionStore[MyState](ctx, g)
agent:=genkit.DefineAgent(g, "assistant",
aix.InlinePrompt{ai.WithModelName("googleai/gemini-flash-latest")},
aix.WithSessionStore(store),
)

This release also consolidates the experimental Firebase package (plugins/firebase/xplugins/firebase/exp).

Bidirectional streaming actions — DefineBidiAction (#4387)

The foundation the Agents API is built on: experimental bidi actions in go/core that consume a stream of inputs while producing a stream of outputs, with a typed in-process Connect API and JSON transports wired through the reflection servers and HTTP handler. The wire protocol matches the JS runtime, so the Dev UI drives both the same way.

echo:=core.NewBidiAction("echo", api.ActionTypeCustom, nil,
func(ctx context.Context, cfgConfig, inCh<-chanstring, outChchan<-string) (string, error) {
forin:=rangeinCh {
outCh<-cfg.Prefix+in
}
return"done", nil
})
genkit.RegisterAction(g, echo)
conn, _:=echo.Connect(ctx, Config{Prefix: "> "})
conn.Send("hello"); conn.Close()
forchunk, _:=rangeconn.Receive() { /* "> hello" */ }
out, _:=conn.Output()

Supporting changes

  • WithExperimental() init gate (#5620) — the genkit/exp surface (agents, experimental tools, experimental flows) now requires genkit.Init(ctx, genkit.WithExperimental()). Calling it without the option panics with a message pointing at the fix, making the preview status explicit.
  • Realtime telemetry for live agents (#5637) — a new realtime span processor streams span_start / span_end events to the Dev UI over SSE so an in-progress agent invocation is visible as it runs, not only after it completes. The basic-agents sample is restructured into multiple agents (banker, chef, coder, pirate, orchestrator) with an interactive CLI.
  • Faster snapshot lookup via per-session pointer files (#5636)localstore writes a per-session pointer file so resolving a session's latest snapshot is a direct read instead of a directory scan.
  • FileSessionStore defaults to a "global" subdirectory (#5618) — snapshots now nest under a global prefix by default, aligning the file store's on-disk layout with the Firestore store's tenant-prefix scheme.
  • Agent conformance harness (#5576) — a shared conformance suite (tests/specs/agent.yaml) drives the Go agent runtime alongside JS, keeping cross-language behavior in lockstep.

Full Changelog: go/v1.9.0...go/v1.10.0

Genkit JS and CLI 1.39.0-rc.0

Pre-release

Choose a tag to compare

@pavelgjpavelgj released this 24 Jun 19:49

⚠️ 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-configconstagent=ai.defineAgent({name: 'assistant',model: 'googleai/gemini-flash-latest',system: 'You are a helpful assistant.',tools: [searchTool],});// Reuse a registered .prompt (typed promptInput)constagent=ai.definePromptAgent({promptName: 'assistant',promptInput: {role: 'pirate'}});// Full control via a custom turn handlerconstagent=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 useChatid (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: v1.38.0...v1.39.0-rc.0

Genkit JS and CLI 1.38.0

Choose a tag to compare

@pavelgjpavelgj released this 23 Jun 18:44

What's Changed

New Contributors

Full Changelog: v1.37.0...v1.38.0