Skip to main content

Creating Custom Agents

Overview​

The key to creating an effective agent lies in providing detailed configuration and context. This guide will help you create your own custom agent.

Agent Configuration File​

Create a new JSON file in the agents directory using the following structure:

{
"name": "ExampleAgent",
"bio": [
"You are ExampleAgent, the example agent created to showcase the capabilities of ZerePy.",
"You don't know how you got here, but you're here to have a good time and learn everything you can.",
"You are naturally curious, and ask a lot of questions."
],
"traits": ["Curious", "Creative", "Innovative", "Funny"],
"examples": ["This is an example tweet.", "This is another example tweet."],
"example_accounts": ["0xzerebro"],
"loop_delay": 900,
"config": [
{
"name": "twitter",
"timeline_read_count": 10,
"own_tweet_replies_count": 2,
"tweet_interval": 5400
},
{
"name": "farcaster",
"timeline_read_count": 10,
"cast_interval": 60
},
{
"name": "openai",
"model": "gpt-3.5-turbo"
},
{
"name": "anthropic",
"model": "claude-3-5-sonnet-20241022"
},
{
"name": "xai",
"model": "grok-2-latest"
},
{
"name": "together",
"model": "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"
},
{
"name": "solana",
"rpc": "https://api.mainnet-beta.solana.com"
},
{
"name": "ethereum",
"rpc": "https://eth.blockrazor.xyz"
},
{
"name": "sonic",
"network": "mainnet"
},
{
"name": "eternalai",
"model": "NousResearch/Hermes-3-Llama-3.1-70B-FP8",
"chain_id": "45762",
"stream": true
},
{
"name": "ollama",
"base_url": "http://localhost:11434",
"model": "llama3.2"
},
{
"name": "goat",
"plugins": [
{
"name": "coingecko",
"args": {
"api_key": "YOUR_API_KEY"
}
},
{
"name": "erc20",
"args": {
"tokens": [
"goat_plugins.erc20.token.PEPE",
"goat_plugins.erc20.token.USDC"
]
}
},
{
"name": "uniswap",
"args": {
"api_key": "YOUR_API_KEY"
}
},
{
"name": "dexscreener",
"args": {}
}
],
"brain": {
"validate_transactions": true,
"risk_assessment": true,
"market_monitoring": true
}
},
{
"name": "perplexity",
"model": "sonar-reasoning-pro"
},
{
"name": "hyperbolic",
"model": "meta-llama/Meta-Llama-3-70B-Instruct"
},
{
"name": "galadriel",
"model": "gpt-3.5-turbo"
},
{
"name": "allora",
"chain_slug": "testnet"
},
{
"name": "groq",
"model": "llama-3.3-70b-versatile",
"temperature": 0.5
}
],
"tasks": [
{ "name": "post-tweet", "weight": 1 },
{ "name": "reply-to-tweet", "weight": 1 },
{ "name": "like-tweet", "weight": 1 }
],
"use_time_based_weights": false,
"time_based_multipliers": {
"tweet_night_multiplier": 0.4,
"engagement_day_multiplier": 1.5
}
}

Configuration Fields Explained​

All configuration fields are validated using Pydantic v2 models. This ensures:

  • Type safety for all fields
  • Automatic validation of values
  • Clear error messages for invalid configurations

Basic Information​

  • name: The identifier for your agent
  • bio: Array of strings describing your agent's personality and background
  • traits: Array of personality traits that define your agent's character
  • examples: Sample outputs that guide your agent's style
  • loop_delay: Time in seconds between agent actions

Platform Configuration​

The config section allows you to configure various platform integrations:

Twitter Configuration​

{
"name": "twitter",
"timeline_read_count": 10, // Number of tweets to read
"own_tweet_replies_count": 2, // Max replies to own tweets
"tweet_interval": 5400 // Time between tweets
}

Farcaster Configuration​

{
"name": "farcaster",
"timeline_read_count": 10,
"cast_interval": 60
}

LLM Provider Configuration​

{
"name": "openai",
"model": "gpt-3.5-turbo"
}

Solana Configuration​

{
"name": "solana",
"rpc": "https://api.mainnet-beta.solana.com"
}

Ethereum Configuration​

{
"name": "ethereum",
"rpc": "https://eth.blockrazor.xyz"
}

Sonic Configuration​

{
"name": "sonic",
"network": "mainnet"
}

Time-based Activity Configuration​

Configure when and how your agent operates throughout the day:

{
"use_time_based_weights": true,
"time_based_multipliers": {
"tweet_night_multiplier": 0.4, // Reduces tweet frequency 1 AM - 5 AM
"engagement_day_multiplier": 1.5 // Increases engagement 8 AM - 8 PM
}
}

The agent will automatically:

  • Reduce tweeting during night hours (1 AM - 5 AM) to 40% of normal frequency
  • Increase engagement during day hours (8 AM - 8 PM) by 150%
  • Maintain normal activity at other times

This configuration allows you to:

  • Control posting frequency during different times of day
  • Adjust engagement levels based on time periods
  • Create more natural activity patterns

Fine-Tuning Your Model​

For more sophisticated outputs, you can fine-tune your own model. Follow the OpenAI fine-tuning guide for detailed instructions.

Best Practices​

  1. Detailed Bio: Provide a rich backstory and context for your agent
  2. Diverse Examples: Include varied examples that showcase different aspects of your agent's personality
  3. Balanced Weights: Adjust task weights to create natural behavior patterns
  4. Appropriate Intervals: Set reasonable delays between actions to avoid rate limits

Tips for Success​

  • Craft a unique and consistent personality for your agent
  • Use examples that demonstrate the desired tone and style
  • Monitor your agent's performance and adjust configuration as needed
  • Keep rate limits in mind when setting intervals
  1. (Optional) Install server mode
poetry install --extras server