Introduction
This guide will walk you through creating a simple AI agent that can hold conversations and perform actions. By the end, you’ll have a working agent running on your machine.Prerequisites: Make sure you’ve completed the Installation guide before starting.
Step 1: Create Your First Agent
Let’s create a simple conversational agent using theAgentRuntime from @elizaos/core.
Define your agent's character
Create a character configuration that defines your agent’s personality and capabilities:
my-first-agent.ts
Step 2: Add Conversation Handling
Now let’s make your agent interactive by adding the ability to process messages:Create a message processing function
Add this function to handle incoming messages:
my-first-agent.ts
Step 3: Make It Interactive
Let’s add a CLI interface so you can have real conversations with your agent:Step 4: Add Custom Actions
Let’s extend your agent with a custom action that can perform a specific task:Complete Example
Here’s the complete code for your first agent:Using WASM Runtime (Alternative)
You can also use the Rust-based WASM runtime for better performance:Next Steps
Congratulations! You’ve built your first AI agent with elizaOS. Here’s what to explore next:What You Can Build
Discover use cases from chatbots to autonomous agents
Core Concepts
Deep dive into AgentRuntime, Actions, and Providers
Add Plugins
Integrate Discord, Telegram, databases, and more
Examples
Browse more complete examples and templates