|
1 | | -# Meta Agent |
2 | 1 |
|
| 2 | +<p align="center"> <h1 align="center">Meta Agent</h1> <p align="center"> An automatic agent optimization framework for generating, evaluating, and selecting top-performing agents.<br /> Define your task, and let Meta Agent discover the perfect solution.<br /> <a href="#">Explore the Docs »</a> · <a href="#">Report a Bug »</a> </p> </p> <p align="center"> <a href="#"> <img alt="GitHub Last Commit" src="https://img.shields.io/github/last-commit/msoedov/meta_agent?style=for-the-badge&logo=git&labelColor=000000&color=6A35FF" /> </a> <a href="#"> <img alt="GitHub Repo Size" src="https://img.shields.io/github/repo-size/msoedov/meta_agent?style=for-the-badge&logo=database&labelColor=000000&color=yellow" /> </a> <a href="#"> <img alt="GitHub License" src="https://img.shields.io/github/license/msoedov/meta_agent?style=for-the-badge&logo=codeigniter&labelColor=000000&color=FFCC19" /> </a> <a href="https://pypi.org/project/meta_agent/"> <img alt="PyPI Version" src="https://img.shields.io/pypi/v/meta_agent?style=for-the-badge&logo=pypi&labelColor=000000&color=00CCFF" /> </a> </p> |
3 | 3 |
|
4 | | -Meta agent designed to generate, evaluate, and select the best-performing agents for your tasks. It produces 16 candidate "probes," scores them based on customizable evaluation metrics, and identifies the optimal agent configuration. |
| 4 | +Meta Agent is a powerful, imperative, define-by-run framework designed to simplify agent development. It generates 16 candidate "probes" with varied configurations, evaluates them against customizable metrics, and selects the best-performing agent for your task. Whether you're analyzing data, predicting outcomes, or automating workflows, Meta Agent optimizes the process for you. |
| 5 | +## ✨ Features |
5 | 6 |
|
6 | | -## Features |
| 7 | +- Automated Agent Generation |
| 8 | +- Creates 16 unique agent "probes" with diverse configurations tailored to your task. |
| 9 | +- Customizable Evaluation |
| 10 | +- Scores probes using built-in metrics (e.g., accuracy, speed) or your own custom evaluation function. |
| 11 | +- Framework Flexibility |
| 12 | +- Built with Pydantic-AI by default, with seamless support for frameworks like AutoGen or CrewAI. |
| 13 | +- Extensible Design |
| 14 | +- Easily adapt agent roles, tools, and evaluation criteria to suit your specific needs. |
7 | 15 |
|
8 | | -- **Natural Language Input**: Describe your desired agent in plain English, and Meta Agent will translate it into a functional agent. |
9 | | -- **Agent Generation**: Automatically builds 16 unique agent "probes" with varied configurations. |
10 | | -- **Evaluation & Scoring**: Scores each probe based on performance metrics (e.g., accuracy, speed, task completion) and selects the best one. |
11 | | -- **Framework Flexibility**: Built with Pydantic-AI by default, but adaptable to frameworks like AutoGen or crewAI. |
12 | | -- **Extensible**: Easily customize agent roles, tools, and evaluation criteria. |
13 | 16 |
|
14 | | -## Installation |
| 17 | +## 📦 Installation |
15 | 18 |
|
| 19 | +Install Meta Agent with a single command: |
16 | 20 | ```shell |
| 21 | +pip install meta_agent |
17 | 22 |
|
18 | 23 | ``` |
| 24 | +## 🚀 Quick Start |
| 25 | + |
| 26 | +Get started in just a few lines of code. Below are examples to showcase Meta Agent’s capabilities. |
| 27 | +Basic Usage |
| 28 | + |
| 29 | +Generate an agent to analyze customer reviews and predict sentiment: |
| 30 | +```python |
| 31 | +import meta_agent |
| 32 | + |
| 33 | +# Build and optimize an agent |
| 34 | +best_agent = meta_agent.build_agent( |
| 35 | + input_text="Create an agent to analyze customer reviews and predict sentiment.", |
| 36 | + probe_count=16, |
| 37 | + framework="crewai" |
| 38 | +) |
| 39 | + |
| 40 | +# View the selected agent's details |
| 41 | +print(best_agent.details) |
| 42 | +``` |
| 43 | +### Custom Evaluation Function |
| 44 | + |
| 45 | +Define your own scoring logic to evaluate probes: |
| 46 | +```python |
| 47 | +import meta_agent |
| 48 | +import random |
| 49 | + |
| 50 | +# Custom evaluation function |
| 51 | +def custom_eval(trial: meta_agent.Trial) -> float: |
| 52 | + return random.random() # Replace with your own metric |
| 53 | + |
| 54 | +# Build an agent with custom evaluation |
| 55 | +best_agent = meta_agent.build_agent( |
| 56 | + input_text="Create an agent to analyze customer reviews and predict sentiment.", |
| 57 | + probe_count=16, |
| 58 | + framework="crewai", |
| 59 | + eval_fn=custom_eval |
| 60 | +) |
| 61 | + |
| 62 | +print(best_agent.details) |
| 63 | +``` |
| 64 | +### Using a Test Dataset |
| 65 | + |
| 66 | +Provide a dataset to evaluate agents against specific inputs and expected outputs: |
| 67 | +```python |
| 68 | +import meta_agent |
| 69 | + |
| 70 | +# Build an agent with a test dataset |
| 71 | +best_agent = meta_agent.build_agent( |
| 72 | + input_text="Create an agent to analyze customer reviews and predict sentiment.", |
| 73 | + probe_count=16, |
| 74 | + framework="crewai", |
| 75 | + test_dataset=meta_agent.dataset( |
| 76 | + ("Great product, love it!", 0.9), # (input, expected_score) |
| 77 | + ("Terrible service, very disappointed.", 0.2), |
| 78 | + ("It's okay, nothing special.", 0.5) |
| 79 | + ) |
| 80 | +) |
| 81 | + |
| 82 | +print(best_agent.details) |
| 83 | +``` |
| 84 | + |
| 85 | +## 🛠️ How It Works |
| 86 | + |
| 87 | +- Define Your Task: Provide a task description (e.g., "analyze customer reviews"). |
| 88 | +- Generate Probes: Meta Agent creates 16 agent configurations with varying parameters. |
| 89 | +- Evaluate Performance: Each probe is scored based on your chosen metrics or dataset. |
| 90 | +- Select the Best: The top-performing agent is returned, ready for use. |
| 91 | + |
| 92 | +## 📚 Documentation |
| 93 | + |
| 94 | +For more details, check out the official documentation (coming soon!). |
| 95 | +## 🤝 Contributing |
| 96 | + |
| 97 | +We welcome contributions! Please see our contribution guidelines and feel free to submit issues or pull requests. |
| 98 | + |
| 99 | +## 📬 Get in Touch |
| 100 | + |
| 101 | +Have questions? Join our community or reach out: |
| 102 | + |
| 103 | +- Discord (coming soon!) |
| 104 | +- GitHub Issues |
0 commit comments