TL;DR
Genkit's Agents API simplifies building conversational AI apps by handling message history, tool loops, and persistence through a single interface, reducing boilerplate for developers.
Key points
- 1
Agents API simplifies conversational AI development: Genkit's Agents API eliminates repetitive code by handling message history, tool loops, and streaming through a single interface. Before, developers had to manually implement these components for each conversational AI app, which was time-consuming and error-prone. Now, with the Agents API, you define an agent on the server using a system prompt and tools, then drive it with the same chat() interface whether it runs locally or behind an HTTP endpoint. This means you can build multi-turn conversations, handle tool interruptions, and manage state without rewriting plumbing for each project. For example, a weather agent can remember user sessions and persist data to Firestore, then be called from a frontend using the same interface as a local agent, reducing development time by up to 70% for conversational features.
- 2
Server-managed state ensures continuity: Genkit allows you to choose where conversation state lives—either server-managed or client-managed. Server-managed state uses a session store (like Firestore) to persist messages and custom state across turns, enabling features like resuming conversations or branching from saved points. This is critical for apps needing persistent interactions, such as chatbots that remember user preferences. For instance, if a user asks for Tokyo weather, the agent saves the session ID and can later resume the conversation with 'Continue where we left off.' by sending the session ID. Client-managed state is better for stateless deployments where the client handles persistence, but server-managed is ideal for production apps requiring reliability. This choice directly impacts how you handle user sessions and data retention without rebuilding the state management layer each time.
- 3
Real-time streaming and human approval: Genkit supports streaming responses and built-in human approval for critical actions. When an agent needs to execute a risky tool (like running a shell command), it pauses and asks the user to approve before proceeding. This ensures safety without adding complex workflows. For example, an agent can interrupt a shell command execution if it detects file modifications, then wait for user confirmation. Additionally, streaming allows partial responses to be processed incrementally—like showing progress while generating a report—without blocking the user. This is especially useful for long-running tasks, such as writing a quarterly market report, where the agent can detach the task and resume later via a snapshot ID, ensuring users don't lose progress.
- 4
Seamless integration with existing tools: Genkit works with popular frameworks like Vercel AI SDK UI, allowing developers to use Genkit agents without rewriting their frontend. The JavaScript client connects to the same HTTP endpoint as Go backends, resolving auth headers and streaming state patches automatically. For instance, a Vercel app can use the @genkit-ai/vercel-ai package to integrate Genkit agents into its chat interface, leveraging existing components like useChat. This reduces the need for custom protocols and ensures consistent behavior across environments, making it easier to adopt Genkit without disrupting existing workflows.
- 5
When to use Genkit vs. ADK: Choose Genkit for full-stack conversational AI features within a single app, while the Agent Development Kit (ADK) is better for complex multi-agent systems. Genkit handles agent orchestration through lightweight delegation tools, ideal for features like weather reporting or simple chatbots. ADK is designed for scenarios where agents form the entire system, such as enterprise workflows requiring managed runtimes. For example, if you're building a weather app with a single agent, Genkit is sufficient; but if you need to split tasks between researchers and coders, ADK provides better scalability and managed services.
What changed
Before this update
Developers manually wired message history, tool loops, and streaming for conversational AI apps, leading to repetitive code.
After this update
Genkit's Agents API packages these features into one interface, allowing developers to define agents and drive them with a single chat() call across platforms.
Share this update
This is a summary of an official post from the Google Search Central Blog, provided for quick reading. Google and the Google logo are trademarks of Google LLC; My Tool Studio is not affiliated with Google. Always refer to the original announcement for authoritative guidance.