Eliza Architecture
Core Components
┌────────────────────────────────────────┐
│ Character Config │
│ Name, Bio, Style, Knowledge, Plugins │
├────────────────────────────────────────┤
│ Agent Runtime │
│ Memory │ Actions │ Evaluators │ RAG │
├────────────────────────────────────────┤
│ Platform Clients │
│ Discord │ Telegram │ Twitter │ Slack │
├────────────────────────────────────────┤
│ Model Providers │
│ OpenAI │ Claude │ Gemini │ Ollama │
└────────────────────────────────────────┘Character System
Define agent personality with a JSON character file:
{
"name": "Luna",
"bio": [
"Luna is a crypto-native AI that helps DeFi users understand yield farming.",
"She explains complex concepts in simple analogies."
],
"lore": [
"Was created during the 2024 DeFi summer.",
"Has analyzed over 1000 liquidity pools."
],
"knowledge": [
"DeFi protocols and yield strategies",
"Smart contract security basics"
],
"messageExamples": [
[
{"user": "user1", "content": {"text": "What's impermanent loss?"}},
{"user": "Luna", "content": {"text": "Think of it like this: you put apples and oranges in a basket. If apples suddenly become 10x more valuable, you'd wish you kept them separate. That difference is impermanent loss."}}
]
],
"style": {
"all": ["Uses food analogies for DeFi concepts"],
"chat": ["Keeps explanations under 3 sentences"],
"post": ["Shares one DeFi insight per tweet"]
}
}Multi-Platform Deployment
Deploy the same agent across platforms simultaneously:
// Each client maintains the same personality
// but adapts to platform norms
const agent = new AgentRuntime({
character: lunaCharacter,
clients: [
new DiscordClient(), // Long-form responses
new TelegramClient(), // Inline keyboard interactions
new TwitterClient(), // Short, punchy tweets
new SlackClient(), // Professional tone
],
});RAG-Based Memory
Agents remember past conversations using retrieval-augmented generation:
User (Day 1): "I'm interested in ETH staking"
Luna: "Great choice! ETH staking yields around 3-4% APY..."
User (Day 30): "Any updates for me?"
Luna: "Since you're interested in ETH staking, you should
know that Lido just launched v3 with better rates..."Memory is stored in a local SQLite database with vector embeddings for semantic retrieval.
Plugin Ecosystem
| Plugin Category | Examples |
|---|---|
| Crypto/DeFi | Token trading, wallet management, DEX interactions |
| Social | Auto-posting, thread creation, community moderation |
| Data | Web search, API calls, document ingestion |
| Gaming | Game state tracking, player interactions |
| Infrastructure | Database, caching, scheduling |
Actions System
Define custom actions for your agent:
const checkPriceAction = {
name: "CHECK_TOKEN_PRICE",
description: "Check the current price of a cryptocurrency",
validate: async (runtime, message) => {
return message.content.text.match(/price of|how much is/i);
},
handler: async (runtime, message) => {
const token = extractToken(message.content.text);
const price = await fetchPrice(token);
return { text: `${token} is currently $${price}` };
},
};FAQ
Q: What is Eliza? A: Eliza is an open-source TypeScript framework with 18,000+ GitHub stars for building autonomous AI agents that operate across Discord, Telegram, Twitter, and Slack with persistent memory and consistent personality.
Q: Can Eliza work with local models? A: Yes. Eliza supports Ollama and any OpenAI-compatible local endpoint, so you can run agents entirely on your own hardware for privacy.
Q: Is Eliza free? A: Yes, fully open-source under MIT license. You pay for LLM API calls and platform API access (e.g., Twitter API).