{"id":13472685,"url":"https://github.com/HumanSignal/Adala","last_synced_at":"2025-03-26T17:31:03.252Z","repository":{"id":203500455,"uuid":"685048844","full_name":"HumanSignal/Adala","owner":"HumanSignal","description":"Adala: Autonomous DAta (Labeling) Agent framework","archived":false,"fork":false,"pushed_at":"2024-10-29T21:42:39.000Z","size":6482,"stargazers_count":955,"open_issues_count":18,"forks_count":75,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-10-29T22:49:38.865Z","etag":null,"topics":["agent","agent-based-framework","agent-oriented-programming","autonomous-agents","gpt-4"],"latest_commit_sha":null,"homepage":"https://humansignal.github.io/Adala/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HumanSignal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-30T12:06:57.000Z","updated_at":"2024-10-29T21:41:53.000Z","dependencies_parsed_at":"2023-11-27T14:42:55.365Z","dependency_job_id":"360177cb-2faf-4322-b845-0d73b9e1272e","html_url":"https://github.com/HumanSignal/Adala","commit_stats":null,"previous_names":["humansignal/adala"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HumanSignal%2FAdala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HumanSignal%2FAdala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HumanSignal%2FAdala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HumanSignal%2FAdala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HumanSignal","download_url":"https://codeload.github.com/HumanSignal/Adala/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245702193,"owners_count":20658560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","agent-based-framework","agent-oriented-programming","autonomous-agents","gpt-4"],"created_at":"2024-07-31T16:00:57.050Z","updated_at":"2025-03-26T17:31:02.820Z","avatar_url":"https://github.com/HumanSignal.png","language":"Python","readme":"[![PyPI version](https://badge.fury.io/py/adala.svg)](https://badge.fury.io/py/adala)\n![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)\n![GitHub](https://img.shields.io/github/license/HumanSignal/Adala)\n![GitHub Repo stars](https://img.shields.io/github/stars/HumanSignal/Adala)\n[![](https://img.shields.io/discord/1166330284300570624?label=Discord\u0026logo=discord)](https://discord.gg/QBtgTbXTgU)\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"/docs/src/img/logo-dark-mode.png\" width=\"275\" \u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"/docs/src/img/logo.png\" width=\"275\" \u003e\n  \u003cimg alt=\"Shows Adala logo in light mode and dark mode.\" src=\"/docs/src/img/logo.png\" width=\"275\" \u003e\n\u003c/picture\u003e\n\nAdala is an **A**utonomous **DA**ta (**L**abeling) **A**gent framework.\n\nAdala offers a robust framework for implementing agents specialized in data processing, with an emphasis on\ndiverse data labeling tasks. These agents are autonomous, meaning they can independently acquire one or more skills\nthrough iterative learning. This learning process is influenced by their operating environment, observations, and\nreflections. Users define the environment by providing a ground truth dataset. Every agent learns and applies its skills\nin what we refer to as a \"runtime\", synonymous with LLM.\n\n![Training Agent Skill](./docs/src/img/training-agents-skill.png \"Training Agent Skill\")\n\n\u003c!-- Offered as an HTTP server, users can interact with Adala via command line or RESTful API, and directly integrate its features in Python Notebooks or scripts. The self-learning mechanism leverages Large Language Models (LLMs) from providers like OpenAI and VertexAI. --\u003e\n\n## 📢 Why choose Adala?\n\n- 🌟 **Reliable agents**: Agents are built upon a foundation of ground\n  truth data. This ensures consistent and trustworthy results, making Adala a\n  reliable choice for your data processing needs.\n  \n- 🎮 **Controllable output**: For every skill, you can configure the\n  desired output and set specific constraints with varying degrees of\n  flexibility. Whether you want strict adherence to particular\n  guidelines or more adaptive outputs based on the agent's learning,\n  Adala allows you to tailor results to your exact needs.\n\n- 🎯 **Specialized in data processing**: While agents excel in diverse\n  data labeling tasks, they can be customized for a wide range of data\n  processing needs.\n  \n- 🧠 **Autonomous learning**: Adala agents aren't just automated;\n  they're intelligent. They iteratively and independently develop\n  skills based on environment, observations, and reflections.\n\n- ✅ **Flexible and extensible runtime**: Adala's runtime environment is\n  adaptable. A single skill can be deployed across multiple runtimes,\n  facilitating dynamic scenarios like the student/teacher\n  architecture. Moreover, the openness of framework invites the\n  community to extend and tailor runtimes, ensuring continuous\n  evolution and adaptability to diverse needs.\n  \n- 🚀 **Easily customizable**: Quickly customize and develop agents to address\n  challenges specific to your needs, without facing a steep learning curve.\n\n## 🫵 Who is Adala for?\n\nAdala is a versatile framework designed for individuals and professionals in the field of AI and machine learning. Here's who can benefit:\n\n- 🧡 **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.\n- 💻 **Machine learning researchers:** Experiment with complex problem decomposition and causal reasoning.\n- 📈 **Data scientists:** Apply agents to preprocess and postprocess your data. Interact with Adala natively through Python notebooks when working with large Dataframes.\n- 🏫 **Educators and students:** Use Adala as a teaching tool or as a base for advanced projects and research.\n\nWhile the roles highlighted above are central, it's pivotal to note that Adala is intricately designed to streamline and elevate the AI development journey, \ncatering to all enthusiasts, irrespective of their specific niche in the field. 🥰\n\n## 🔌Installation\n\nInstall Adala:\n\n```sh\npip install adala\n```\n\nAdala 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:\n```sh\npip install git+https://github.com/HumanSignal/Adala.git\n```\n\nDeveloper installation:\n```sh\ngit clone https://github.com/HumanSignal/Adala.git\ncd Adala/\npoetry install\n```\n\n\u003c!--\nIf you're planning to use human-in-the-loop labeling, or need a labeling tool to produce ground truth datasets, we\nsuggest installing Label Studio. Adala supports Label Studio format out of the box.\n\n```sh\npip install label-studio\n```\n--\u003e\n\n## 📝 Prerequisites\n\nSet OPENAI_API_KEY ([see instructions here](https://platform.openai.com/docs/quickstart/step-2-setup-your-api-key))\n\n```\nexport OPENAI_API_KEY='your-openai-api-key'\n```\n\n## 🎬 Quickstart\n\nIn this example we will use Adala as a standalone library directly inside Python notebook.\n\nClick [here](./examples/quickstart.ipynb) to see an extended quickstart example. \n\n```python\nimport pandas as pd\n\nfrom adala.agents import Agent\nfrom adala.environments import StaticEnvironment\nfrom adala.skills import ClassificationSkill\nfrom adala.runtimes import OpenAIChatRuntime\nfrom rich import print\n\n# Train dataset\ntrain_df = pd.DataFrame([\n    [\"It was the negative first impressions, and then it started working.\", \"Positive\"],\n    [\"Not loud enough and doesn't turn on like it should.\", \"Negative\"],\n    [\"I don't know what to say.\", \"Neutral\"],\n    [\"Manager was rude, but the most important that mic shows very flat frequency response.\", \"Positive\"],\n    [\"The phone doesn't seem to accept anything except CBR mp3s.\", \"Negative\"],\n    [\"I tried it before, I bought this device for my son.\", \"Neutral\"],\n], columns=[\"text\", \"sentiment\"])\n\n# Test dataset\ntest_df = pd.DataFrame([\n    \"All three broke within two months of use.\",\n    \"The device worked for a long time, can't say anything bad.\",\n    \"Just a random line of text.\"\n], columns=[\"text\"])\n\nagent = Agent(\n    # connect to a dataset\n    environment=StaticEnvironment(df=train_df),\n\n    # define a skill\n    skills=ClassificationSkill(\n        name='sentiment',\n        instructions=\"Label text as positive, negative or neutral.\",\n        labels={'sentiment': [\"Positive\", \"Negative\", \"Neutral\"]},\n        input_template=\"Text: {text}\",\n        output_template=\"Sentiment: {sentiment}\"\n    ),\n\n    # define all the different runtimes your skills may use\n    runtimes = {\n        # You can specify your OPENAI API KEY here via `OpenAIRuntime(..., api_key='your-api-key')`\n        'openai': OpenAIChatRuntime(model='gpt-3.5-turbo'),\n    },\n    default_runtime='openai',\n    \n    # NOTE! If you have access to GPT-4, you can uncomment the lines bellow for better results\n#     default_teacher_runtime='openai-gpt4',\n#     teacher_runtimes = {\n#       'openai-gpt4': OpenAIRuntime(model='gpt-4')\n#     }\n)\n\nprint(agent)\nprint(agent.skills)\n\nagent.learn(learning_iterations=3, accuracy_threshold=0.95)\n\nprint('\\n=\u003e Run tests ...')\npredictions = agent.run(test_df)\nprint('\\n =\u003e Test results:')\nprint(predictions)\n```\n\n### 👉 Examples\n| Skill                                                                              | Description                                                                       | Colab                                                                                                                                                                                                                                        |\n|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ClassificationSkill](./examples/classification_skill.ipynb)                 | Classify text into a set of predefined labels.                                    | \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/HumanSignal/Adala/blob/master/examples/classification_skill.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e          |\n| [ClassificationSkillWithCoT](./examples/classification_skill_with_CoT.ipynb) | Classify text into a set of predefined labels, using Chain-of-Thoughts reasoning. | \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/HumanSignal/Adala/blob/master/examples/classification_skill_with_CoT.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e |\n| [SummarizationSkill](./examples/summarization_skill.ipynb)                   | Summarize text into a shorter text.                                               | \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/HumanSignal/Adala/blob/master/examples/summarization_skill.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e           |\n| [QuestionAnsweringSkill](./examples/question_answering_skill.ipynb)          | Answer questions based on a given context.                                        | \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/HumanSignal/Adala/blob/master/examples/question_answering_skill.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e      |\n| [TranslationSkill](./examples/translation_skill.ipynb)                       | Translate text from one language to another.                                      | \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/HumanSignal/Adala/blob/master/examples/translation_skill.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e             |\n| [TextGenerationSkill](./examples/text_generation_skill.ipynb)                | Generate text based on a given prompt.                                            | \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/HumanSignal/Adala/blob/master/examples/text_generation_skill.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e         |\n| [Skill sets](./examples/skillsets_sequence_of_skills.ipynb)                  | Process complex tasks through a sequence of skills.                               | \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/HumanSignal/Adala/blob/master/examples/skillsets_sequence_of_skills.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e  |\n| [OntologyCreator](./examples/ontology_creator.ipynb)                         | Infer ontology from a set of text examples.                                       | \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/HumanSignal/Adala/blob/master/examples/ontology_creator.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e              |\n| [Math reasoning](./examples/gsm8k_test.ipynb)                                 | Solve grade-school math problems on GSM8k dataset.                                | \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/HumanSignal/Adala/blob/master/examples/gsm8k_test.ipynb\"\u003e \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e                    |\n\n![Executing Agent Skill](./docs/src/img/executing-agents-skill.png \"Executing Agent Skill\")\n\n\u003c!-- \n## 📒 More notebooks\n\n- [Quickstart](./adala/examples/quickstart.ipynb) – An extended example of the above with comments and outputs.\n- [Creating New Skill (coming soon!)](./adala/examples/creating_new_skill.ipynb) – An example that walks you through creating a new skill.\n- [Label Studio Tutorial (coming soon!)](examples/tutorial_label_studio.ipynb) – An example of connecting Adala to an external labeling tool for enhanced supervision.\n--\u003e\n\u003c!-- \n## Running ADALA as a standalone server (Coming soon!)\n\nInitiate the Adala server. Note: Each agent operates as its own web server.\n\n### Starting the Adala Server\n\n```sh\n# Start the Adala server on default port 8090\nadala start\n```\n\n### Uploading Ground Truth Data\n\nBefore teaching skills to Adala, you need to set up the environment and upload data.\n\n```sh\n# Upload your dataset\nadala upload --file sample_dataset_ground_truth.json\n```\n\n### Teaching Skills to Adala\n\nNow, define and teach a new skill to Adala.\n\n```sh\n# Define a new skill for classifying objects\nadala add-skill --name \"Object Classification\" --description \"Classify text into categories.\" --instruction \"Example: Label trees, cars, and buildings.\"\n```\n\n```sh\n# Start the learning process\nadala learn --skill \"Object Classification\" --continuous\n```\n\n### Monitoring Optimization\n\nTrack the progress of the optimization process.\n\n```sh\n# Check the optimization status\nadala status\n```\n\n### Applying Skills and Predictions\n\nYou don't need to wait for optimization to finish. Instruct Adala to apply its skills on new data outside the\nenvironment, turning Adala into a prediction engine. If the predictions generated by the skill are then verified by\nhuman validators or another supervision system, this provides more ground truth data, enhancing the agent's skills. Use\nthe learned skills and generate predictions.\n\n```sh\n# Apply the 'Object Classification' skill on new data\nadala apply-skill --name \"Object Classification\" --file sample_dataset_predict.json\n```\n\n### Review Metrics\n\nGet insights into Adala's performance.\n\n```sh\n# View detailed metrics\nadala metrics\n```\n\n## Executing ADALA Command Line\n\n```sh\n# Start the Adala server on default port 8090\nadala start --port 8090\n\n# Upload your dataset\nadala upload --file sample_dataset_ground_truth.json\n\n# Define a new skill for classifying objects\nadala add-skill --name \"Object Classification\" --description \"Classify images into categories.\" --instruction \"Example: Label trees, cars, and buildings.\"\n\n# Start the learning process\nadala learn --skill \"Object Classification\"\n\n# Check the optimization status\nadala status\n\n# Apply the 'Object Classification' skill on new data\nadala apply-skill --name \"Object Classification\" --file sample_dataset_predict.json\n\n# View detailed metrics\nadala metrics\n\n# Restart the Adala server\nadala restart\n\n# Shut down the Adala server\nadala shutdown\n\n# List all the skills\nadala list-skills\n\n# List all the runtimes\nadala list-runtimes\n\n# Retrieve raw logs\nadala logs\n\n# Provide help\nadala help \u003ccommand\u003e\n```\n--\u003e\n\n## 🗺 Roadmap\n\n- [x] Low-level skill management (i.e. agent.get_skill(\"name\")) [COMPLETE @niklub]\n- [ ] Make every notebook example to run in Google Collab and add a badge into README\n- [ ] Extend environment with one more example\n- [ ] Multi-task learning (learn multiple skills at once)\n- [ ] Calculate and store top line Agent metrics (predictions created, runtime executions, learning loops, etc)\n- [ ] Create Named Entity Recognition Skill\n- [ ] Command line utility (see the source for this readme for example)\n- [ ] REST API to interact with Adala\n- [ ] Vision and multi-modal agent skills\n\n## 🤩 Contributing to Adala\n\nEnhance skills, optimize runtimes, or pioneer new agent types. Whether you're\ncrafting nuanced tasks, refining computational environments, or sculpting specialized agents for unique domains, your\ncontributions will power Adala's evolution. Join us in shaping the future of intelligent systems and making Adala more\nversatile and impactful for users across the globe.\n\n[Read more](./CONTRIBUTION.md) here.\n\n## 💬 Support\n\nDo you need help or are you looking to engage with community? Check out [Discord channel](https://discord.gg/QBtgTbXTgU)!\nWhether you have questions, need clarification, or simply want to discuss topics related to the project, the Discord community is welcoming!\n","funding_links":[],"categories":["Python","[Adala](https://github.com/HumanSignal/Adala)","Learning","1. Review","其他_机器学习与深度学习","Open-source Projects","Autonomous Agents","Agent Categories","Table of Open-Source AI Agents Projects"],"sub_categories":["Links","Repositories","1.2 Open Source Projects","\u003ca name=\"Unclassified\"\u003e\u003c/a\u003eUnclassified"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHumanSignal%2FAdala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHumanSignal%2FAdala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHumanSignal%2FAdala/lists"}