Skip to content

Lesson 3: Running an agent

By the end of this lesson:

You will learn how to run an agent.

Fetch your first agent

Step 1

Fetch the hello_world agent and get into the agent's project folder:

aea fetch fetchai/hello_world:0.1.4
cd hello_world

This agent simply prints Hello World! on the screen.

Install AEA dependencies

You need to install an agent's dependencies before running it.

Step 2

Install the agent's dependencies:

aea install

Create and add a private key

All AEAs need a private key to run.

Step 3

Generate and add a private key to the agent:

aea generate-key fetchai --add-key

Run the AEA

Step 4

Run the agent:

aea run

aea run
warning: [hello_world] Resource's connections list is empty! Instantiating 
AEA without connections...
    _     _____     _
   / \   | ____|   / \
  / _ \  |  _|    / _ \
 / ___ \ | |___  / ___ \
/_/   \_\|_____|/_/   \_\

v1.2.3

Starting AEA 'hello_world' in 'async' mode...
info: [hello_world] Start processing messages...
info: [hello_world] Hello World!

Stop the AEA

Stop the agent:

Press CTRL C

Once you stop the agent, you should see it being interrupted and stopped.

Delete the AEA

You can delete an AEA with the delete command from its parent directory.

Delete the agent:

aea delete hello_world