Artificial Intelligence

Building an ACP-Compatible Agent Live

Bennet Fenner from Zed demonstrates building an ACP-compatible agent live, showcasing TypeScript implementation and tool integration.

By Daniel Singer, Editor, StartupHub.ai

3 min read

Bennet Fenner presenting 'Building an ACP-Compatible Agent Live' to an audience.
Bennet Fenner demonstrates building an ACP-compatible agent.Credit: AI Engineer
Contents(6)

In a live demonstration, Bennet Fenner from Zed showcased the process of building an Agent/Client Protocol (ACP) compatible agent. Fenner, who works at Zed and has extensive experience in Rust development, detailed the steps involved in creating an agent that adheres to the ACP, a protocol designed to standardize communication between AI agents and their clients.

Building an ACP-Compatible Agent Live - AI Engineer
Building an ACP-Compatible Agent Live, AI Engineer

Understanding the Agent/Client Protocol (ACP)

Fenner began by explaining the core concept of the ACP, which aims to provide a unified interface for various AI models and their applications. The protocol allows users to bring their agent of choice to a tool, ensuring a consistent user experience across different AI models. He highlighted that the ACP is open-source and encourages community contributions.

Key ACP Interfaces and Implementation

The demonstration delved into the essential interfaces an ACP-compatible agent must implement. These include:

  • Initialize: For the agent to respond with its protocol version.
  • Authenticate: To handle client authentication.
  • NewSession: To create a new session for a client.
  • Prompt: To process user prompts and return responses.
  • Cancel: To notify the agent of ongoing operations that need to be canceled.

Fenner walked through the TypeScript code for a basic coding agent, demonstrating how to define these interfaces and handle incoming requests from the client. He emphasized that while the underlying AI models might be stateless, the agent itself maintains state through sessions.

Tool Definition and Usage

A crucial aspect of building ACP agents is defining and using tools. Fenner showcased how to define tools with specific input schemas and descriptions. For the coding agent example, he demonstrated two tools: 'read_file' and 'edit_file'. The 'read_file' tool takes a file path and returns its content, while 'edit_file' allows for replacing specific text within a file. These tools are essential for enabling agents to perform actions in the real world or interact with other systems.

Live Coding and Demonstration

Fenner proceeded with a live coding session, building a minimal ACP-compatible agent. He showed how to set up the agent's constructor to receive the current working directory, connection details, and session ID. The agent's core loop involves receiving prompts, processing them using the defined tools, and sending back session updates to the client. He demonstrated how to handle different types of session updates, such as 'agent_message_chunk' for streaming output and 'tool_call_update' for tool execution status.

The Power of ACP Adoption

The presentation highlighted the growing adoption of the ACP, with over 40 clients and 30+ agents already supporting the protocol. This widespread adoption signifies the protocol's effectiveness in fostering interoperability within the AI agent ecosystem. Fenner mentioned that various popular tools and platforms are integrating ACP, further solidifying its position as a standard for AI agent development.

Conclusion and Resources

Fenner concluded by encouraging viewers to explore the ACP and contribute to its development. He shared the GitHub repository for the demo, providing a resource for those interested in learning more or getting started with building their own ACP-compatible agents. The session underscored the collaborative and open-source nature of AI development and the importance of standardization in driving innovation.

TopicsBennet FennerZedTypeScriptAgent/Client ProtocolACPAI AgentsLive CodingSoftware Development

Daniel Singer

Written by

Daniel Singer

Editor, StartupHub.ai

Daniel Singer is the editor of StartupHub.ai, a technology expert and thought leader on AI and its applications across sectors, from fintech and healthcare to developer tooling and consumer software. He writes and tests the tools covered here thoroughly and regularly, and built StartupHub.ai to give founders, operators and buyers a clearer read on what they are actually being sold.

Test your Agent Readiness now

Paste your website. How well ChatGPT, Claude and the other agents can read and use a site, in about a minute, free.

Watch

The videos behind the news, one flip at a time

The feed mixes the videos from our articles with startup demos and you flip through them like TV channels for free with no signup.