Skip to content

Blog: Announcing Genkit Agents#307

Open
chrisraygill wants to merge 78 commits into
mainfrom
chgill/agents-blog
Open

Blog: Announcing Genkit Agents#307
chrisraygill wants to merge 78 commits into
mainfrom
chgill/agents-blog

Conversation

@chrisraygill

@chrisraygill chrisraygill commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Adds the "Announcing Genkit Agents" blog post.

What's here

  • New post at src/content/docs/blog/announcing-genkit-agents.mdx
  • Beta callout in the intro
  • Tabbed resume/branch snippet
  • Model moved into the agent definitions in examples

Notes

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 .mdx file). Once #306 merges, the base can be retargeted to main.

pavelgj and others added 30 commits May 8, 2026 16:01
- 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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/content/docs/blog/announcing-genkit-agents.mdx Outdated
Comment thread src/content/docs/blog/announcing-genkit-agents.mdx
Comment thread src/content/docs/blog/announcing-genkit-agents.mdx
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.
Comment thread src/content/docs/blog/announcing-genkit-agents.mdx Outdated
Use the global author reference instead of an inline author object, and
define the chris-gill author in the blog config.
@chrisraygill

Copy link
Copy Markdown
Collaborator Author

Addressed in ee7d519:

  • @nohe427 (authors) — Switched the frontmatter to authors: chris-gill and defined a chris-gill author in the global blog authors config in astro.config.mjs (only genkit existed before), so the key resolves. This also covers the Gemini comment about the authors field shape.

The other two Gemini suggestions were verified against the current SDK source and are not applied because they're incorrect for current Genkit:

  • TS import — The package is @genkit-ai/google-genai (exports googleAI); @genkit-ai/googleai is the old, pre-consolidation name. Snippet is correct as-is.
  • Go initgenkit.Init(ctx, ...) returns *genkit.Genkit (no error to handle), and the Google GenAI plugin is the struct &googlegenai.GoogleAI{} passed to WithPlugins. There is no googleai.Init(ctx, nil) constructor. Snippet is correct as-is.

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.
Base automatically changed from chgill/agent-docs to main June 26, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants