Build and coordinate multiple specialized agents working together as a team
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:
hemingway.json
. You’ll now have:
src/character.ts
- Shakespeare (TypeScript format)hemingway.json
- Hemingway (JSON format)character.ts
file from your IDE. They work exactly the same, it’s just a matter of preference.hemingway.json
and update it to customize Hemingway’s personality:
topics
, style
, messageExamples
, etc.) to match Hemingway as you see fit.
plugin-discord
to Hemingway so he can join Shakespeare in our Discord server:
.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
):
src/character.ts
):
hemingway.json
):
src/character.ts
):
plugin-elevenlabs
to provide high-quality voice synthesis for our agents:
Add ElevenLabs plugin:
hemingway.json
):
src/character.ts
):
src/index.ts
to include both agents so they start automatically: