This article details the Agent Host Protocol (AHP), an open standard developed by GitHub to enable AI agent sessions to persist and continue across multiple devices and client applications. It addresses the challenges of tightly coupled agent lifecycles within specific applications and proposes a protocol-based solution for seamless, independent, and flexible agent interaction, supporting diverse client implementations and cloud-based agents.
Read original on GitHub EngineeringInitially, AI agents like GitHub Copilot were tightly integrated with specific client applications (e.g., VS Code extensions). This architecture meant an agent's lifecycle was bound to the application window, leading to session loss upon closing the app or switching devices. Furthermore, supporting agents across multiple platforms (VS Code, mobile, web app) required custom, one-off integrations for each client, leading to significant development overhead and limiting developer flexibility.
Architectural Challenge
How do you design a system where an AI agent's state and session can persist and be accessed consistently across a multitude of client applications and devices, without requiring N*M integrations?
The Agent Host Protocol (AHP) was developed as an open standard to decouple agent sessions from client applications. It acts as a standardized language for clients and servers to interact with agents, ensuring a consistent view of agents, history, and state regardless of the client or device. This protocol allows for starting an agent session on one device and seamlessly continuing it on another, even tolerating network interruptions and concurrent client interactions.
GitHub implemented AHP with two distinct agent hosts: one in TypeScript for VS Code (running locally or remotely via SSH/WSL) and another in Rust for cloud-based GitHub Agents. This dual implementation by different teams served as an effective "acid test" for the protocol's portability and robustness, proving its ability to support diverse requirements and environments. The successful adoption across all VS Code and GitHub surfaces validates AHP's design for cross-device agent session continuity.