← Protocols
ElizaOS
01Description

Open-source agent framework where each agent is defined by a Character file (bio, style, knowledge, plugins) and executed by a runtime with memory, providers, actions, and evaluators. Heavily used for autonomous social agents on Twitter/Discord/Telegram with onchain plugins.

02Best for
  • 01social autonomous agents
  • 02character-driven personas
  • 03Discord/Twitter/Telegram bots
  • 04plugin-based onchain actions
  • 05long-running stateful agents
03Install
  • pnpm dlx elizaos create my-agent
  • cd my-agent && pnpm install && pnpm dlx elizaos start
04Environment variables
VariableScopeDescription
OPENAI_API_KEYServerDefault LLM provider for `@elizaos/plugin-openai`. Swap for Anthropic/local model plugins as needed.
PGLITE_DATA_DIRServerFilesystem path for Eliza's embedded vector DB (e.g. `./.eliza/.elizadb`).
DISCORD_API_TOKENServerOptional — required if using `@elizaos/plugin-discord`.
EVM_PRIVATE_KEYServerOptional — agent wallet key consumed by EVM-flavored plugins (e.g. plugin-evm).
05Prompt snippet
Use ElizaOS to define an agent as a Character file (`character.ts` or `.json`) with `name`, `bio`, `lore`, `messageExamples`, `style`, and a `plugins: ['@elizaos/plugin-sql', '@elizaos/plugin-openai', '@elizaos/plugin-discord']` array. Plugins must be installed *and* listed in the character file to activate. Custom Actions implement `{ name, description, validate, handler }` and are registered through a plugin; Providers inject context into each turn; Evaluators run after responses to update memory. Persist memory via the SQL plugin (PGLite by default) and ship the agent with `elizaos start`. For onchain capabilities, compose with a wallet plugin or the GOAT adapter rather than handing the LLM raw private keys.
06Gotchas
  • Installing a plugin via CLI does not enable it — you must also add the plugin string to the Character file's `plugins` array.
  • PGLite is fine for dev but single-writer; switch to Postgres for multi-process or production deployments.
  • Character file `system` and `bio` are sent on every prompt — large lore arrays inflate token cost per turn.
  • If the agent has a wallet plugin loaded, the LLM can call onchain actions autonomously; gate with a per-action allowlist and a daily spend ceiling.
  • Twitter/Discord plugins poll on intervals — multiple instances of the same character will double-post unless you shard or lease.
  • Plugin packages are versioned independently and break across `@elizaos/core` major bumps; pin all `@elizaos/*` packages together.
07Alternatives