developing-genkit-go

Build AI applications, flows, and agents in Go using the Genkit SDK.

Updated May 11, 2026
One-click install
npx skills add https://github.com/alon3153/upe-social-publisher --skill developing-genkit-go-alon3153
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-genkit-go
Source: https://github.com/alon3153/upe-social-publisher/tree/main/.agents/skills/developing-genkit-go
Command: npx skills add https://github.com/alon3153/upe-social-publisher --skill developing-genkit-go-alon3153

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building AI features in Go typically requires hand-rolling provider integrations, prompt management, streaming, tool calling, and observability from scratch. This Skill provides the patterns and references to implement generation, structured output, tools, flows, and multi-turn agents with the Genkit Go SDK through a unified interface across model providers. ## Core Features & Use Cases - Generation & Structured Output: Use GenerateText, Generate, GenerateData, and streaming variants with typed Go structs and JSON schema tags. - Flows & HTTP Deployment: Wrap AI logic in DefineFlow or DefineStreamingFlow and serve it over HTTP with genkit.Handler for tracing and observability. - Experimental Agents: Build persistent multi-turn agents with sessions, snapshots, interrupts, branching, background execution, artifacts, and multi-agent orchestration. - Use Case: A developer needs a Go service that answers user questions with tool calling and streams responses over HTTP. They define tools and a flow, serve it with genkit.Handler, and verify behavior with genkit CLI traces. ## Quick Start Ask the AI to create a Genkit Go flow that generates a joke about a given topic and serves it over HTTP using the Google AI plugin.

Frequently Asked Questions about developing-genkit-go

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate structured output from an LLM in Go?▼

Use genkit.GenerateData with a typed Go struct as the type parameter. Add jsonschema description tags to struct fields so the model understands what each field should contain, which significantly improves structured output quality.

How do I build a multi-turn AI agent in Go with Genkit?▼

Use genkitx.DefineAgent from the genkit/exp package with an inline prompt, tools, and optionally a session store. Initialize Genkit with genkit.WithExperimental() first, since agent constructors panic without it.

Which model providers does Genkit Go support?▼

Genkit Go supports Google AI and Vertex AI via plugins/googlegenai, Anthropic via plugins/anthropic, OpenAI-compatible APIs via plugins/compat_oai, and local models via plugins/ollama. All plugins ship in the same Go module under plugins/.

Why should I run my Genkit Go app with the genkit CLI?▼

Running with genkit start captures traces of every Genkit action, letting you inspect prompts, model inputs and outputs, tool calls, and errors. Running directly with go run skips trace capture, leaving you debugging blind.

When should I use a flow instead of an agent in Genkit Go?▼

Use a plain flow for single-shot, stateless generation tasks. Use DefineAgent when the task is conversational, multi-turn, or described as an assistant or chatbot, since agents add sessions, state, interrupts, and branching.

Can Genkit Go agents pause for human approval?▼

Yes, using DefineInterruptibleTool, which pauses a turn via tool.Interrupt and resumes with a typed resume payload. Interrupts work with or without a session store, and the ToolApproval middleware can gate arbitrary tools.