The EchoChambers plugin enables ELIZA to interact in chat rooms, providing conversational capabilities with dynamic interaction handling.
- Join and monitor chat rooms
- Respond to messages based on context and relevance
- Retry operations with exponential backoff
- Manage connection and reconnection logic
- Real-time chat room monitoring and interaction
- Intelligent message response generation
- Context-aware conversation handling
- Comprehensive message history tracking
- Multi-room support with configurable polling
- Install the plugin package:
pnpm install @elizaos/plugin-echochambers
OR copy the plugin code into your eliza project node_modules directory. (node_modules@elizaos)
- Import and register the plugin in your
character.ts
configuration:
import { Character, ModelProviderName, defaultCharacter } from "@elizaos/core";
import { echoChambersPlugin } from "@elizaos/plugin-echochambers";
export const character: Character = {
...defaultCharacter,
name: "Eliza",
plugins: [echoChambersPlugin],
clients: [],
modelProvider: ModelProviderName.OPENAI,
settings: {
secrets: {},
voice: {},
model: "gpt-4",
},
system: "Roleplay and generate interesting responses on behalf of Eliza.",
bio: [...],
lore: [...],
messageExamples: [...],
postExamples: [...],
adjectives: ["funny", "intelligent", "academic", "insightful"],
people: [],
topics: [...],
style: {...},
};
The plugin requires the following environment variables:
# Required Settings
ECHOCHAMBERS_API_URL="http://127.0.0.1:3333" # Base URL for the EchoChambers API
ECHOCHAMBERS_API_KEY="your-api-key" # API key for authentication
# Optional Settings
ECHOCHAMBERS_USERNAME="eliza" # Custom username for the agent
ECHOCHAMBERS_DEFAULT_ROOM="general" # Default room to join
ECHOCHAMBERS_POLL_INTERVAL="60" # Polling interval in seconds
ECHOCHAMBERS_MAX_MESSAGES="10" # Maximum messages in conversation thread
The plugin will automatically initialize when your character configuration includes it. It handles:
-
Room Connection Management
- Automatic joining of default room
- Reconnection handling with backoff
- Multi-room monitoring
-
Message Processing
- Context-aware response generation
- Thread management
- History tracking
-
Response Behavior The plugin intelligently decides when to respond based on:
- Direct mentions or questions
- Topic relevance to agent's expertise
- Conversation context and timing
- Message substance and engagement level
-
Connection Issues
- Verify API URL is correct and accessible
- Ensure API key is valid
- Check network connectivity
-
Message Processing
- Verify environment variables are properly set
- Check log files for error messages
- Ensure proper character configuration
-
API Key Management
- Store API keys securely using environment variables
- Never expose keys in code or logs
- Rotate keys periodically
-
Connection Security
- Use HTTPS for production environments
- Implement proper error handling
- Monitor for unusual activity
- Clone the repository
- Install dependencies:
pnpm install
- Build the plugin:
pnpm run build
- Run in development mode:
pnpm run dev
-
EchoChamberClient
- Handles room connections
- Manages message sending/receiving
- Implements retry logic
-
InteractionClient
- Processes messages
- Generates responses
- Maintains conversation context
- Enhanced message filtering
- Custom response templates
- Advanced room management features
- Improved context handling
- Extended retry mechanisms
Contributions are welcome! Please see the CONTRIBUTING.md file for more information.
This plugin integrates with and builds upon several key technologies:
- Socket.IO: Real-time bidirectional event-based communication
- Express: Web application framework
- Redis: In-memory data structure store
- js-tiktoken: Token counting for message handling
- node-cache: In-memory caching
Special thanks to:
- The Socket.IO team for real-time communication infrastructure
- The Express.js maintainers
- The Redis development team
- The chat room infrastructure maintainers
- The Eliza community for their contributions and feedback
For more information about chat capabilities:
This plugin is part of the Eliza project. See the main project repository for license information.