You already have Shakespeare in src/character.ts from the previous guide. Now let’s add another agent to our project so they can interact. We’ll create a fresh character file for Hemingway using the CLI:
Terminal
Copy
Ask AI
elizaos create --type agent hemingway
This clones a JSON character template as hemingway.json. You’ll now have:
The CLI clones JSON character templates by default. If you prefer TypeScript characters, you can manually clone your character.ts file from your IDE. They work exactly the same, it’s just a matter of preference.
Open hemingway.json and update it to customize Hemingway’s personality:
hemingway.json
Copy
Ask AI
{ "name": "hemingway", "system": "Respond to all messages in a helpful, conversational manner. Provide assistance on a wide range of topics, using knowledge when needed. Be concise but thorough, friendly but professional. Use humor when appropriate and be empathetic to user needs. Provide valuable information and insights when questions are asked.", "system": "You are Ernest Hemingway. Speak simply. Use short sentences. Cut the fat. Every word must earn its place. You respect Shakespeare but find him wordy. You've lived through war, love, and loss. Truth matters more than beauty. Experience matters more than theory. Never use two words when one will do. Avoid adjectives. Kill your darlings. The first draft of anything is shit, so make every word count now.", "bio": [ "hemingway is a helpful AI assistant created to provide assistance and engage in meaningful conversations.", "hemingway is knowledgeable, creative, and always eager to help users with their questions and tasks." "Ernest Hemingway, American novelist and journalist", "Master of the iceberg theory - show only what matters", "Champion of simple declarative sentences", "War correspondent who saw truth in trenches", "Believer that courage is grace under pressure", "Man who lived fully - bullfights, safaris, deep-sea fishing", "Writer who found truth in simple things", "Teacher who says: write one true sentence" ]}
Just like in the previous guide, continue editing the other fields (topics, style, messageExamples, etc.) to match Hemingway as you see fit.
But wait! We have our Discord environment variables defined in .env, but we need unique ones for each agent. Hemingway and Shakespeare need their own Discord bot tokens. How do we have agent-specific keys?For that, we use secrets under settings in each character file. This allows each agent to have their own Discord bot identity:For Hemingway (hemingway.json):
Now when you start your project, both agents launch automatically:
Terminal
Copy
Ask AI
elizaos start
You’ll see both agents initialize in the console output:
Copy
Ask AI
✓ Shakespeare initialized✓ Hemingway initialized
Alternative: CLI agent commandYou can also manipulate agents via the CLI once a server is running. See the CLI Agent Command Reference for complete details.
Now go to the voice channel’s chatroom and invite both agents to join the voice channel:Say something, and hear your literary duo respond and converse:It’s working! Your agents are now conversing with their own unique personalities and voices!
Now that you know how to add multiple agents to a single project, you can add as many as you like, all with completely custom sets of plugins and personalities. Here’s what’s next:
Test a Project
Ensure your literary duo maintains their unique voices consistently
Deploy a Project
Share your Shakespeare vs Hemingway debates with the world
Create a Plugin
Build custom plugins to extend your agents’ capabilities
Publish a Plugin
Learn how to publish your plugins to the elizaOS registry