Architecture Overview
At the heart of Genkit is a Registry that manages all actions (flows, tools, models, prompts, etc.) and coordinates between your application code, plugins, and observability systems.Core Components
Registry
The Registry is Genkit’s central nervous system. It:- Stores all actions: Flows, tools, models, prompts, embedders, and retrievers
- Resolves actions by name: Looks up actions when you reference them (e.g.,
model='googleai/gemini-2.0-flash') - Manages plugins: Coordinates plugin initialization and action resolution
- Powers the Dev UI: Provides the Reflection API that lets the Developer UI discover and run your actions
Actions
Everything in Genkit is an Action - a unit of work with:- Name and kind: Identifies the action type (flow, tool, model, etc.)
- Input/output schemas: Type-safe contracts using Zod (JS) or Pydantic (Python)
- Execution function: The actual code that runs
- Automatic tracing: Every action execution is recorded for observability
Plugins
Plugins extend Genkit’s capabilities. Each plugin:- Implements a common interface:
Pluginbase class withinit(),resolve(), andlist_actions()methods - Loads lazily: Only initialized when first used, not at startup
- Registers actions: Can pre-register actions during
init()or resolve them on-demand - Has a namespace: Prevents naming conflicts (e.g.,
googleai/gemini-2.0-flash)
Plugin Lifecycle
Plugins go through four phases:Action Resolution
When you reference an action by name, the Registry uses a multi-step resolution algorithm:Tracing and Observability
Genkit automatically instruments all actions with OpenTelemetry tracing:- Input and output data
- Execution duration
- Error information (if any)
- Custom metadata
Multi-Language Support
Genkit maintains feature parity across three languages:| Language | Package | Status |
|---|---|---|
| JavaScript/TypeScript | genkit | Primary SDK |
| Python | genkit | Feature parity with JS |
| Go | github.com/firebase/genkit/go/core | Production-ready |
- Same plugin model
- Same action types
- Same tracing integration
- Same Dev UI support
Next Steps
- Learn about Flows - the building blocks of Genkit applications
- Explore Plugins - how to extend Genkit’s capabilities
- Understand Observability - tracing and monitoring your AI apps