Google's Genkit Builds AI Agents From Small Reusable Primitives, Not Monolithic Classes
Google's Genkit framework takes a compositional approach to building AI agents, using a small set of shared primitives — tools, middleware, interrupts, sessions, and streaming — rather than a large, complex Agent class. A functional agent can be defined in roughly 10 lines of code using ai.defineAgent() with a system prompt, tools, and an optional session store. State management is flexible: developers can choose server-managed sessions by passing a store, or let the client manage state by omitting it, with the same agent API in both cases. Interrupts allow any tool call to pause execution and hand control back to the developer, enabling human-in-the-loop workflows without special-purpose features. Middleware, sub-agents, and approval gates all build on the same underlying primitives, and agents can run identically on both server and browser environments.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in