Creating an AI Agent That Integrates Humans with Knock and Cloudflare’s Agents SDK

The Cloudflare Blog The Cloudflare Blog

Knock is launching a new AI Agent integration with the Cloudflare Agents SDK, focusing on a virtual card issuing workflow. This feature aims to streamline requests while requiring human approval for new card issuance, enhancing accountability and safety in financial services.

The integration leverages the “human-in-the-loop” model, combining automated decision-making with necessary human input. Users can find the complete code example here.

The Agents SDK provides a solid base for developers, utilizing Cloudflare’s Durable Objects for state persistence and scalability. This means developers can create real-time, stateful agents without handling the usual complexities.

Advertisement

"The Durable Object abstraction underneath the Agents SDK means we get a globally addressable agent process that’s easy to yield and resume back to," said Chris Bell, CTO of Knock. "The persistent storage in the Durable Object means we can retain the complete chat history per-user."

The process starts with users requesting a card through a chat interface. The request triggers notifications through the Knock Agent Toolkit, ensuring that admin users receive alerts based on their communication preferences. This ties into Knock’s visual workflow builder for seamless integration and customized messaging.

Approvals are tracked via webhooks, making the system responsive and efficient. This means updates can happen asynchronously, allowing for quick action without disrupting user experience.

Additionally, there’s a built-in safeguard against duplicate approvals. The agent tracks the status of tool calls, ensuring each request is processed only once.

As businesses look to optimize internal processes, Knock’s new AI Agent could set a standard for automated workflows that still keep human oversight intact.

Developers interested in implementing this chat experience can access the full guide and example code on GitHub.

"Using the Agents SDK and Knock, it’s easy to build advanced human-in-the-loop experiences that defer tool calls," Bell added.

You can find more on Knock’s messaging infrastructure here and the Agents SDK here.

Add a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Advertisement