At a glance: Google Genkit introduces a new middleware system for extending and securing AI applications. The modular hooks enable retries, fallbacks, and human oversight. Available in TypeScript, Go, and Dart—Python coming soon.
Google introduces Genkit Middleware—a system with modular hooks to extend, secure, and make AI-driven applications more reliable. The new feature is already available in TypeScript, Go, and Dart.
Genkit is an open-source framework for developing complete, AI-driven agentic applications that can run on any platform and support TypeScript, Go, Dart, and Python. Creating production-ready agentic applications requires far more than just powerful models and well-crafted prompts.
Genkit addresses these requirements through a middleware system—modular hooks that intercept generation requests and the tool-execution loop. This enables developers to inject custom logic at every stage.
Concretely, middleware hooks can be used for retries, fallback scenarios, human oversight of dangerous operations, and complete stack observability to achieve the highest reliability.
Each generate() call in Genkit executes a tool-calling loop: the model generates output, all invoked tools are executed, their results are fed into a new model call, and the process repeats until the model signals it is done. Middleware hooks are attached at three different levels within this loop.
The middleware system is currently available in TypeScript, Go, and Dart. Python support is coming soon.