Thanks to visit codestin.com
Credit goes to github.com

Skip to content

EvoAgentX: Building a Self-Evolving Ecosystem of AI Agents

License

Notifications You must be signed in to change notification settings

zxy-ml84/EvoAgentX

 
 

Repository files navigation

Building a Self-Evolving Ecosystem of AI Agents

Docs EvoAgentX Homepage Discord Twitter Wechat

GitHub star chart License

Powering intelligent agent development from start to scale.

🔥 Latest News

  • [May 2025] 🎉 EvoAgentX has been officially released!

⚡Get Started

Installation

We recommend installing EvoAgentX using pip:

pip install evoagentx

For local development or detailed setup (e.g., using conda), refer to the Installation Guide for EvoAgentX.

Example (optional, for local development):
git clone https://github.com/EvoAgentX/EvoAgentX.git
cd EvoAgentX
# Create a new conda environment
conda create -n evoagentx python=3.10

# Activate the environment
conda activate evoagentx

# Install the package
pip install -r requirements.txt
# OR install in development mode
pip install -e .

Configuration

To use LLMs with EvoAgentX (e.g., OpenAI), you must set up your API key.

Option 1: Set API Key via Environment Variable

  • Linux/macOS:
export OPENAI_API_KEY=<your-openai-api-key>
  • Windows Command Prompt:
set OPENAI_API_KEY=<your-openai-api-key>
  • Windows PowerShell:
$env:OPENAI_API_KEY="<your-openai-api-key>" # " is required 

Once set, you can access the key in your Python code with:

import os
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")

Option 2: Use .env File

  • Create a .env file in your project root:
OPENAI_API_KEY=<your-openai-api-key>

Then load it in Python:

from dotenv import load_dotenv 
import os 

load_dotenv() # Loads environment variables from .env file
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")

🔐 Tip: Don’t forget to add .env to your .gitignore to avoid committing secrets.

Configure and Use the LLM

Once the API key is set, initialise the LLM with:

from evoagentx.models import OpenAILLMConfig, OpenAILLM

# Load the API key from environment
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")

# Define LLM configuration
openai_config = OpenAILLMConfig(
    model="gpt-4o-mini",       # Specify the model name
    openai_key=OPENAI_API_KEY, # Pass the key directly
    stream=True,               # Enable streaming response
    output_response=True       # Print response to stdout
)

# Initialize the language model
llm = OpenAILLM(config=openai_config)

# Generate a response from the LLM
response = llm.generate(prompt="What is Agentic Workflow?")

📖 More details on supported models and config options: LLM module guide.

Examples: Automatic WorkFlow Generation

Once your API key and language model are configured, you can automatically generate and execute multi-agent workflows in EvoAgentX.

🧩 Core Steps:

  1. Define a natural language goal
  2. Generate the workflow with WorkFlowGenerator
  3. Instantiate agents using AgentManager
  4. Execute the workflow via WorkFlow

💡 Minimal Example:

from evoagentx.workflow import WorkFlowGenerator, WorkFlowGraph, WorkFlow
from evoagentx.agents import AgentManager

goal = "Generate html code for the Tetris game"
workflow_graph = WorkFlowGenerator(llm=llm).generate_workflow(goal)

agent_manager = AgentManager()
agent_manager.add_agents_from_workflow(workflow_graph, llm_config=openai_config)

workflow = WorkFlow(graph=workflow_graph, agent_manager=agent_manager, llm=llm)
output = workflow.execute()
print(output)

You can also:

  • 📊 Visualise the workflow: workflow_graph.display()
  • 💾 Save/load workflows: save_module() / from_file()

📂 For a complete working example, check out the workflow_demo.py

Demo Video

🎥 Demo video coming soon – stay tuned!

In the meantime, check out the EvoAgentX Quickstart Guide for a step-by-step guide to get started with EvoAgentX.

Tutorial and Use Cases

Explore how to effectively use EvoAgentX with the following resources:

Cookbook Description
Build Your First Agent A comprehensive guide to creating your first agent step-by-step.
Building Workflows Manually Learn how to design and implement collaborative agent workflows.
Benchmark and Evaluation Tutorial Guidelines for evaluating and benchmarking agent performance.
SEW Optimizer Tutorial Learn optimization techniques for enhancing agent workflows.

🛠️ Follow the tutorials to build and optimize your EvoAgentX workflows.

💡 Discover real-world applications and unleash the potential of EvoAgentX in your projects!

🙋 Support

Join the Community

📢 Stay connected and be part of the EvoAgentX journey!
🚩 Join our community to get the latest updates, share your ideas, and collaborate with AI enthusiasts worldwide.

  • Discord — Chat, discuss, and collaborate in real-time.
  • X (formerly Twitter) — Follow us for news, updates, and insights.
  • WeChat — Connect with our Chinese community.

Contact Information

If you have any questions or feedback about this project, please feel free to contact us. We highly appreciate your suggestions!

We will respond to all questions within 2-3 business days.

🙌 Contributing to EvoAgentX

Thanks go to these awesome contributors

We appreciate your interest in contributing to our open-source initiative. We provide a document of contributing guidelines which outlines the steps for contributing to EvoAgentX. Please refer to this guide to ensure smooth collaboration and successful contributions. 🤝🚀

Star History Chart

📄 License

Source code in this repository is made available under the MIT License.

About

EvoAgentX: Building a Self-Evolving Ecosystem of AI Agents

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%