Skip to main content
This guide builds on concepts from Customize an Agent

Step 1: Add Hemingway

Add Hemingway to your project

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
This clones a JSON character template as hemingway.json. You’ll now have:
  • src/character.ts - Shakespeare (TypeScript format)
  • hemingway.json - Hemingway (JSON format)
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.

Customize Hemingway’s personality

Open hemingway.json and update it to customize Hemingway’s personality:
hemingway.json
Just like in the previous guide, continue editing the other fields (topics, style, messageExamples, etc.) to match Hemingway as you see fit.

Step 2: Configure Discord and voice

Add Discord plugin to Hemingway

Add plugin-discord to Hemingway so he can join Shakespeare in our Discord server:
hemingway.json

Configure agent-specific keys

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):
hemingway.json
For Shakespeare (src/character.ts):
src/character.ts
Each agent needs its own Discord application and bot token. Follow the Discord setup steps from the previous guide for each agent you create.

Enable voice mode

Let’s enable voice capabilities for our agents in Discord: For Hemingway (hemingway.json):
hemingway.json
For Shakespeare (src/character.ts):
src/character.ts

Add ElevenLabs voice provider

Now let’s add plugin-elevenlabs to provide high-quality voice synthesis for our agents: Add ElevenLabs plugin:
hemingway.json
src/character.ts

Configure voices for each agent

Now let’s add the ElevenLabs secrets so each agent has their own distinct voice: For Hemingway (hemingway.json):
hemingway.json
For Shakespeare (src/character.ts):
src/character.ts
Get your ElevenLabs API key from elevenlabs.io and explore different voice IDs to find the perfect match for each agent’s personality.

Step 3: Configure multi-agent project

Add newly created agent to your project

Update your src/index.ts to include both agents so they start automatically:
src/index.ts

Launch both agents simultaneously

Now when you start your project, both agents launch automatically:
Terminal
You’ll see both agents initialize in the console output:
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.

Join them in Discord voice chat

Now go to the voice channel’s chatroom and invite both agents to join the voice channel: Discord text channel showing messages inviting Shakespeare and Hemingway to join voice chat Say something, and hear your literary duo respond and converse: Discord voice channel showing Shakespeare and Hemingway engaged in literary debate with their unique voices It’s working! Your agents are now conversing with their own unique personalities and voices!

See Also

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