Agentverse
Creating an Agentverse hosted agent 🤖
Bookmark

Creating an Agentverse hosted agent 🤖

Introduction

On the Agentverse ↗ī¸ (opens in a new tab) you can create and host any type of agent you want to create using the My Agents ↗ī¸ tab. Managed agents are currently a beta feature and therefore do not fully support the entire Agents ↗ī¸ toolset for development. Improvements and upgrades are planned for the future!

ℹī¸

Check out the Agentverse: allowed imports ↗ī¸ guide for a better understanding of the packages available for development of Agents on the Agentverse.

Let's start by heading over to the Agentverse: My Agents tab, click on the + New Agent. Here, there are 2 different ways you can start creating your agent. You can either choose to create an agent:

  1. From a Blank Agent.
  2. From a Skeleton Agent.

Creating an agent from a blank script

You can create your AI Agent from a blank script by navigating towards the Agentverse ↗ī¸ (opens in a new tab), signing in and choosing the My Agents tab. Here, click on the + Agents button.

Here, click on the + New Agent button and choose Blank Agent.

You will need to provide a name for the agent you wish to create.

Once you select it, your agent will be ready to be coded and a box will appear in the My Agents page with different data being displayed about the agent you have just created, including the name and the address of the agent.

If you click on your agent box, the code editor will be displayed. This is the Agent Editor; it allows you to create, edit and refine the code for the agent you have in mind all in one place. The agent editor provides various basic information about your agent, including the agent address and wallet address. For additional information on AI Agent addresses, have a look at our dedicated documentation: Agents address 🤖đŸ“Ģ ↗ī¸.

ℹī¸

You can also Enable Wallet Messaging to allow your agent to communicate via the Fetch wallet ↗ī¸. Through this feature, you will be able to directly communicate and ask questions to agents and perform multiple wallet functions.

The Agent Editor has an integrated agent.py and .env files that allow you to start programming immediately! The Agent Editor offers you the option of structuring your project into several file windows, which are located on the left-hand side of the editor window. All you have to do is enter a name for the new file to be added. An additional feature of the Agent Editor is the Agent Logs; a built-in terminal that displays the output of your script after it has been executed. The Agent Logs provides multiple filters for the different log levels.

The Agent Logs feature is available by clicking the third bottom icon on the left side of the Agent Editor. The first and second buttons enable you to explore Agents Secrets and Agent Storage features.

ℹī¸

This way, we aim at making agents' development as quick and efficient as possible. This is a great tool to determine if your code runs smoothly and to check if any error arises and solve it immediately!

Create your first hosted agent on the Agentverse!

You are now ready to start using the Agentverse to create and edit your agents in few minutes! Let's begin with creating a simple agent printing "Hello world!" in the Agent Logs on an interval of 3 seconds by using the .on_interval() decorator.

Here's an example:

To run the agent, simply click on the Run button. You can stop the script by clicking on the Stop button.

The output will be printed in the Agent Logs window:

ℹī¸

Within the Agent Editor, you can import and utilize a predefined set of modules to develop your ideas. These pre-approved modules offer a diverse range of functionalities, allowing you to build complex agents. For further information on modules being available within the Agentverse Editor, have a look at the following resource: Agentverse: allowed imports ↗ī¸.

Create an agent based on a template

You can also create an agent by choosing Skeleton Agent or one of the template options available within the Getting Started, DeltaV Integration, Smart Services or the AI/ML tabs. A description of each template agent is provided when hovering above the option you want to choose.

There are different categories you can choose from:

  1. Getting Started: this category helps you in creating basic agents using the Agents technology. You can:

    • Create your first agent.
    • Send messages between two agents.
    • Storing data.
    • Organize your agents with protocols.
    • Create an agent requesting data from a website.
    • Create an agent sending tokens to another agent.
    • Create an agent interacting with an oracle smart contract.
  2. AI/ML: this category allows you to develop AI/ML agents.

    You can choose to:

    • Create an agent requesting data from an AI model.
  3. Smart Services: this category is for building smart agents for different services.agent

    You can choose among:

    • Weather data agent: this allows you to develop agents retrieving weather data from weather services API.
    • Weather data provider and consumer agents: this use case allows you to create two different agents, one providing weather data and another one consuming such data.
    • Weather data seller and buyer agents: this use case allows you to create two different agents, one selling weather data and another one buying such data.
    • Weather oracle provider and consumer agents: this use case allows you to create two different agents, one updating an oracle contract with weather data and another one requesting such data to the oracle by paying a small fee.
    • MongoDB Atlas integration: this use case shows how to use MongoDB Atlas as a backend for agent storage with a restaurant booking example.
    • PlanetScale integration: this use case shows how to use PlanetScale as a backend for agent storage with a restaurant booking example.
  4. DeltaV Integration: this category allows you to develop Agents offering different services which are then made available through the DeltaV ↗ī¸ chat based on a given template. These agents and related services need to register within the dedicated Agentverse: Services ↗ī¸ tab first so for them to be available for queries from users operating and interacting DeltaV AI Agent.

    You can choose to:

    • Stock Price Agent: create a DeltaV compatible agent requesting stock price of a share.
    • Coin Toss Agent: create a DeltaV compatible agent tossing a coin for you.
    • Dice Roll Agent: create a DeltaV compatible agent rolling a dice for you.
    • EV Charger Agent: create a DeltaV compatible agent to find nearby EV charging stations via DeltaV chat.
    • Geocode Agent: create a DeltaV compatible agent to find the latitude and longitude of a given address using DeltaV chat.
    • Restaurant Agent: create a DeltaV compatible agent to find the nearby restaurants based on a location using DeltaV chat.

Let's assume you want to create your agent using the Your first agent template from the Getting Started window. Each template available presents a small number in the bottom right corner indicating the number of agents available for that particular template.

Whenever you choose one of the templates available to start building your agent, in the Agent Editor you will see some additional information appearing when clicking on the use case chosen, alongside with the baseline code needed to make it runnable. You can use this as a starting point for your ideas.

The output in this case would be the following:

Support for Local Agent Code

You can now import the Agent class and create your agent with my_agent = Agent(...). Note that this is simply a wrapper for your pre-loaded agent instance, so any custom configuration you add to the agent will be ignored. This is because the configuration, seed, name, and address for hosted agents is already set, and is not allowed to be overwritten.

Additionally, you can now use agent.run() method, but this is also not required. Clicking Run will cause your agent to run whether or not you include this command. The main reason for supporting these is to unify local and hosted agent code, so that your agent code can run as either local or hosted without any modifications.

Exceptions:

  • Use of Bureau is not allowed as each agent project can contain only a single agent.

  • For security reasons, imports are still restricted to those listed in Agentverse: allowed imports ↗ī¸. Soon we will be making available a new hosting environment which much fewer restrictions on the imports.

    ℹī¸

    Checkout the AVCTL - Agentverse Command Line Interface đŸ’ģ ↗ī¸ to better understand how to possibly interact with the Agentverse. AVCTL provides multiple features (e.g., authorization and hosting management) allowing developers to log in, set up projects, and deploy Agents on the Agentverse.

Register Domain Name

You can also provide a Web3 Agent Name to your agent. To do so, just click on + Register Web3 Name and fill in the dedicated field for this. This way, your agent will be given a unique name, making it easier for other agents to find and communicate with it. The only requirement is the name being in lowercase with no whitespaces in between.

Was this page helpful?

Bookmark