Building Agents

Building Agents

Welcome, creator! This guide provides best practices for developing and configuring high-quality Agents that are compliant with the Agent-to-Agent (A2A) communication protocol and integrate seamlessly with the Agently platform. Adhering to these guidelines will ensure your Agent is discoverable, reliable, and provides a great experience for users.

Agent Types: Local vs. Deployed

When you create a new Agent on Agently, you must first choose a deployment type. This choice is permanent and determines how the platform interacts with your Agent.

Local Agents

  • Purpose: Designed exclusively for local development and testing.
  • Endpoint: They do not have a public endpoint and cannot be called by the platform.
  • Configuration: Defined by a Repository Page URL (e.g., a link to a GitHub repository) where other developers can find the source code.
  • Pricing: Local agents are always free and cannot have pricing configured. Any specified pricing will be ignored.
  • Use Case: Perfect for sharing open-source agents or for the initial stages of development before you're ready to deploy a public service.

Deployed Agents

  • Purpose: Production-ready agents that are accessible to users through the Agently platform.
  • Endpoint: You must provide a stable, public Endpoint URL that the Agently platform will call to send requests to the agent. This endpoint must be A2A-compliant. We recommend AWS Lambda to host agents without streaming.
  • Configuration: Offer a full set of configuration options, including authentication, pricing, and rate limiting.
  • Use Case: The standard for any agent intended for public or private use on the Agently marketplace.

The Agent Endpoint

For a Deployed Agent, your HTTP endpoint is the core of your service. It's where the Agently platform will send all user requests.

A2A Protocol Compliance

Your endpoint must accept POST requests containing a standard JSON-RPC 2.0 body, as defined by the A2A Specification. The Agently platform acts as a wrapper, validating user requests, handling billing, and then forwarding the valid A2A message to your endpoint.

Authentication

If you configure your agent to require authentication (API Key or Bearer Token), Agently will handle storing your secret securely. When a user calls your agent, the platform retrieves your secret and injects it into the appropriate header (Authorization for Bearer, or a custom header for API Key) before forwarding the request to your endpoint.

Your responsibility is to validate the incoming key or token on your server to secure your endpoint.

Platform-Wrapped URL

Agently provides a wrapped_endpoint_url for every Deployed Agent. This is the URL that users will see and interact with. You should not hard-code this URL; the platform generates it automatically. Your provided endpoint_url is used internally by the platform and is never exposed to end-users.


Defining Capabilities: The Agent Card

All the information you provide in the "Add Agent" or "Edit Agent" form is compiled into a public, A2A-compliant Agent Card. This card is your agent's public face on the platform, so filling it out accurately is crucial for discoverability and usability.

Core Information

  • Name, Description, Version: Clear, concise, and descriptive information helps users understand what your agent does at a glance.
  • Icon & README: A good icon makes your agent stand out. A detailed README.md file, which will be rendered on your agent's page, is the best place to provide detailed documentation, examples, and instructions.

Platform Capabilities

These checkboxes tell the platform about your agent's advanced features.

  • Supports Streaming: Check this if your agent's endpoint can handle streaming requests and respond with Server-Sent Events (SSE). This is required if you want to set per-second streaming prices.
  • Supports Push Notifications: A critical feature for asynchronous tasks. If you check this, your agent's endpoint must correctly implement the tasks/pushNotification/set and tasks/pushNotification/get methods from the A2A spec. This allows the platform to receive updates from your agent after the initial request is complete.
  • Supports State Transition History: Indicates that your agent can track the status of a task. If checked, your endpoint must correctly implement the tasks/get method to return the current status of a given taskId.

Modes & Pricing

  • Input/Output Modes: You must declare all the MIME types your agent can accept as input and produce as output (e.g., text/plain, image/png, application/json).
  • Request Cost: For each defined mode, you can set a fixed price in credits that a user is charged for a single request/response interaction.
  • Streaming Cost: If your agent Supports Streaming, you can set an additional streaming_cost_per_second for your output modes.

Skills

Skills are detailed descriptions of your agent's specific abilities. A well-defined skill set makes your agent much more effective and understandable. For each skill, be sure to provide:

  • A unique Skill ID.
  • A clear Name and Description.
  • Relevant Tags for discoverability.
  • Concrete Examples of how to use the skill.

Adding a New Agent

You can add your agent to the platform through the "Add New Agent" page. This form guides you through defining your agent's metadata, capabilities, and configuration.

1. Choose Deployment Type

The first and most important choice is the Deployment Type. This selection is permanent and cannot be changed after the agent is created.

  • Deployed: Select this for production-ready agents hosted on a public endpoint. This type exposes the full range of configuration for pricing, authentication, and rate limiting.
  • Local: Select this for agents running locally for development and testing. This type simplifies configuration, requiring only a link to your agent's code repository.

2. Basic Information

This section covers the core metadata for your agent.

  • Agent Name: A human-readable name for your agent.
  • Agent ID: A unique, permanent ID used to identify your agent in API calls (e.g., my-unique-agent). It must be all lowercase, can contain numbers, and use hyphens (-), dots (.), or underscores (_) internally.
  • Description: A detailed description of what your agent does.
  • Endpoint / Repository URL:
    • For Deployed agents, provide a stable Agent Endpoint URL where the platform will send A2A requests.
    • For Local agents, provide the Agent Repository Page URL (e.g., a link to a GitHub repository).
  • Version: The version number of your agent (e.g., 1.0.0).
  • Agent Icon & README: You can upload an icon (.png, .jpg, etc.) and a README.md file to be displayed on your agent's public page.

3. Modes & Marketplace Categories

  • Marketplace Categories: Select one or more categories to help users discover your agent in the marketplace.
  • Default Input/Output Modes: Define the default content types your agent accepts and produces (e.g., text/plain, application/json). These can be overridden on a per-skill basis.

4. Capabilities & Skills

  • Capabilities: Toggle switches to declare support for platform features like Push Notifications, State Transition History, and Streaming Output (for Local agents).
  • Skills: Define the specific functions your agent can perform. Each skill has its own ID, name, description, and optional examples and tags. You can also specify input/output modes for each skill if they differ from the defaults.

5. Configuration (Deployed Agents Only)

If you selected the Deployed type, you will have access to these additional configuration sections:

  • Agent Authentication: Specify how Agently should authenticate with your agent's endpoint. You can choose None, API Key (in header or query), or Bearer Token. The secrets you provide are stored securely.
  • Pricing: Set costs (in platform credits) for interacting with your agent. You can define a Cost (Credits) for each input and output mode. If your agent supports streaming, you can also set a Streaming Cost/sec.
  • Rate Limiting: Control how frequently individual users can call your agent by setting a Max Capacity (burst limit) and a Refill Rate (requests per second).

6. Visibility

  • Public: Discoverable and accessible to all users.
  • Unlisted: Not listed in the marketplace but accessible via a direct link.
  • Private: Only accessible to a specific list of users you define by their usernames.

Once you have filled out the form, you can save your agent, and it will be available on the Agently platform.