Build AI Apps with Genkit Go
๐ **Source:** [Build AI Apps with Genkit Go](https://www.youtube.com/watch?v=zqCeeQteWGc)
> [!note]+ Document Notes
> tags: [genkit-go, ai-development, google-genkit]
> author: Google for Developers
> source: YouTube
> reference: https://www.youtube.com/watch?v=zqCeeQteWGc
> date created: 2024-12-28 10:30
>
> # ๐ท๏ธ Title: Build AI Apps with Genkit Go
>
<!-- deep-read:sections start -->
## ๐งฐ Action Inbox
- [H1] Set up Google GenAI API key as environment variable โ configuration requirement #setup
- [H2] Clone ELI5 demo repository and explore project structure โ hands-on learning #demo
- [H3] Test flows using `genkit start --run main.go` command โ development workflow #testing
## ๐งญ Table of Contents
- [๐ Summary](#-summary)
- [๐ Main Content](#-main-content)
- [๐๏ธ Notes](#๏ธ-notes)
- [๐ References](#-references)
- [๐ฃ๏ธ Paraphrase](#๏ธ-paraphrase)
- [๐ฐ Newsletter](#-newsletter)
- [โ
Action Items](#-action-items)
- [๐งช Hypotheses](#-hypotheses)
- [๐ Methodology](#-methodology)
- [โ Questions](#-questions)
- [๐ฎ Future Research](#-future-research)
- [๐ก Implications](#-implications)
- [๐ง Learning Styles Assessment](#-learning-styles-assessment)
- [๐ Accessibility Assessment](#-accessibility-assessment)
- [๐ DEIB Assessment](#-deib-assessment)
- [โ
Logical Validity](#-logical-validity)
- [๐ก๏ธ DARVO Analysis](#-darvo-analysis)
- [๐ฏ Conclusion](#-conclusion)
### ๐ References
- [ELI5 Demo Repository](https://github.com/firebase/genkit/tree/main/go/samples/rag)
- [Genkit Go Documentation](https://firebase.google.com/docs/genkit/go/get-started)
## ๐ Summary
- Google introduces Genkit Go, an open-source framework for building AI applications with Go's type safety and performance
- Framework addresses common pain points: complex model SDKs, poor debugging tools, and vendor lock-in
- Demonstrates ELI5 app with three flows: story generation, character creation, and illustration
- Provides unified API across multiple AI providers (Google AI, OpenAI, Anthropic)
- Key benefits include compile-time safety, built-in observability, and model-agnostic design
## ๐ Main Content
Genkit Go is Google's production-ready framework that brings Go's strengthsโtype safety, performance, and scalabilityโto AI application development. The framework solves critical challenges Go developers face when building AI applications, including navigating complex model-specific SDKs, lack of debugging tools, and vendor lock-in.
The framework uses three core concepts: Flows (strongly-typed observable functions that orchestrate AI logic), Plugins (connections to various model providers), and a Developer UI (full observability dashboard). The model-agnostic design allows developers to swap providers or models through configuration changes rather than code restructuring.
The tutorial demonstrates these concepts through the ELI5 demo application, which generates illustrated educational storybooks from questions. The demo showcases three main flows: storyifying questions into books, creating cartoon characters from images, and generating illustrations.
## ๐๏ธ Notes
#### โฑ๏ธ [00:00](https://youtu.be/zqCeeQteWGc?t=0) โ [H1] Common AI Development Pain Points
- Key idea: Go developers face ecosystem complexity and vendor lock-in when building AI apps
- Evidence: "Navigating complex ecosystem of model specific SDKs, lack of AI workload oriented design, poor debugging observability tools"
#### โฑ๏ธ [01:02](https://youtu.be/zqCeeQteWGc?t=62) โ [H2] Genkit Framework Introduction
- Key idea: Open-source framework built and used in production by Google with multi-language support
- Evidence: "Genkit is an open-source framework for building fullstack AI powered applications built and used in production by Google"
#### โฑ๏ธ [01:34](https://youtu.be/zqCeeQteWGc?t=94) โ [H3] Go-Specific Advantages
- Key idea: Leverages Go's compile-time safety and lightweight execution model for AI workloads
- Evidence: "Go's lightweight execution model allows your app to handle thousands of concurrent requests with ease"
#### โฑ๏ธ [02:15](https://youtu.be/zqCeeQteWGc?t=135) โ [H2] ELI5 Demo Application Overview
- Key idea: Sample app demonstrates three core flows for educational content generation
- Evidence: "Takes questions and generates illustrated educational story books"
#### โฑ๏ธ [02:45](https://youtu.be/zqCeeQteWGc?t=165) โ [H1] Core Genkit Concepts
- Key idea: Three foundational concepts enable type-safe AI development
- Evidence: "Flows are strongly typed observable Go functions that orchestrate AI logic"
#### โฑ๏ธ [03:30](https://youtu.be/zqCeeQteWGc?t=210) โ [H2] Model-Agnostic Design Benefits
- Key idea: Configuration-based provider switching prevents architectural lock-in
- Evidence: "Swap providers, models or platforms with a configuration change, not a rearchitecture"
#### โฑ๏ธ [04:15](https://youtu.be/zqCeeQteWGc?t=255) โ [H3] Developer UI Capabilities
- Key idea: Built-in observability eliminates print statement debugging for AI behavior
- Evidence: "See every prompt, response, and timing. No more print statement debugging for nondeterministic AI behavior"
#### โฑ๏ธ [05:00](https://youtu.be/zqCeeQteWGc?t=300) โ [H2] Development Workflow
- Key idea: Four-step process from typed structs to production deployment
- Evidence: "Write Go code with type safe structs. Start the dev server with Genkit start"
#### โฑ๏ธ [06:30](https://youtu.be/zqCeeQteWGc?t=390) โ [H3] Project Structure Walkthrough
- Key idea: Clean separation between flows, main entry point, and pre-built frontend
- Evidence: "The flows directory contains our three Genkit flows. Each is a self-contained Go file"
#### โฑ๏ธ [08:00](https://youtu.be/zqCeeQteWGc?t=480) โ [H1] Plugin Configuration Simplicity
- Key idea: Single line of code configures AI model provider with easy switching
- Evidence: "To use a different provider like OpenAI, you'd simply swap this to the OpenAI plugin"
#### โฑ๏ธ [09:45](https://youtu.be/zqCeeQteWGc?t=585) โ [H2] Type Safety with Go Structs
- Key idea: Compile-time contracts prevent runtime JSON errors and provide IDE support
- Evidence: "Instead of working with raw JSON strings and hoping the AI returns what you expect, you define the contract up front"
#### โฑ๏ธ [11:30](https://youtu.be/zqCeeQteWGc?t=690) โ [H3] Streaming Flow Implementation
- Key idea: Generic types enforce type safety while enabling real-time progress updates
- Evidence: "AI generation can take time. Instead of making users wait 30 seconds for a complete response, we can show progress updates"
#### โฑ๏ธ [13:15](https://youtu.be/zqCeeQteWGc?t=795) โ [H2] Unified Generation API
- Key idea: Single interface works across all model providers with consistent patterns
- Evidence: "Same function for any model. You don't need to learn different APIs for OpenAI, Anthropic or Google"
#### โฑ๏ธ [14:45](https://youtu.be/zqCeeQteWGc?t=885) โ [H3] Tool Integration Capabilities
- Key idea: First-class tool calling extends AI capabilities with custom business logic
- Evidence: "Tools let the AI search the web, query your database, or call your APIs, extending the AI's capabilities"
#### โฑ๏ธ [16:00](https://youtu.be/zqCeeQteWGc?t=960) โ [H1] Development Server Benefits
- Key idea: Single command starts integrated development environment with full observability
- Evidence: "This one command starts the Genkit developer UI runs our Go application and serves the front end"
## ๐ References
- [Genkit GitHub Repository](https://github.com/firebase/genkit)
- [Google GenAI API Documentation](https://ai.google.dev/)
- [Genkit Go Getting Started Guide](https://firebase.google.com/docs/genkit/go/get-started)
## ๐ฃ๏ธ Paraphrase
- Genkit Go solves the complexity problem in AI development by providing a unified framework that works with multiple model providers while maintaining Go's type safety and performance benefits
- The framework's three core components (Flows, Plugins, Developer UI) create an integrated development experience that eliminates common debugging challenges in AI applications
- Through the ELI5 demo, developers can see practical implementation of streaming AI flows, tool integration, and multi-model orchestration in a production-ready application structure
## ๐ฐ Newsletter
**Exciting AI Development News for Go Developers!**
Google has released Genkit Go, a production-ready framework that brings the power of AI to Go applications while maintaining the language's signature type safety and performance. This framework addresses the major pain points developers face when building AI applications - complex SDKs, poor debugging tools, and vendor lock-in.
**What makes this special:**
- **Type-safe AI development** with compile-time checking instead of runtime JSON errors
- **Model-agnostic design** that lets you switch between OpenAI, Google AI, and Anthropic with configuration changes
- **Built-in observability** that shows every prompt, response, and timing without print statement debugging
The ELI5 demo application showcases practical implementation with three flows for generating educational content. Developers can get started with just one command and immediately see their AI logic in action through the integrated developer UI.
**Get Started:**
- Clone the [ELI5 demo](https://github.com/firebase/genkit/tree/main/go/samples)
- Follow the [Genkit Go documentation](https://firebase.google.com/docs/genkit/go/get-started)
- Join the growing community of Go AI developers
This represents a significant step forward in making AI development more accessible and maintainable for the Go ecosystem.
## โ
Action Items
#### DevRel
- Developer advocacy: Create workshop series on Genkit Go for Go meetups and conferences, develop metrics for framework adoption
- Education: Build comprehensive tutorial series covering advanced patterns, create office hours for Go AI developers
- Developer experience: Improve getting started documentation, create more sample applications beyond ELI5
- Developer marketing: Launch campaign targeting Go community, create content comparing Genkit to other AI frameworks
- Community management: Establish GitHub discussions, create feedback channels for framework improvements
#### OSPO
- License Compliance: Review Genkit Go licensing for enterprise adoption, ensure compliance documentation
- Security Management: Establish vulnerability reporting process for AI-specific security issues
- Software Inventory: Document AI model dependencies and provider integrations in SBOM
- Developer Support: Create training materials for internal teams, establish consultation process
- Community Engagement: Fund upstream contributions to Go AI ecosystem, establish partnership agreements
#### Community
- Maintainers: Support Genkit Go roadmap development, create governance templates for AI framework projects
- Contributors: Develop onboarding guide for Genkit Go contributors, create first-issue programs for Go developers
- Sponsors: Create transparent budget for AI framework development, publish impact reports on community adoption
- Ecosystem: Coordinate with other Go AI projects, establish cross-project compatibility standards
## ๐งช Hypotheses
- Go developers will adopt Genkit faster than JavaScript/Python alternatives due to type safety benefits
- Model-agnostic design will reduce vendor lock-in concerns and increase enterprise AI adoption
- Built-in observability will significantly reduce debugging time for AI applications
- Streaming flows will improve user experience in AI applications with long generation times
### ๐ Methodology
- Survey Go community on current AI development pain points and framework preferences
- A/B test development velocity between Genkit Go and traditional AI development approaches
- Measure debugging time reduction through developer UI usage analytics and developer surveys
### โ Questions
- How does Genkit Go performance compare to direct model provider SDKs under high concurrent load?
- What adoption barriers exist for teams already invested in other AI frameworks?
- How will the framework evolve to support emerging AI capabilities like multi-modal reasoning?
### ๐ฎ Future Research
- Integration patterns with existing Go microservices architectures and AI workloads
- Performance optimization techniques for Genkit Go in production environments
- Extension mechanisms for custom model providers and specialized AI tools
### ๐ก Implications
- Practice: Standardizes AI development patterns across Go teams, reduces onboarding time for AI features
- Policy: May influence enterprise AI governance through improved observability and auditability
- Security: Built-in tracing could improve AI security monitoring and compliance reporting
- Education: Requires new curriculum for Go developers entering AI development
- Funding: Could shift AI infrastructure spending toward multi-provider strategies rather than vendor-specific solutions
### ๐ง Learning Styles Assessment
Reading level estimate: 10th Grade (Flesch-Kincaid Grade Level)
#### ๐ Visual learners
- Present: Code examples, project structure diagrams, developer UI screenshots
- Improve: Architecture diagrams showing flow execution, visual comparison charts between frameworks
#### ๐ Aural learners
- Present: Video tutorial with clear narration and step-by-step explanation
- Improve: Audio-only version highlighting key concepts, podcast-style discussion of benefits
#### ๐ฃ๏ธ Verbal learners
- Present: Clear definitions of flows/plugins/UI, analogies comparing to traditional development
- Improve: Glossary of AI development terms, more real-world analogies for abstract concepts
#### ๐งฉ Kinesthetic learners
- Present: Hands-on demo with clone-and-run instructions, interactive developer UI
- Improve: Step-by-step coding exercises, progressive difficulty labs, experimental sandboxes
#### ๐ง Logical learners
- Present: Structured flow from problems to solutions, clear development timeline
- Improve: Decision trees for provider selection, performance comparison tables, cost-benefit analysis
#### ๐งโ๐คโ๐ง Social learners
- Present: Community references, production usage at Google
- Improve: Developer community forums, pair programming guides, collaborative project templates
#### ๐งโโ๏ธ Solitary learners
- Present: Self-contained demo project, independent exploration opportunities
- Improve: Self-assessment quizzes, personal project idea generators, reflection prompts
#### ๐ฟ Naturalistic learners
- Present: Ecosystem thinking about AI model providers and framework integration
- Improve: AI development lifecycle analogies, sustainability considerations for model usage
### ๐ Accessibility Assessment
#### Screen reader semantics
- Present: Video has clear spoken narration describing code and UI elements
- Improve: Provide detailed alt text for code screenshots, ensure proper heading structure in documentation
#### Keyboard navigation
- Present: Developer UI appears to support standard web navigation patterns
- Improve: Verify all interactive elements are keyboard accessible, add skip links for complex traces
#### Contrast and readability
- Present: Code examples have sufficient contrast in IDE themes
- Improve: Ensure developer UI meets WCAG contrast requirements, provide high contrast theme option
#### Text resizing and reflow
- Present: Video content scales with browser zoom
- Improve: Test developer UI responsive design at 200% zoom, ensure code doesn't clip
#### Media and captions
- Present: Tutorial video provides comprehensive spoken explanation
- Improve: Add closed captions for video content, provide downloadable transcript
#### Forms and interactions
- Present: Demo shows form interactions for testing flows
- Improve: Ensure error messages are accessible, verify form labels are properly associated
#### Standards reference
- Map developer UI components to WCAG 2.2 AA success criteria for web-based development tools
### ๐ DEIB Assessment
#### Cultural breadth
- Present: Technical content focuses on universal programming concepts
- Improve: Include examples from diverse geographic regions, consider non-English developer needs
#### Inclusive language
- Present: Uses clear technical terminology, avoids complex idioms
- Improve: Define AI/ML jargon for developers new to the space, use plain language summaries
#### Neurodiversity support
- Present: Well-structured content with consistent code formatting
- Improve: Add content navigation aids, provide multiple learning path options
#### Representation
- Present: Focuses on technical content without explicit representation
- Improve
---
## Full Transcript
[00:02] If you are a go developer building AI<br>[00:05] applications, you've probably hit the<br>[00:07] same pain points. Navigating a complex<br>[00:10] ecosystem of model specific SDKs, lack<br>[00:14] of AI workload oriented design, poor<br>[00:18] debugging observability tools and being<br>[00:21] locked into a single model provider.<br>[00:24] Genkit can help. Genkit is an<br>[00:27] open-source framework for building<br>[00:29] fullstack AI powered applications built<br>[00:32] and used in production by Google. It<br>[00:35] provides SDKs for multiple programming<br>[00:38] languages including JavaScript, Python,<br>[00:41] and Go. Genkit Go is a production<br>[00:44] framework with obserability, type<br>[00:46] safety, and composibility. It supports<br>[00:49] multiple model providers, not just<br>[00:51] Google, and brings Go strengths, type<br>[00:54] safety, performance, and scalability to<br>[00:57] AI development. Go's lightweight<br>[01:00] execution model allows your app to<br>[01:02] handle thousands of concurrent requests<br>[01:04] with ease. You also get compile time<br>[01:07] safety instead of only discovering<br>[01:09] issues with your code at runtime. In<br>[01:12] this tutorial, we'll explore Genkit Go<br>[01:15] using the EI5 demo, a sample application<br>[01:18] that takes questions and generates<br>[01:20] illustrated educational story books. The<br>[01:23] demo showcases three flows, generating<br>[01:26] story books from questions, creating<br>[01:28] cartoon characters from user images, and<br>[01:32] generating illustrations. More<br>[01:34] importantly, we'll see how we can solve<br>[01:36] the real challenges Go developers face<br>[01:39] when building with AI. If you are new to<br>[01:42] Genkit, here are the key concepts you<br>[01:45] need to know from a Go developers<br>[01:47] perspective. Flows are strongly typed<br>[01:51] observable Go functions that orchestrate<br>[01:54] AI logic. They are essentially API<br>[01:57] handlers with built-in observability.<br>[02:00] Plugins connect to the model providers<br>[02:03] Google AI, OpenAI, Antropic and more.<br>[02:08] This model agnostic design means your<br>[02:10] application is futurep proof. Swap<br>[02:13] providers, models or platforms with a<br>[02:16] configuration change, not a<br>[02:19] rearchitecture.<br>[02:20] Developer UI gives you full<br>[02:23] observability. See every prompt,<br>[02:26] response, and timing. No more print<br>[02:29] statement debugging for nondeterministic<br>[02:32] AI behavior. You can also rapidly test<br>[02:35] your AI logic and tinker with different<br>[02:38] models and prompts. Here's the<br>[02:41] development loop. You write Go code with<br>[02:43] type safe strcts. Start the dev server<br>[02:46] with Genkit start. Test and debug in the<br>[02:50] dev UI with full trace visibility. And<br>[02:54] when you're ready, deploy to production.<br>[02:56] Let's dive into the code and see how it<br>[02:59] works in practice with the ELI5 demo.<br>[03:03] Before we get started, let's clone the<br>[03:05] LI5 demo repository from GitHub and open<br>[03:09] it in our ID. This is a Go application<br>[03:13] with a React front end, but we'll focus<br>[03:16] on the Go back end today.<br>[03:18] Now that we cloned the ripple, let's<br>[03:21] look at the project structure. The flows<br>[03:23] directory contains our three Genkit<br>[03:26] flows. Each is a self-contained Go file<br>[03:29] that defines an AI powered feature.<br>[03:33] Storyify takes a question and generates<br>[03:36] an illustrated story book. Cartoon turns<br>[03:40] a selfie into a cartoon character. And<br>[03:43] Illustrates generates images for the<br>[03:46] story book pages.<br>[03:48] Main.go Go is the entry point that<br>[03:51] initializes Genkit, registers the flows,<br>[03:55] and sets up the HTTP server. The client<br>[03:59] directory contains the React front end,<br>[04:02] but it's pre-built and served as static<br>[04:04] files by our Go server. We won't need to<br>[04:07] touch it. That's the project structure.<br>[04:10] Now, let's look at how we configure<br>[04:12] Genkit.<br>[04:14] Let's start with plug-in setup. This is<br>[04:17] where we configure our AI model<br>[04:19] provider. In main.go, we initialize<br>[04:22] Genkit with the Google AI plug-in. It's<br>[04:25] just a single line of code. To use a<br>[04:28] different provider like OpenAI, you'd<br>[04:31] simply swap this to the OpenAI. OpenAI<br>[04:35] plug-in. Your flows don't change. That's<br>[04:38] the power of model agnostic design. And<br>[04:42] it's not just about model providers. You<br>[04:45] can also switch platforms. You can run<br>[04:48] locally during development and deploy to<br>[04:50] the cloud in production with a<br>[04:52] configuration change, not a<br>[04:54] rearchitecture.<br>[04:56] You will need to set up your Google<br>[04:59] Genai API key as an environment<br>[05:02] variable. But that's it for setup.<br>[05:05] This is all the configuration you need.<br>[05:08] One plug-in line and one environment<br>[05:10] variable. Compare that to other<br>[05:13] frameworks where you might need separate<br>[05:15] SDKs, different API patterns or platform<br>[05:19] specific code. With Genkit, your<br>[05:23] application code stays the same even if<br>[05:26] you change providers or platforms. You<br>[05:29] just update your configuration.<br>[05:32] Now, let's look at how we define flows.<br>[05:36] This is where Genkit's Go Native<br>[05:38] approach really stands out. We start<br>[05:41] with gostructs that define our input and<br>[05:44] output types. This is the foundation of<br>[05:47] Jenkit's type safety. Instead of working<br>[05:50] with raw JSON strings and hoping the AI<br>[05:54] returns what you expect, you define the<br>[05:56] contract up front. These structs define<br>[05:59] the contract. Storyify request is what<br>[06:02] comes in just a question string. Story<br>[06:05] book is what comes out. A structured<br>[06:08] book with pages. The JSON schema tags on<br>[06:12] page automatically generate schemas for<br>[06:15] the dev UI. So when you test your flow,<br>[06:18] it knows exactly what fields to expect.<br>[06:21] The strcts themselves are compile time<br>[06:23] checked go code. And if the AI returns<br>[06:27] something that doesn't match your strct,<br>[06:30] Genkit surface a clear error at the<br>[06:32] boundary instead of silently accepting<br>[06:35] bad JSON. This means that you'll catch<br>[06:38] problems during development, not later<br>[06:41] when a user hits a runtime error. Now<br>[06:45] let's define the flow itself. For this,<br>[06:47] we use Genkit define streaming flow.<br>[06:51] Notice the generic types input, output,<br>[06:54] and stream chunk. These generics ensure<br>[06:57] that your input and output types are<br>[07:00] enforced throughout the entire flow. The<br>[07:03] compiler won't let you pass the wrong<br>[07:05] type and your ID will give you<br>[07:08] autocomplete based on these exact strs.<br>[07:11] The function signature is clear context<br>[07:15] request and ascension call back for<br>[07:18] streaming. This is a streaming flow. So<br>[07:21] we can send incremental updates to the<br>[07:24] clients. Why does this matter? AI<br>[07:28] generation can take time. Instead of<br>[07:30] making users wait 30 seconds for a<br>[07:32] complete response, we can show progress<br>[07:35] updates as the story book is being<br>[07:37] built. Inside the flow, we make our<br>[07:41] first AI call. This is the unifi<br>[07:44] generation API. Same function for any<br>[07:47] model. You don't need to learn different<br>[07:50] APIs for OpenAI, Antropic or Google.<br>[07:54] Instead, we can use one function with a<br>[07:57] consistent interface.<br>[08:00] We specify the model with AI dot with<br>[08:03] model name and use structure prompts<br>[08:06] with template variables for<br>[08:08] maintainability.<br>[08:10] Notice we are using Google search as a<br>[08:13] tool. Tool calling is a first class<br>[08:17] feature. AI models don't have access to<br>[08:20] real-time data or your internal systems.<br>[08:24] Tools let the AI search the web, query<br>[08:27] your database, or call your APIs,<br>[08:30] extending the AI's capabilities with<br>[08:33] your own business logic.<br>[08:35] The second call uses Genkit.generate<br>[08:38] data with our storybook type. Notice the<br>[08:42] type parameter<br>[08:44] generate data story book. This tells<br>[08:48] Genkit exactly what structure to expect<br>[08:51] and it automatically parses the JSON<br>[08:53] response into our go struct. No JSON on<br>[08:57] Marshall no error handling for malform<br>[09:00] JSON. It's all built in.<br>[09:04] Notice we are using a different model<br>[09:06] here. If you need fine grain control,<br>[09:09] you can add AI with config to pass<br>[09:14] custom parameters. This lets you stick<br>[09:17] to the unified gen kit interface but<br>[09:20] still leverage the unique features like<br>[09:22] specific safety settings or generation<br>[09:26] parameters of the underlying model. This<br>[09:29] helps optimize cost and performance by<br>[09:33] choosing the right model and<br>[09:34] configuration for each task.<br>[09:38] And that's it, the complete flow. Think<br>[09:41] about the alternative. You'd be writing<br>[09:43] JSON on Marshall, checking for errors,<br>[09:46] handling cases where the AI returns<br>[09:48] unexpected fields or debugging Y<br>[09:51] storybook. Pages is no. With Genkit, if<br>[09:56] the AI doesn't return valid JSON that<br>[09:59] matches your strct, you get a clear<br>[10:01] error. The type system is your safety<br>[10:04] net. This is what Go Native AI<br>[10:07] development looks like. type safe,<br>[10:10] compile time checked, and ready for<br>[10:12] realworld use. Now, let's start the<br>[10:15] development server. This is one of the<br>[10:18] kits key strengths, a better developer<br>[10:21] experience. Make sure we're in this<br>[10:24] samples/I5_G<br>[10:27] directory where main.go is located. Then<br>[10:31] we use a single command genkit start-<br>[10:35] dash run main.go Go. This one command<br>[10:40] starts the Genkit developer UI runs our<br>[10:43] Go application and serves the front end.<br>[10:47] Genkit automatically discovers all our<br>[10:50] flows so they appear in the dev UI<br>[10:53] without any extra configuration.<br>[10:56] The dev UI opens in the browser at local<br>[10:59] host 4,000.<br>[11:02] Here we can see our flows cartoonify,<br>[11:06] illustrate and storyify.<br>[11:09] This is our testing and observability<br>[11:11] interface. The go server also serves our<br>[11:15] front-end application at localhost 3001.<br>[11:19] This is the ELI5 app that users will<br>[11:22] interact with.<br>[11:25] With one command, we got three services<br>[11:28] running. Dev UI for testing and<br>[11:30] debugging, the go back end with our<br>[11:33] flows and the front- end application.<br>[11:36] This is the convenience of Genkit's<br>[11:39] integrated developer experience.<br>[11:42] Let's check out the application in<br>[11:44] action. Here's the front end at Locos<br>[11:47] 3001.<br>[11:49] A user can ask a question like how those<br>[11:52] photosynthesis work and get an<br>[11:55] illustrated story book. You can see how<br>[11:58] the client calls our go backend flows<br>[12:00] via HTTP endpoints.<br>[12:03] Every time a flow runs, whether from the<br>[12:06] client or dev UI, Genkit automatically<br>[12:10] creates a trace. This happens without<br>[12:13] having to write extra code.<br>[12:16] Now, let's switch to the dev UI to see<br>[12:19] the observability in action. Here, we<br>[12:22] can see all the traces from our flow<br>[12:24] executions. Let's look at the storyified<br>[12:27] trace from that execution.<br>[12:30] This is what makes Genkit's<br>[12:32] observability powerful.<br>[12:35] This is the trace view. We can see the<br>[12:37] complete execution timeline. Here's the<br>[12:40] first AI call. We can see the exact<br>[12:43] prompt that was sent, the model's<br>[12:46] response with the row output, and notice<br>[12:49] the timing information showing how long<br>[12:51] each step took. Here's the second AI<br>[12:55] call generating the story book. We can<br>[12:58] see the streaming updates as they come<br>[13:00] in and the structured output being built<br>[13:02] incrementally.<br>[13:04] This is full visibility into the AI's<br>[13:07] thought process.<br>[13:09] Compare this to traditional Go<br>[13:11] debugging. You'll be adding print<br>[13:13] statements and guessing what happened.<br>[13:16] With Gen Kit, you'll see everything. the<br>[13:18] prompt, the response, the timing, the<br>[13:21] structure output. This is very useful<br>[13:23] for debugging nondeterministic AI<br>[13:26] behavior.<br>[13:28] Let's also look at the illustrate trace<br>[13:30] to see media generation.<br>[13:33] The illustrate flow uses Gemini's image<br>[13:36] generation model to create<br>[13:38] illustrations. Take a look. The dev UI<br>[13:41] renders the generated image directly in<br>[13:44] the trace view. This is full<br>[13:46] observability for multimodel AI. You can<br>[13:50] see images, audio, and other media types<br>[13:53] right in the trace. No more guessing<br>[13:56] what the AI generated. You can see it<br>[13:59] rendered in real time.<br>[14:02] The code for media handling is<br>[14:04] straightforward. AI dot new media part<br>[14:07] for input and checking part is media for<br>[14:11] output.<br>[14:12] This is how you need to work with<br>[14:14] images, audio, or any other media types<br>[14:17] in your flows.<br>[14:20] Let's go back to the code and talk about<br>[14:22] composability.<br>[14:24] Flows are composable. You can chain<br>[14:27] multiple AI steps together.<br>[14:30] In the story flow, we make two AI calls<br>[14:34] with custom go logic in between.<br>[14:37] We can insert any goal code, database<br>[14:40] lookups, business rules, concurrency<br>[14:43] patterns. This is just go code. You'll<br>[14:46] have full flexibility.<br>[14:48] Notice the status updates. We're using<br>[14:51] the streaming callback to send progress<br>[14:53] updates. Finally, we'll look at how we<br>[14:56] expose these flows to the world. We use<br>[14:59] genkit.andler handler to automatically<br>[15:02] turn our go flows into standard HTTP<br>[15:05] endpoints like / API/ify<br>[15:09] or / API/Cartonify<br>[15:13] which our front end can call directly.<br>[15:16] This highlights a key architecture<br>[15:18] strength. Genkit's transport protocol is<br>[15:22] standardized across languages.<br>[15:25] This means your go back end can<br>[15:27] seamlessly serve any client.<br>[15:31] You get the best of both worlds by<br>[15:33] combining the performance and<br>[15:35] concurrency of a go back end with the<br>[15:39] freedom to build your front end in<br>[15:41] whatever stack you prefer. And that's<br>[15:44] it. We've covered a lot here. We've gone<br>[15:48] over how Genkit Go is a productionready<br>[15:51] Go native AI framework. The developer UI<br>[15:54] provides full observability.<br>[15:57] No more blind debugging. Type safety<br>[16:00] with gostructs enforce contracts at<br>[16:02] compile time. Model agnostic design lets<br>[16:06] you swap providers easily. And flows are<br>[16:10] composable. You can insert custom go<br>[16:12] logic anywhere.<br>[16:14] This framework brings goals strengths,<br>[16:17] type safety, performance, and<br>[16:19] scalability to AI development.<br>[16:22] If you are feeling inspired, there's<br>[16:24] more you can dive into. You can explore<br>[16:27] other flows in this ripple, check out<br>[16:29] the Aentic pattern sample, read the<br>[16:32] Genkit Go documentation, and most<br>[16:35] importantly, build your own flows.<br>[16:38] Thanks for watching and have fun<br>[16:40] building with Genkit Go.
<!-- deep-read:sections end -->