What are Agents?

Agents = AI personalities with memory, actions, and unique behaviors.

Character Interface

The complete TypeScript interface for agents:

PropertyTypeRequiredDescription
namestringAgent’s display name
biostring | string[]Background/personality description
adjectivesstring[]Character traits (e.g., “helpful”, “creative”)
topicsstring[]Conversation topics the agent knows
knowledgearrayFacts, files, or directories of knowledge
messageExamplesarray[][]Example conversations (2D array)
postExamplesstring[]Example social media posts
styleobjectWriting style for different contexts
pluginsstring[]Enabled plugin packages
settingsobjectConfiguration values
secretsobjectSensitive configuration
idUUIDUnique identifier
usernamestringSocial media username
systemstringSystem prompt override
templatesobjectCustom prompt templates
all?: string[]; // General style rules
chat?: string[]; // Chat-specific style
post?: string[]; // Post-specific style
};

// Advanced templates?: Templates; // Custom prompt templates }


## Working Example

```typescript
export const character: Character = {
  name: "Eliza",
  bio: [
    "Helpful AI assistant",
    "Expert in technical topics",
    "Friendly conversationalist"
  ],
  adjectives: ["helpful", "knowledgeable", "friendly"],
  topics: ["technology", "programming", "general knowledge"],
  
  // 2D array: each sub-array is a conversation
  messageExamples: [[
    {
      name: "{{user}}",
      content: { text: "Can you help me debug this?" }
    },
    {
      name: "Eliza",
      content: { text: "I'd be happy to help! Can you share the error message?" }
    }
  ]],
  
  style: {
    all: ["be concise", "use examples"],
    chat: ["be conversational"],
    post: ["use emojis sparingly"]
  },
  
  // Plugins loaded based on environment
  plugins: [
    "@elizaos/plugin-bootstrap", // Core functionality
    ...(process.env.DISCORD_API_TOKEN ? ["@elizaos/plugin-discord"] : []),
    ...(process.env.OPENAI_API_KEY ? ["@elizaos/plugin-openai"] : [])
  ]
};

Knowledge Configuration

// String facts
knowledge: ["I am an AI assistant", "I help with coding"]

Memory & Runtime

Agents remember:

  • Recent conversations
  • Important facts about users
  • Context from previous interactions

At runtime, characters become Agent instances with status tracking:

interface Agent extends Character {
  enabled?: boolean;
  status?: 'active' | 'inactive';
  createdAt: number;
  updatedAt: number;
}

Character Definition

Characters can be defined in TypeScript (recommended) or JSON:

Creating an Agent

1

Define your character

Create character.ts or character.json

2

Add plugins

plugins: [
  "@elizaos/plugin-bootstrap",
  "@elizaos/plugin-discord" 
]
3

Start the agent

elizaos start

Best Practices

  • Keep personality traits consistent
  • Provide diverse message examples
  • Focus knowledge on the agent’s purpose
  • Test conversations before deploying
  • Use TypeScript for better type safety
  • Load plugins conditionally based on environment

Next Steps