Skip to main content

Your First Character (2 minutes)

A character file is all you need to create a unique agent. Here’s the minimum:
That’s it. Your agent now has a name, personality, and can chat. Everything else is optional.
Start minimal, add complexity later. Most fields have sensible defaults. Only add what you need.

Overview

In elizaOS, the distinction between a Character and an Agent is fundamental:
  • Character: A configuration object that defines an agent’s personality, capabilities, and settings
  • Agent: A runtime instance created from a Character, with additional status tracking and lifecycle management
Think of a Character as a blueprint and an Agent as the living instance built from that blueprint. For hands-on implementation, see Customize an Agent. For runtime details, see Runtime and Lifecycle.

Character vs Agent

The transformation from Character to Agent happens at runtime:

Character Interface Reference

The complete TypeScript interface for agents:

Core Properties

Identity Configuration

The fundamental properties that define who your agent is:

Bio and Description

The bio can be a single string or an array of strings for better organization:

System Prompt Configuration

Override the default system prompt to fine-tune agent behavior:

Templates Object Structure

Custom prompt templates for various agent operations:

Conversation Training

Message Examples Structure

Message examples train the agent’s conversational style using a 2D array format:

Style Configuration

Define writing styles for different contexts:

Knowledge Configuration

Configure the agent’s knowledge base:

Plugin Management

Basic Plugin Configuration

Environment-Based Plugin Loading

Load plugins conditionally based on environment variables:

Settings and Secrets

Settings Object

General configuration values:

Secrets Management

Sensitive data that should never be committed:

Complete Production Example

Here’s a comprehensive character configuration for production use:

Validation and Testing

Character Validation

Use the built-in validation to ensure your character is properly configured:

Testing Character Configurations

Best Practices

  1. Keep personality traits consistent: Ensure bio, adjectives, and style align
  2. Provide diverse message examples: Cover various interaction patterns
  3. Use TypeScript for type safety: Leverage type checking for configuration
  4. Load plugins conditionally: Check for API keys before loading
  5. Order plugins by dependency: Load core plugins before dependent ones
  6. Use environment variables for secrets: Never hardcode sensitive data
  7. Validate before deployment: Always validate character configuration
  8. Test conversation flows: Ensure message examples produce desired behavior
  9. Document custom settings: Clearly explain any custom configuration
  10. Version your characters: Track changes to character configurations

Migration Guide

From JSON to TypeScript

Converting a JSON character to TypeScript:

See Also

Personality & Behavior

Learn to craft unique agent personalities

Memory & State

Understand how agents remember and learn

Runtime & Lifecycle

See how characters become live agents

Plugin Development

Extend your agent with custom plugins

Core Runtime

How the runtime orchestrates your agent

Deploy to Cloud

Ship your agent to production in minutes