Getting Started with Autonomys Agents Framework via CLI
-
Install dependencies:
yarn install
- Windows users will need to install Visual Studio C++ Redistributable. It can be found here: https://aka.ms/vs/17/release/vc_redist.x64.exe
-
Create a character configuration:
yarn create-character your_character_name
This will create a new character with the necessary configuration files based on the example template.
-
Configure your character:
- Edit
characters/your_character_name/config/.env
with your API keys and credentials - Customize
characters/your_character_name/config/config.yaml
for agent behavior - Define personality in
characters/your_character_name/config/your_character_name.yaml
- Edit
-
Generate SSL certificates (required for API server):
yarn generate-certs
-
Run the agent:
cd <to/agent/project> yarn start <your_character_name>
If you have stored workspace files (
characters
,certs
, and.cookies
directories) in a custom location, use the--workspace
argument with the absolute path to your desired directory:# Specify a workspace path yarn start your_character_name --workspace=/path/to/workspace # Run in headless mode (no API server) yarn start your_character_name --headless
Running Multiple Characters
You can run multiple characters simultaneously, each with their own configuration and personality:
-
Create multiple character configurations:
yarn create-character alice yarn create-character bob
-
Configure each character separately with different personalities and API settings.
-
Run each character in a separate terminal session:
# Terminal 1 yarn start alice # Terminal 2 yarn start bob
-
Each character will:
- Have its own isolated memory and experience
- Run its own API server on the specified port
- Execute tasks according to its unique schedule and personality
Docker Deployment
You can also run your agents using Docker. This provides isolation and makes it easy to run multiple agents simultaneously.
Prerequisites
- Docker installed on your system (Installation Guide)
- Docker Compose Plugin required (Compose Plugin Installation)
- Character configuration set up (follow steps from the Getting Started section)
Running with Docker
- Generate your character’s docker-compose file
First make the script executable:
chmod +x ./generate-compose.sh
Then generate the compose file:
./generate-compose.sh <your-character-name> [HOST_PORT] [API_PORT]
Examples:
# Run Alice on port 3011 with API port on 3011
./generate-compose.sh Alice 3011 3011
# Run Bob on port 3012 with API port on 3011
./generate-compose.sh Bob 3012 3011
- Manage the Docker container
Build and start the container:
docker compose -f docker-compose-{character-name}.yml up -d
Stop and remove the container:
docker compose -f docker-compose-{character-name}.yml down
View container logs:
docker compose -f docker-compose-{character-name}.yml logs -f
Access container shell:
docker exec -it autonomys-agent-{character-name} bash