Deploying Your Agent

Below is a step-by-step guide on how to develop and deploy your custom Agent on aevatar Station. It includes preparing your development environment, obtaining the necessary credentials, creating and grouping Agents, and managing events and webhooks.

Follow these steps to ensure a smooth deployment process.

Obtain client_id and client_secret#

  • Request Credentials: Contact the system administrator [email protected] to request your client_id and client_secret.
  • Usage: These credentials are required for:
    • Authenticating with the aevatar Station platform.
    • Generating an authentication token to access APIs.
  • Note: Once you receive your credentials, store them securely.

    Develop Your Agent#

  • Clone the Sample Repository: Visit aevatar Samples to download or clone the sample Agent templates.
  • Modify or Extend:
    • Core Functionality: Implement your business logic, data processing, and message handling according to your project requirements.
    • Event Handling: Ensure your Agent can subscribe to events, receive event notifications, and publish events to other Agents.
    • Configuration Management: Allow for dynamic configuration (e.g., load initialization parameters from external sources, handle runtime updates).
  • Align with Platform Interface: Make sure your Agent follows the aevatar Station interface conventions and that it can properly send/receive messages with the platform.
  • Upload to MyGet and Request Deployment#

  • Build Your Agent:
    • Build and package your project.
  • Upload to MyGet:
    • Use MyGet (or any other package repository you have set up) to host your build artifacts.
    • Ensure you have the correct repository URL.
  • Notify the Administrator:
    • Provide the MyGet package URL to the aevatar Station administrator [email protected].
    • Request for deployment on the aevatar Station platform.
  • Tip: Ensure your package name and version are clearly indicated to avoid confusion during deployment.

    Authenticate and Obtain a Token#

  • Authentication Endpoint: POST /connect/token
  • Request Body:
  • Response:
    • On success, you will receive an authentication token.
    • Include this token in the Authorization header when calling other aevatar Station APIs.
  • Create an Agent Instance#

  • Creation Endpoint: POST /api/agent
  • Request Header:
    • Authorization: Bearer <your_token>
  • Request Body (example):
  • {
      "agentType": "AI Basic", 
      "name": "Agent Name",
      "properties": {
          "a": "xx",
          "b": "yy",
          "c": 1
      }
    }
  • Response:
    • Returns a unique Agent identifier (guid), the detailed response as below:
    • {
        "code": "20000",
        "data": {
          "id": "d2ba5534-f602-4288-b2a3-ef033877a0c8",
          "agentType": "AIBasic",
          "name": "Agent Name",
          "properties": {
            "a": "xx",
            "b": "yy",
            "c": 1
          }
        },
        "message": ""
      }
  • Group Your Agents (Optional)#

    If your project requires multiple Agents to work together, you can group them:

  • Add Sub-Agent Endpoint: POST /api/agent/{guid}/add-subagent
  • Request Body:
  • {
      "subAgents": ["guid1", "guid2"]
    }

    Response:

    {
      "code": "20000",
      "data": {
        "id": "guid",
        "subAgents": ["guid", "guid"]
      },
      "message": ""
    }
  • Purpose:
    • This API allows multiple Agents to operate as a cohesive group.
    • Sub-Agents can communicate with the main Agent or other sub-Agents.
  • Inter-Agent Communication#

    To enable messaging between Agents (or among Agents in a group):

  • Publish Event Endpoint: POST /api/event/publish/{id}
  • Request Header:
    • Authorization: Bearer <your_token>
  • Request Body (example):
  • {
      "agentId": "2463cbd5-71bc-4292-ad82-0cf31bb91de6",
      "eventType": "InvestmentEvent",
      "eventProperties": {
        "Content": "abc"
      }
    }

    Response:

    {
      "code": "20001",
      "data": null,
      "message": "empty result"
    }
  • Behavior:
    • The event will be delivered to any Agent subscribing to the specified eventType.
    • Ensures asynchronous communication across Agents.
  • (Optional) Event Subscription Management#

    If you want to handle advanced event routing or filtering:

  • Subscribe to an Event: Use the relevant subscription endpoint to register your Agent for specific event types.
  • Manage Subscriptions: Update or remove subscriptions as your system’s needs evolve.
  • Consult the aevatar Station APIs for the exact event subscription endpoints and parameters.

    (Optional) Webhook Management#

    If your Agent needs to receive external updates (e.g., Twitter, Telegram) via webhooks:

  • Webhook Template: Refer to the WebhookTemplate for an example implementation.
  • Build a DLL: Integrate your webhook logic into a .NET project and compile it into a DLL.
  • Deployment:
    • Provide the DLL to the administrator for deployment.
    • Once deployed, you can access it via:
    • https://station-webhook-staging.aevatar.ai/{webhookId}/{RelativePath}
  • Validation and Testing:
    • Ensure your webhook endpoint is correctly receiving external data (e.g., from Twitter or Telegram).
    • Confirm that the webhook triggers the correct events in aevatar Station.
  • Best Practices#

  • Testing: Thoroughly test each Agent locally before requesting deployment. Validate both event publishing and subscription behaviors.
  • Logging & Monitoring: Incorporate robust logging to monitor Agent performance and diagnose issues quickly.
  • Version Control: Keep track of version changes in your Agent’s codebase and document improvements or bug fixes.
  • Security: Never share client_secret publicly. Use secure channels when communicating any sensitive information.
  • Summary#

  • Obtain: Request client_id and client_secret from administrators.
  • Develop: Use the aevatar Samples repository to build your Agent.
  • Upload & Deploy: Publish to MyGet and contact the admin for deployment.
  • Authenticate: Log into aevatar Station to obtain an access token.
  • Instantiate: Create an Agent via the /api/agent endpoint.
  • Group & Communicate: (Optional) Group multiple Agents and use events for message exchange.
  • Advanced: Manage subscriptions and webhooks if needed.
  • For detailed API specifications and advanced configurations, refer to our documentation center provided by the platform.

    By following these steps, you will be able to successfully develop, deploy, and manage your custom Agents on aevatar Station. If you encounter any issues or have additional questions, contact the aevatar team or consult the official documentation.

    Edited on: 18 February 2025 07:12:41 GMT+0