Genkit AI v1.39.0: New Agents API, Middleware, and Vercel Integration
Genkit AI v1.39.0 introduces a major overhaul with the removal of the beta Chat API and the introduction of a new, first-class Agents API. This new API offers enhanced capabilities for building multi-turn conversational experiences, including state management, tool integration, persistence, and streaming. The release also includes new middleware for agent orchestration and artifact handling, a Vercel AI SDK adapter for seamless UI integration, and a Firestore session store for enhanced persistence. This update is crucial for developers using Genkit, particularly those building complex conversational agents.
- →Chat API removed, replaced by new Agents API
- →Introducing the new Agents API for multi-turn conversations
- →Middleware for agent orchestration and artifact handling
- →Vercel AI SDK adapter for seamless UI integration
- →Firestore session store for persistent agent data
Breaking changes (1) ›
- Chat API removed, replaced by new Agents API
The beta Chat API, including the `Chat` class and `ai.chat(...)` methods, has been removed. Developers must migrate to the new `ai.defineAgent(...)` and `agent.chat()` API for multi-turn agent functionality.
Features (4) ›
- Introducing the new Agents API for multi-turn conversations
The new Agents API provides a first-class, transport-agnostic surface for defining multi-turn agents. It bundles model, prompt, conversational state, tool loops, persistence, and streaming, offering granular control via `defineAgent`, `definePromptAgent`, and `defineCustomAgent`.
- Middleware for agent orchestration and artifact handling
New middleware includes `agents()` for orchestrating multiple agents by delegating tasks and `artifacts()` for providing models with `read_artifact` and `write_artifact` tools, backed by session state.
- Vercel AI SDK adapter for seamless UI integration
A new `@genkit-ai/vercel-ai` plugin offers a `ChatTransport` compatible with Vercel AI SDK's `useChat`, enabling React chat UIs with server-managed sessions and first-class interrupt handling.
- Firestore session store for persistent agent data
The `FirestoreSessionStore` allows for persistent storage of agent sessions using incremental JSON Patch diffs and sharded full-state checkpoints to manage document size and ensure strong consistency.
Enhancements (1) ›
- Initialization data for flows and actions
Flows and actions can now declare an `initSchema` to receive validated initialization data separately from input, supported across various Genkit handlers and client APIs.
https://github.com/genkit-ai/genkit/releases/tag/v1.39.0