Zum Inhalt

Announcing Genkit Middleware: Intercept, extend, and harden your agentic apps

Chris Gill, Product Manager. Genkit is an open-source framework for creating full-stack, AI-powered, and agentic applications that run on any platform and supports TypeScript, Go, Dart, and Python. Building production-ready agentic applications and AI capabilities demands far more than just powerful models and well-crafted prompts. You may require retries, fallbacks, human oversight for dangerous operations, and full-stack observability to achieve the highest reliability. Genkit addresses these needs through middleware—modular hooks that intercept generation requests and the tool execution loop, allowing you to inject custom logic at every stage. The middleware system is currently available in TypeScript, Go, and Dart, with Python support arriving soon. How Genkit middleware works. Every generate() call in Genkit executes a tool-calling loop: the model generates output, any invoked tools are run, their results are fed back into a fresh model call, and the process repeats until the model indicates it has finished. Middleware hooks are attached at three different layers within this loop. Wenn es funktioniert.

  Google Developers Blog