Skip to main content
This guide assumes you have an elizaOS project set up. If you don’t, follow the quickstart guide

Step 1: Customize the personality

Open src/character.ts in your editor. You’ll see the default character template. Let’s transform this into our Shakespeare agent. For design concepts, see Personality and Behavior. For technical reference, see Character Interface. Let’s start by updating the basic identity. Replace the name.
src/character.ts

Update the system prompt

The system prompt defines the core behavior. Let’s make it Shakespearean.
src/character.ts

Define the bio

The bio array shapes how your agent introduces itself and understands its role. Each line adds depth to the personality.
src/character.ts

Configure topics

Update the topics your agent is knowledgeable about.
src/character.ts

Update message examples

Message examples teach your agent how to respond. These are crucial for maintaining character. Update the content to match Shakespeare’s personality.
src/character.ts

Configure writing style

The style object determines how your agent communicates. For Shakespeare, we want eloquent, poetic responses.
src/character.ts

Update settings

Let’s give Shakespeare a proper avatar.
src/character.ts
Test your agent’s personality customization by running it in development mode.
Terminal
elizaos dev is like elizaos start but with enhanced logging and hot reload, perfect for debugging and testing changes in real-time.
Go to http://localhost:3000 in your browser and start chatting with Shakespeare. You should now get eloquent, Shakespearean responses instead of the default Eliza personality.
To use a different port, run elizaos dev --port 8080 (or any port number).
Shakespeare agent responding in Shakespearean style in the elizaOS web interface
You can also modify agent settings using the rightmost panel in the GUI, but these changes are runtime-only and won’t persist after restarting the server.
As you can see, Shakespeare now responds in Shakespeare-like manner.

Additional character parameters

Your agent has exciting additional customization options we haven’t covered yet, including properties like:
  • knowledge: Add facts, files, or directories of information to your agent
  • templates: Create custom prompt templates
  • username: Set social media usernames
For the complete Character interface, see the Agent Interface documentation. To add large amounts of knowledge to your agent, check out plugin-knowledge which can ingest almost any type of file or media including PDFs, Word docs, markdown, text files, JSON, CSV, XML, and more. It can handle entire document collections, websites, and knowledge bases. For example, you could enhance our Shakespeare agent by ingesting his complete works from MIT’s Shakespeare repository (all 39 plays, 154 sonnets, and poems) for truly authentic responses.

Step 2: Configure Discord plugin

Now that we’ve customized Shakespeare’s personality, let’s connect him to Discord using plugin-discord so everyone can chat with the Bard in your Discord server.

Set up environment variables

Copy/paste the Discord-related variables from .env.example to your .env file:
.env

Create Discord application

Need Discord credentials? Follow these steps:
  1. Go to https://discord.com/developers/applications
  2. Go to the Applications tab
  3. Click “New Application” and set name = “Shakespeare”
  4. Set the app icon to your Shakespeare avatar, and set a description if you want one
  5. Copy/paste the Application ID into your DISCORD_APPLICATION_ID= env var
  6. Click the “Bot” tab
  7. Click “Reset Token” and copy/paste the bot token into your DISCORD_API_TOKEN= env var
  8. Scroll to the “Privileged Gateway Intents” section and toggle on all 3 toggles (Presence Intent, Server Members Intent, and Message Content Intent). Save your changes!
  9. Click the “OAuth2” tab
  10. Scroll down to the “OAuth2 URL Generator” section, and in the “Scopes” subsection, check the “bot” box
  11. Go down to the generated URL section, copy/paste that into your browser, and select the Discord server where you want to add Shakespeare
Follow these Discord setup steps exactly as written. Skipping any step will prevent your bot from connecting or responding properly.

Start your agent

Restart your agent to load all the changes.
Terminal
Your Shakespeare bot is now live! Invite it to your Discord server and try chatting. Shakespeare bot responding in Discord with Shakespearean language

See Also

Here are some logical next-steps to continue your agent dev journey:

Add Multiple Agents

Run multiple specialized agents that work together in coordinated workflows

Test a Project

Learn how to write comprehensive tests for your project and agents

Deploy a Project

Ready to go live? Deploy your elizaOS agent to production environments

Create a Plugin

Build custom plugins to extend your agent’s capabilities

CLI Reference

Master all elizaOS CLI commands for efficient agent development

Plugin Registry

Discover plugins for Twitter, image generation, voice synthesis, and more