Genkit Middleware: Intercept, Extend, and Harden your Gen AI Pipelines (opens in new tab)
If you have been building anything non-trivial with Genkit, you have probably bumped into the same set of cross-cutting concerns over and over again: retrying transient model errors, falling back to a cheaper model when quota explodes, gating tool execution behind human approval, injecting filesystem access for coding agents, logging every request and response for observability... Until now, you ended up either wrapping ai.generate() calls by hand or writing ad-hoc helpers that ended up dupli...
Read the original article