DEVOURED
Genkit Middleware
Google's Genkit open-source framework now offers middleware for AI-powered agentic applications, enabling retries, fallbacks, human approval, and observability.
What: Genkit, an open-source framework by Google for building full-stack AI applications, introduced a middleware system on May 14, 2026. This system uses composable hooks to intercept generation calls, providing features like automatic retries for failed model API calls, fallback to alternative models, human-in-the-loop approval for tool execution, and scoped filesystem access, supporting TypeScript, Go, Dart, and soon Python.
Why it matters: This release signals Google's commitment to providing robust, production-ready tooling for agentic AI, focusing on reliability, safety, and extensibility through a modular middleware approach, addressing common challenges in complex AI system development.
Takeaway: Developers building agentic AI applications with Genkit can now use middleware to add critical features like reliability, safety, and custom logic, making their applications more robust.
Deep dive
- Genkit is an open-source framework by Google for building full-stack, AI-powered and agentic applications.
- It supports TypeScript, Go, Dart, and will soon support Python.
- The new middleware system, announced May 14, 2026, allows developers to intercept and extend
generate()calls. - Middleware hooks attach at three layers:
Generate(once per tool-loop iteration),Model(once per model API call), andTool(once per tool execution). - Pre-built middleware includes:
Retry(with exponential backoff),Fallback(to alternative models like Claude),ToolApproval(for human-in-the-loop confirmation),Skills(injects content from SKILL.md files), andFilesystem(scoped access to local filesystem). - Developers can build custom middleware, demonstrated with a ~20-line content filter example.
- Middleware can be composed and stacked, with explicit order of execution.
- The Genkit Developer UI allows inspection, testing, and debugging of middleware execution.
Decoder
- Agentic application: An application built around an AI "agent" that can autonomously perform complex tasks by breaking them down, using tools, and adapting its actions based on feedback.
- Middleware: Software that provides services to applications beyond those available from the operating system, often used to intercept and modify requests or responses in a pipeline.
- Tool loop: In agentic AI, a repeated cycle where an AI model generates an output, uses external tools based on that output, processes the tool's results, and then feeds those results back into a new model call until a task is completed.
Original article
Full article content is not available for inline reading.
Explore all 57 articles in today's digest
Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi