Home / Companies / LogRocket / Blog / Post Details
Content Deep Dive

Building multi-turn AI agents with Genkit’s Agents API

Blog post from LogRocket

Post Details
Company
Date Published
Author
Ikeh Akinyemi
Word Count
2,961
Company Posts That Month
22
Language
-
Hacker News Points
-
Post removed?
No
Summary

Genkit’s beta Agents API, developed by the Firebase team, is presented as a framework for building stateful AI agents that can persist conversations, support long-running tasks, and require human approval for sensitive actions without developers separately implementing job queues, polling, and session persistence. The walkthrough uses Node.js, TypeScript, Gemini models, and Genkit’s `defineAgent` API to create an agent that supports complete and streaming responses, retains multi-turn context through sessions, and can move from local file-based storage to Firestore-backed durable session storage. It explains how to expose the agent through Express HTTP endpoints and access it from a TypeScript frontend with `remoteAgent`, preserving the same chat interface across local and remote use. Detached turns allow work such as slow research or tool sequences to continue after a client disconnects, although the originating server process must remain running, while snapshot IDs enable later clients to poll task status, resume completed conversations, or cancel work. The article also demonstrates human-in-the-loop safeguards through interrupts, which pause potentially risky tool calls such as record deletion until a reviewer approves, rejects, or supplies an outcome, with server-managed session history validating that approvals correspond to legitimate agent requests.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
AI Agents 2 5,780 1,243 245 -15%
Real-time 1 4,432 1,050 222 -31%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.