Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/HumanSignal/Adala
Adala: Autonomous DAta (Labeling) Agent framework
https://github.com/HumanSignal/Adala
agent agent-based-framework agent-oriented-programming autonomous-agents gpt-4
Last synced: 9 days ago
JSON representation
Adala: Autonomous DAta (Labeling) Agent framework
- Host: GitHub
- URL: https://github.com/HumanSignal/Adala
- Owner: HumanSignal
- License: apache-2.0
- Created: 2023-08-30T12:06:57.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-10-29T21:42:39.000Z (10 days ago)
- Last Synced: 2024-10-29T22:49:38.865Z (10 days ago)
- Topics: agent, agent-based-framework, agent-oriented-programming, autonomous-agents, gpt-4
- Language: Python
- Homepage: https://humansignal.github.io/Adala/
- Size: 6.18 MB
- Stars: 955
- Watchers: 20
- Forks: 75
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-ai-agents - GitHub
README
[![PyPI version](https://badge.fury.io/py/adala.svg)](https://badge.fury.io/py/adala)
![Python Version](https://img.shields.io/badge/supported_python_version_-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)
![GitHub](https://img.shields.io/github/license/HumanSignal/Adala)
![GitHub Repo stars](https://img.shields.io/github/stars/HumanSignal/Adala)
[![](https://img.shields.io/discord/1166330284300570624?label=Discord&logo=discord)](https://discord.gg/QBtgTbXTgU)
Adala is an **A**utonomous **DA**ta (**L**abeling) **A**gent framework.
Adala offers a robust framework for implementing agents specialized in data processing, with an emphasis on
diverse data labeling tasks. These agents are autonomous, meaning they can independently acquire one or more skills
through iterative learning. This learning process is influenced by their operating environment, observations, and
reflections. Users define the environment by providing a ground truth dataset. Every agent learns and applies its skills
in what we refer to as a "runtime", synonymous with LLM.![Training Agent Skill](./docs/src/img/training-agents-skill.png "Training Agent Skill")
## ๐ข Why choose Adala?
- ๐ **Reliable agents**: Agents are built upon a foundation of ground
truth data. This ensures consistent and trustworthy results, making Adala a
reliable choice for your data processing needs.
- ๐ฎ **Controllable output**: For every skill, you can configure the
desired output and set specific constraints with varying degrees of
flexibility. Whether you want strict adherence to particular
guidelines or more adaptive outputs based on the agent's learning,
Adala allows you to tailor results to your exact needs.- ๐ฏ **Specialized in data processing**: While agents excel in diverse
data labeling tasks, they can be customized for a wide range of data
processing needs.
- ๐ง **Autonomous learning**: Adala agents aren't just automated;
they're intelligent. They iteratively and independently develop
skills based on environment, observations, and reflections.- โ **Flexible and extensible runtime**: Adala's runtime environment is
adaptable. A single skill can be deployed across multiple runtimes,
facilitating dynamic scenarios like the student/teacher
architecture. Moreover, the openness of framework invites the
community to extend and tailor runtimes, ensuring continuous
evolution and adaptability to diverse needs.
- ๐ **Easily customizable**: Quickly customize and develop agents to address
challenges specific to your needs, without facing a steep learning curve.## ๐ซต Who is Adala for?
Adala is a versatile framework designed for individuals and professionals in the field of AI and machine learning. Here's who can benefit:
- ๐งก **AI engineers:** Architect and design AI agent systems with modular, interconnected skills. Build production-level agent systems, abstracting low-level ML to Adala and LLMs.
- ๐ป **Machine learning researchers:** Experiment with complex problem decomposition and causal reasoning.
- ๐ **Data scientists:** Apply agents to preprocess and postprocess your data. Interact with Adala natively through Python notebooks when working with large Dataframes.
- ๐ซ **Educators and students:** Use Adala as a teaching tool or as a base for advanced projects and research.While the roles highlighted above are central, it's pivotal to note that Adala is intricately designed to streamline and elevate the AI development journey,
catering to all enthusiasts, irrespective of their specific niche in the field. ๐ฅฐ## ๐Installation
Install Adala:
```sh
pip install adala
```Adala frequently releases updates. In order to ensure that you are using the most up-to-date version, it is recommended that you install it from GitHub:
```sh
pip install git+https://github.com/HumanSignal/Adala.git
```Developer installation:
```sh
git clone https://github.com/HumanSignal/Adala.git
cd Adala/
poetry install
```## ๐ Prerequisites
Set OPENAI_API_KEY ([see instructions here](https://platform.openai.com/docs/quickstart/step-2-setup-your-api-key))
```
export OPENAI_API_KEY='your-openai-api-key'
```## ๐ฌ Quickstart
In this example we will use Adala as a standalone library directly inside Python notebook.
Click [here](./examples/quickstart.ipynb) to see an extended quickstart example.
```python
import pandas as pdfrom adala.agents import Agent
from adala.environments import StaticEnvironment
from adala.skills import ClassificationSkill
from adala.runtimes import OpenAIChatRuntime
from rich import print# Train dataset
train_df = pd.DataFrame([
["It was the negative first impressions, and then it started working.", "Positive"],
["Not loud enough and doesn't turn on like it should.", "Negative"],
["I don't know what to say.", "Neutral"],
["Manager was rude, but the most important that mic shows very flat frequency response.", "Positive"],
["The phone doesn't seem to accept anything except CBR mp3s.", "Negative"],
["I tried it before, I bought this device for my son.", "Neutral"],
], columns=["text", "sentiment"])# Test dataset
test_df = pd.DataFrame([
"All three broke within two months of use.",
"The device worked for a long time, can't say anything bad.",
"Just a random line of text."
], columns=["text"])agent = Agent(
# connect to a dataset
environment=StaticEnvironment(df=train_df),# define a skill
skills=ClassificationSkill(
name='sentiment',
instructions="Label text as positive, negative or neutral.",
labels={'sentiment': ["Positive", "Negative", "Neutral"]},
input_template="Text: {text}",
output_template="Sentiment: {sentiment}"
),# define all the different runtimes your skills may use
runtimes = {
# You can specify your OPENAI API KEY here via `OpenAIRuntime(..., api_key='your-api-key')`
'openai': OpenAIChatRuntime(model='gpt-3.5-turbo'),
},
default_runtime='openai',
# NOTE! If you have access to GPT-4, you can uncomment the lines bellow for better results
# default_teacher_runtime='openai-gpt4',
# teacher_runtimes = {
# 'openai-gpt4': OpenAIRuntime(model='gpt-4')
# }
)print(agent)
print(agent.skills)agent.learn(learning_iterations=3, accuracy_threshold=0.95)
print('\n=> Run tests ...')
predictions = agent.run(test_df)
print('\n => Test results:')
print(predictions)
```### ๐ Examples
| Skill | Description | Colab |
|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ClassificationSkill](./examples/classification_skill.ipynb) | Classify text into a set of predefined labels. | |
| [ClassificationSkillWithCoT](./examples/classification_skill_with_CoT.ipynb) | Classify text into a set of predefined labels, using Chain-of-Thoughts reasoning. | |
| [SummarizationSkill](./examples/summarization_skill.ipynb) | Summarize text into a shorter text. | |
| [QuestionAnsweringSkill](./examples/question_answering_skill.ipynb) | Answer questions based on a given context. | |
| [TranslationSkill](./examples/translation_skill.ipynb) | Translate text from one language to another. | |
| [TextGenerationSkill](./examples/text_generation_skill.ipynb) | Generate text based on a given prompt. | |
| [Skill sets](./examples/skillsets_sequence_of_skills.ipynb) | Process complex tasks through a sequence of skills. | |
| [OntologyCreator](./examples/ontology_creator.ipynb) | Infer ontology from a set of text examples. | |
| [Math reasoning](./examples/gsm8k_test.ipynb) | Solve grade-school math problems on GSM8k dataset. | |![Executing Agent Skill](./docs/src/img/executing-agents-skill.png "Executing Agent Skill")
## ๐บ Roadmap
- [x] Low-level skill management (i.e. agent.get_skill("name")) [COMPLETE @niklub]
- [ ] Make every notebook example to run in Google Collab and add a badge into README
- [ ] Extend environment with one more example
- [ ] Multi-task learning (learn multiple skills at once)
- [ ] Calculate and store top line Agent metrics (predictions created, runtime executions, learning loops, etc)
- [ ] Create Named Entity Recognition Skill
- [ ] Command line utility (see the source for this readme for example)
- [ ] REST API to interact with Adala
- [ ] Vision and multi-modal agent skills## ๐คฉ Contributing to Adala
Enhance skills, optimize runtimes, or pioneer new agent types. Whether you're
crafting nuanced tasks, refining computational environments, or sculpting specialized agents for unique domains, your
contributions will power Adala's evolution. Join us in shaping the future of intelligent systems and making Adala more
versatile and impactful for users across the globe.[Read more](./CONTRIBUTION.md) here.
## ๐ฌ Support
Do you need help or are you looking to engage with community? Check out [Discord channel](https://discord.gg/QBtgTbXTgU)!
Whether you have questions, need clarification, or simply want to discuss topics related to the project, the Discord community is welcoming!