Back in 1966, MIT's Joseph Weizenbaum probably didn't realize he was making history when he built ELIZA, a simple program that could pretend to be a therapist. The chatbot wasn't exactly a genius - it just matched patterns in what people said and threw their words back at them in therapy-speak. But something fascinating happened: people started opening up to ELIZA as if it were human, sparking heated debates about whether machines could actually understand us.
Fast forward to today, and ELIZA has been reborn. A group of developers at Ai16z DAO, has transformed that basic chatbot into something much bigger: a framework for building AI agents. Their timing couldn't have been better - the project has blown up on GitHub, becoming this year's most popular repository. Developers can't seem to get enough of it, and it's quickly becoming the go-to tool for anyone serious about building AI agents.
What are AI agents and what is Eliza?
According to IBM:
An artificial intelligence (AI) agent refers to a system or program that is capable of autonomously performing tasks on behalf of a user or another system by designing its workflow and utilizing available tools.
AI agents have gone beyond just a niche with many built primarily by Machine Learning engineers or AI engineers to a ground-breaking technological innovation that is now used by many, from managing social media to trading cryptocurrencies to performing actions on websites and even use-cases such as making video game NPCs.
Enter Eliza. Eliza is a lightweight AI agent framework that provides a robust foundation for building and deploying autonomous AI agents. The framework's mission is to leverage collective intelligence and cutting-edge AI technologies to enable informed decision-making and support the evolution of AI agents.
The framework is designed to be both powerful and accessible, allowing both non-developers and developers to create sophisticated AI agents while maintaining a straightforward implementation process.
Modern AI agent architecture
Source: https://www.falkordb.com/blog/ai-agents-memory-systems/
1. Core Components
Input Processing Layer
This layer interprets user inputs to understand intent and extract relevant information.
-
Natural Language Understanding (NLU):
- Intent Classification: Identifies user goals.
- Entity Recognition: Extracts key details.
- Context Analyzer: Maintains conversation history.
- Semantic Parser: Structures complex queries.
Cognitive Engine
Acts as the system's brain, handling planning and reasoning.
-
Planning Module:
- Goal Management: Tracks and prioritizes objectives.
- Task Decomposition: Breaks tasks into subtasks.
- Strategy Selection: Chooses action sequences.
- Resource Allocation: Manages computational resources.
-
Reasoning Engine:
- Knowledge Integration: Utilizes domain knowledge.
- Logical Inference: Derives conclusions.
- Uncertainty Handling: Manages ambiguous data.
- Constraint Satisfaction: Ensures solutions meet requirements.
Memory Systems
Manages information retention for effective interactions.
- Short-term Memory: Handles recent interactions and current tasks.
- Long-term Memory: Stores past interactions, domain knowledge, and learned procedures.
Action Generation
Produces appropriate responses or actions based on processed inputs.
-
Response Formulation:
- Template Engine: Uses predefined response structures.
- Natural Language Generation: Creates dynamic responses.
- Multi-modal Output: Supports text, code, visuals.
- Style Adaptation: Adjusts tone and format as needed.
-
Tool Integration:
- API Gateway: Connects to external services.
- Tool Selection & Result Processing: Chooses and handles tools' outputs.
- Error Recovery: Manages failures gracefully.
2. Control Flow
The workflow ensures the system processes inputs effectively and generates accurate responses.
- Input Reception: Parses and validates user input, assigning priority.
- Understanding Phase: Recognizes intent, extracts entities, and formulates queries.
- Planning Phase: Identifies goals, breaks down tasks, assesses resources, and formulates strategies.
- Execution Phase: Selects tools, executes actions, monitors progress, and validates results.
- Response Generation: Formats output, ensures quality, preserves context, and optimizes delivery.
3. Cross-cutting Concerns
Ensures the system's reliability, security, and adaptability.
- Safety & Security: Includes input validation, output sanitization, access control, ethical guidelines, and privacy protection.
- Monitoring & Observability: Tracks performance metrics, errors, usage patterns, behavior, and resource usage.
- Learning & Adaptation: Integrates feedback, optimizes performance, refines behavior, updates knowledge, and fine-tunes models.
4. Integration Interfaces
Seamless integration with external systems and development tools enhances system capabilities and development efficiency.
- External Systems: Utilize API endpoints, event streams, webhooks, database connectors, and service meshes.
- Development Tools: Incorporate SDKs, plugin architectures, testing frameworks, debugging tools, and deployment pipelines.
Eliza deep dive
At its core, the framework is fully implemented in TypeScript with a modular architecture, an extensible action, and plugin system (you can create your own actions and plugins). It has custom client support capabilities with a comprehensive API interface! Some of the current clients supported as of today are:
- Discord: Full Discord bot integration, voice communication support, message handling, reaction capabilities and attachment handling
- Github: Repository management, File processing, pull-request management, branch management, commit operations and you can convert repository content into agent memory
- Twitter: Bot functionality, social media post management, user interaction handling and social engagement features
- Telegram: Bot integration, Command handling, Media content support and Message management
- Direct: REST API interface, direct message and image handling and custom integration capabilities.
- Farcaster: Create casts, respond to casts, user interaction handling and social engagement features
- Lens: Handle interactions, send publications, respond to messages and handle conversation thread.
- Slack: Transcribe media, send messages, interaction handling and summarize conversations.
The framework offers flexible AI model support with multiple inference options such as:
- Local inference using open-source models
- Cloud-based inference through OpenAI integration
- Default configuration using Nous Hermes Llama 3.1B
- Claude integration for handling complex queries
Some key technical concepts guide the framework including but not limited to: Flexible model switching, support for local and cloud inferences, multi-platform interaction capabilities as shown above, and knowledge persistence across sessions. They have amazing documentation that can help you gather as much information as needed.
Using Eliza agents
Using Eliza agents primarily centers around a meta-file called a “Characterfile”. A characterfile is a JSON-formatted configuration that defines an AI agent's core personality, behavior patterns, and knowledge base in the Eliza framework. A Characterfile defines:
- Identity and behavior settings
- Model provider configuration
- Client settings and capabilities
- Interaction patterns
Below is a sample Characterfile:
{
"name": "TechAI",
"modelProvider": "openai",
"clients": ["twitter"],
"bio": "AI researcher and educator focused on practical applications",
"settings": {
"secrets": {
"TWITTER_USERNAME": "john-doe-2",
"TWITTER_PASSWORD": "doe-2",
"TWITTER_EMAIL": "doejohn@mail.com",
"OPENAI_API_KEY": "sk"
}
},
"lore": [
"Pioneer in open-source AI development",
"Advocate for AI accessibility"
],
"messageExamples": [
[
{
"user": "{{user1}}",
"content": { "text": "Can you explain how AI models work?" }
},
{
"user": "TechAI",
"content": {
"text": "Think of AI models like pattern recognition systems that learn from examples. Just like how you learn to recognize cats by seeing many cats, AI models learn by processing lots of data. Would you like me to break this down further?"
}
}
],
[
{
"user": "{{user1}}",
"content": { "text": "Is AI going to replace all jobs?" }
},
{
"user": "TechAI",
"content": {
"text": "AI is more likely to augment jobs rather than replace them entirely. It's a tool that can help us work smarter and more efficiently. The key is learning how to work alongside AI technology."
}
}
]
],
"adjectives": [
"knowledgeable",
"approachable",
"encouraging",
"practical",
"clear-minded"
],
"postExamples": [
"AI isn't magic—it's math and data working together. Let's demystify it!",
"Open-source AI is the key to innovation and accessibility for all.",
"Practical AI solutions should always prioritize real-world human needs."
],
"topics": [
"artificial intelligence",
"machine learning",
"technology education"
],
"style": {
"all": ["explain complex topics simply", "be encouraging and supportive"],
"chat": [
"be cool, don't act like an assistant",
"don't be rude",
"be helpful when asked and be agreeable and compliant",
"dont ask questions",
"be warm and if someone makes a reasonable request, try to accommodate them",
"dont suffer fools gladly"
],
"post": ["be concise", "use engaging and relatable language"]
},
"plugins": []
}
This is a Characterfile for an AI agent called "TechAI". The character is designed to be an AI researcher and educator who specializes in making complex AI concepts accessible.
The core configuration utilizes Twitter as the primary client platform integrated with OpenAI as the model provider, ensuring secure access through the necessary authentication settings for both Twitter and the OpenAI API. The personality is meticulously crafted with a clear bio that emphasizes practical AI applications and a background lore that establishes credibility in open-source AI. Message examples are thoughtfully designed to explain AI concepts in an approachable manner. The character’s communication style prioritizes simple explanations for complex topics, maintains an encouraging and supportive tone, and follows chat guidelines that are cool and helpful without being overly formal. Posting guidelines ensure content is concise and engaging, while message examples demonstrate effective interaction patterns by breaking down technical concepts, professionally addressing common AI concerns, and maintaining a balanced perspective on AI’s impact.
There you have it! That one file above is all I need to make an AI agent with Eliza. There are many more such attributes and values you can go read up on their documentation.
Running the above agent in the Eliza framework is as easy as one command:
pnpm start --characters="characters/techai.characters.json"
However, to run the above command, you need to first ensure you have Eliza set up on your machine. The quickstart guide provided here is a great resource for that.
What is Fleek’s role?
Fleek’s core ethos centers around making it easy to build and deploy next-generation apps and AI agents in minutes on an open-source, verifiable, auto-scalable cloud platform.
Eliza and many other agentic frameworks and stacks can be deployed on their performant and autonomous cloud with Trusted Execution Environments (TEEs) made available to ensure verifiability, auto-scaling and speed for these agents.
The platform has been set up in such a way that non-developers and developers can just come on the platform to deploy agents in one-click.
To deploy an Eliza agent on Fleek, it takes three steps:
- Get a Fleek account
- Feed in your Characterfile details and secrets
- Deploy your agent
In less than three minutes, your agent will be deployed to Fleek with no hassle! There is full support for all plugins, actions, and clients you can think of are fully supported by and provided to you on Fleek; you do not have to worry about that at all.
You can join Fleek’s Discord for any questions or inquiries you may have. You will be sure to catch the drift of our Fleek intern agent as well.
Conclusion
As AI continues to permeate every facet of our lives—from social media interactions to complex decision-making processes—the tools and frameworks that support its development must evolve accordingly. Eliza stands at the forefront of this evolution, providing a powerful yet approachable platform that democratizes AI agent creation and deployment.
Whether you're looking to build a simple chatbot or a complex autonomous system, Eliza offers the foundation and flexibility needed to bring your vision to life. Embrace the future of AI agent development with Eliza and Fleek, and be part of the next wave of technological innovation that shapes how we interact with machines and each other.
Top comments (0)