Agent Protocol

The reason for creating the Agent Protocol was to provide a standardized way how interact with the agents. This is useful for automation, agent to agent communication, general UIs or dev tools.

Description

The Agent Protocol is a OpenAPI specification v3 based protocol. The protocol is meant to be simple and general, so it can be adopted by any agent.

The base objects of the protocol are Tasks, Steps and Artifacts

Task

A Task denotes one specific goal for the agent, it can be specific like:

Create a file named `hello.txt` and write `World` to it.

or very broad as:

Book a flight from Berlin to New York next week, optimize for price and duration.

The Task object has the following properties:

PropertyTypeDescription
task_idstringThe ID of the task.
inputstringInput prompt for the task.
additional_inputobjectAdditional input for the task.
stepsarray[Step]The steps of the task.
artifactsarray[Artifact]A list of artifacts that the task has produced.

Step

A Step is a single action that the agent should perform. Each step is triggered by calling the step endpoint of the agent. The Step object has the following properties:

PropertyTypeDescription
task_idstringThe ID of the task.
step_idstringThe ID of the step.
inputstringInput prompt for the step.
additional_inputobjectAdditional input for the step.
namestringThe name of the step.
statusenumThe status of the step. Possible values are created and completed.
outputstringOutput of the step.
additional_outputobjectAdditional output of the step.
artifactsarray[Artifact]A list of artifacts that the step has produced.
is_lastbooleanWhether this is the last step in the task.

Artifact

An Artifact is a file that the agent has worked with. The Artifact object has the following properties:

PropertyTypeDescription
artifact_idstringThe ID of the artifact.
file_namestringFilename of the artifact.
relative_pathstringRelative path of the artifact in the agent's workspace.

Endpoints

The Agent Protocol has two main endpoints:

  • /ap/v1/agent/tasks [POST] - This endpoint is used to create a new task for the agent.
  • /ap/v1/agent/tasks/{task_id}/steps [POST] - This endpoint is used to trigger next step of the task.

To see all endpoints and their descriptions, please refer to the Endpoints.