Skip to main content
Genkit is designed around a flexible, plugin-based architecture that makes it easy to build AI applications with any model provider, telemetry backend, or vector store.

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: Plugin base class with init(), resolve(), and list_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:
Every action execution creates a span with:
  • Input and output data
  • Execution duration
  • Error information (if any)
  • Custom metadata

Multi-Language Support

Genkit maintains feature parity across three languages: The architecture is consistent across all three:
  • 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