Blog: Announcing Genkit Agents#307
Conversation
- Rewrite agents intro to highlight middleware support and be more concise - Add cross-link tip from agentic-patterns page to new agents page - Replace TypeScript interface examples with Zod schema-based state - Add "State management strategies" section for session state patterns - Improve beta import note formatting with callout block
- Reword page description and intro to focus on app-level use cases (chatbots, approval flows, generators) instead of internals - Fix incorrect `sess.session.addMessages()` → `sess.addMessages()` - Add paragraph explaining agents as standard HTTP endpoints - Enhance custom state section framing and add client-side code example
Capitalize "agents" to "Agents" in the introductory sentence for consistent branding with the rest of the documentation.
Expand documentation for defineAgent, definePromptAgent, and defineCustomAgent with more detailed descriptions, use-case bullet points, and inline code comments to help readers understand when and why to use each agent type.
Replaces the single interrupt example with two clearly separated patterns (resume.respond and resume.restart), adds a comparison table, and provides distinct server/client examples for each. Highlights security benefits of the restart pattern for approval-gated tools.
Revise the Agents documentation to reflect the unified API where server and client agents expose the same interface. Update import paths to include `genkit/beta/client`, make the `model` parameter optional (defaulting to the `genkit()` config), and clarify that custom status is streamed by mutating session state.
Add a quick-reference guide for the three ag
Change prompt example code fence from `none` to `handlebars` for proper syntax highlighting, and remove accidentally committed task progress metadata at the end of the file.
Expand the explanation of the agent server endpoints to distinguish the required primary endpoint from the optional snapshot and abort endpoints. Clarify that the snapshot endpoint applies only to server-managed agents with a store, and the abort endpoint only to background execution.
Update the agents guide to document `session.getCustom()` for reading state and `session.updateCustom()` for mutating it, with a new listTasks tool example. Improve state normalization to default per-field for fresh sessions, import `z` in the setup snippet, and clarify that `getSnapshotDataAction` and `abortAgentAction` are server-side agent properties rather than part of the shared `AgentAPI`.
Rewrite the agents documentation to follow a progressive disclosure approach. Replace the abstract unified-API introduction with a simpler explanation, and add "Your first agent" and "Add tools and serve over HTTP" sections that build incrementally from minimal to capable agents. Include links to advanced topics so readers can add capabilities as needed.
Streamline the agents page introduction for clarity and add a note explaining the interchangeable model reference syntax. Remove the ai.defineCustomAgent() documentation section.
…/NamedPrompt Match the reworked ai/exp API: FromInline becomes InlinePrompt, and FromPrompt splits into SameNamedPrompt (the prompt named like the agent) and NamedPrompt(name, input) for referencing any registered prompt by name. Adds the shared-prompt-across-agents example.
Mirror the Go API rework: DefineAgent takes an InlinePrompt slice literal and DefinePromptAgent backs an agent with a registry prompt (default same-named, or WithNamedPrompt), aligning the Go guide with the existing JS defineAgent/definePromptAgent split.
There was a problem hiding this comment.
Code Review
This pull request introduces a new blog post announcing Genkit Agents, featuring code examples in TypeScript, Go, and Dart. The review feedback points out a frontmatter validation issue where the authors field should be formatted as an array, an incorrect TypeScript import path for the Google Gen AI plugin, and syntax errors in the Go SDK initialization snippet, including unhandled errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
The Dart client will not be ready for the initial launch. Remove its tabbed code examples and prose references from the agent docs, unwrapping the JavaScript/Dart client tabs to plain JavaScript code blocks where Dart was the only other tab.
The Dart client will not be ready for the initial launch. Drop the Dart remote-client tabs and the JavaScript/Dart launch claim from the agents announcement post, unwrapping the client tabs to plain JavaScript blocks.
Add a "Use a Firestore store" section to the Go session-stores page, matching the existing JS coverage. Documents NewFirestoreSessionStore, its options (WithCollection, WithSnapshotPathPrefix, WithCheckpointInterval, WithShardSize), Firebase-plugin client resolution, and cross-instance abort via SnapshotSubscriber.
Replace the file-backed store with the Firestore session store so the Go tab matches the TypeScript tab, including auth-scoped snapshotPathPrefix.
Match the source draft: WithCollection("snapshots") plus
WithCheckpointInterval(10), dropping the auth-scoped prefix example.
Switch the Go interrupts guide from the older ai.InterruptWith / ctx.IsResumed pattern to genkitx.DefineInterruptibleTool with a typed resume payload, tool.Interrupt/tool.InterruptAs, and the tool's Resume/Respond methods, matching the agents sample and launch surface.
987867d to
81ebe23
Compare
2c5b813 to
5f56c37
Compare
Use the global author reference instead of an inline author object, and define the chris-gill author in the blog config.
|
Addressed in ee7d519:
The other two Gemini suggestions were verified against the current SDK source and are not applied because they're incorrect for current Genkit:
|
Sync the human-approval Go example with the source draft: use genkitx.DefineInterruptibleTool with a typed resume payload and tool.Interrupt, replacing the older DefineTool / ai.InterruptWith form.
Replace the 'Go has no agents() middleware, compose manually' section with docs for the new plugins/middleware/exp package: the Agents delegation middleware (Agents/ToolPrefix/MaxDelegations/HistoryLength/ ArtifactStrategy), the Artifacts middleware, sub-agent interrupt/failure handling, and optional plugin registration. Verified against the source and PR #5603.
# Conflicts: # astro.config.mjs
Adds the "Announcing Genkit Agents" blog post.
What's here
src/content/docs/blog/announcing-genkit-agents.mdxNotes
Stacked on top of #306 (
chgill/agent-docs), so this PR is based on that branch and shows only the blog-specific diff (the single.mdxfile). Once #306 merges, the base can be retargeted tomain.