<p align="center">
<a href="https://agents-docs.encord.com/" target="_blank">Documentation</a> |
<a href="https://colab.research.google.com/drive/1wvKAQ61JPebGnAT4nLXsfJRbx7dvtFdX?usp=sharing" target="_blank">Try it Now</a> |
<a href="https://encord.com/blog/" target="_blank">Blog</a> |
<a href="https://join.slack.com/t/encordactive/shared_invite/zt-1hc2vqur9-Fzj1EEAHoqu91sZ0CX0A7Q" target="_blank">Join our Community</a>
</p>
<h1 align="center">
<a href="https://encord.com"><img src="https://raw.githubusercontent.com/encord-team/encord-agents/main/docs/assets/landing-banner.png" alt="Encord logo"/></a>
</h1>
<div style="display: flex; justify-content: space-between;">
<div style="flex: 1; padding: 10px;">
<a href="https://agents-docs.encord.com/" target="_blank" style="text-decoration:none">
<img alt="Documentation" src="https://img.shields.io/badge/docs-Online-blue">
</a>
<a href="https://github.com/encord-team/encord-notebooks" target="_blank" style="text-decoration:none">
<img alt="Encord Notebooks" src="https://img.shields.io/badge/Encord_Notebooks-blue?logo=github&label=&labelColor=181717">
</a>
<a href="https://colab.research.google.com/drive/1wvKAQ61JPebGnAT4nLXsfJRbx7dvtFdX?usp=sharing" target="_blank" style="text-decoration:none">
<img alt="Try editor agent" src="https://raw.githubusercontent.com/encord-team/encord-agents/main/docs/assets/tag-colab-editor-agent.svg">
</a>
<a href="https://colab.research.google.com/drive/1wvKAQ61JPebGnAT4nLXsfJRbx7dvtFdX?usp=sharing" target="_blank" style="text-decoration:none">
<img alt="Try task agent" src="https://raw.githubusercontent.com/encord-team/encord-agents/main/docs/assets/tag-colab-task-agent.svg">
</a>
<a href="https://join.slack.com/t/encordactive/shared_invite/zt-1hc2vqur9-Fzj1EEAHoqu91sZ0CX0A7Q" target="_blank" style="text-decoration:none">
<img alt="Join us on Slack" src="https://img.shields.io/badge/Join_Our_Community-4A154B?label=&logo=slack&logoColor=white">
</a>
<a href="https://twitter.com/encord_team" target="_blank" style="text-decoration:none">
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/encord_team?label=%40encord_team&style=social">
</a>
</div>
<div style="flex: 1; padding: 10px;">
<img alt="Python versions" src="https://img.shields.io/pypi/pyversions/encord-agents">
<a href="https://pypi.org/project/encord-agents/" target="_blank" style="text-decoration:none">
<img alt="PyPi project" src="https://img.shields.io/pypi/v/encord-agents">
</a>
<img alt="PRs Welcome" src="https://img.shields.io/badge/PRs-Welcome-blue">
<img alt="Licence" src="https://img.shields.io/github/license/encord-team/encord-agents">
</div>
</div>
Easily build agents for the Encord ecosystem.
With just few lines of code, you can take automation to the next level.
```shell
python -m pip install encord-agents
```
**Key features:**
1. ⚡ **Easy**: Multiple template agents to be adapted and hosted via GCP, own infra, or cloud.
2. ⏩ **Convenient**: The library conveniently loads data via the [Encord SDK][encord_sdk] upon request.
3. 👨💻 **Focused**: With essential resources readily available, you can focus on what matters. Create agents with pre-existing (or custom) dependencies for loading labels and data.
4. 🤏 **Slim**: the library is slim at it's `core` and should not conflict with the dependencies of most projects.
> 💡 For the full documentation and end-to-end examples, please see [here][docs-url].
Here are some use-cases:

Here's how to build an Agent:
```python
from uuid import UUID
from encord.objects.ontology_labels_impl import LabelRowV2
from encord_agents.tasks import Runner
runner = Runner(project_hash="<your_project_hash>")
@runner.stage("<your_agent_stage_uuid>")
def by_file_name(lr: LabelRowV2) -> UUID | None:
# Assuming the data_title is of the format "%d.jpg"
# and in the range [0; 100]
priority = int(lr.data_title.split(".")[0]) / 100
lr.set_priority(priority=priority)
return "<your_pathway_uuid>"
if __name__ == "__main__":
runner.run()
```
You can also inject dependencies:
```python
from typing_extensions import Annotated
from encord.objects import LabelRowV2
from encord_agents.tasks import Runner, Depends
runner = Runner(project_hash="<your_project_hash>")
def my_custom_dependency(label_row: LabelRowV2) -> dict:
# e.g., look up additional data in own db
return db.query("whatever")
@runner.stage(stage="<my_stage_name>")
def by_custom_data(
custom_data: Annotated[dict, Depends(my_custom_dependency)]
) -> str:
# `custom_data` automatically injected here.
# ... do your thing
# then, return name of task pathway.
if __name__ == "__main__":
runner.run()
```
Please visit our [📖 Documentation][docs-url] for a complete reference to how to use the agents library.
[docs-url]: https://agents-docs.encord.com/
[encord_sdk]: https://pypi.org/project/encord/
[fastapi]: https://fastapi.tiangolo.com/
Raw data
{
"_id": null,
"home_page": "https://encord.com",
"name": "encord-agents",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "encord, agent, agents, machine, learning, data, label, model, quality, test, automation",
"author": "Cord Technologies Limited",
"author_email": "hello@encord.com",
"download_url": "https://files.pythonhosted.org/packages/7e/35/de1e0844651e9d040b3b2021cf8926861b87845edfa88992d223934d69b7/encord_agents-0.1.7.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n<a href=\"https://agents-docs.encord.com/\" target=\"_blank\">Documentation</a> |\n<a href=\"https://colab.research.google.com/drive/1wvKAQ61JPebGnAT4nLXsfJRbx7dvtFdX?usp=sharing\" target=\"_blank\">Try it Now</a> |\n<a href=\"https://encord.com/blog/\" target=\"_blank\">Blog</a> |\n<a href=\"https://join.slack.com/t/encordactive/shared_invite/zt-1hc2vqur9-Fzj1EEAHoqu91sZ0CX0A7Q\" target=\"_blank\">Join our Community</a>\n</p>\n\n<h1 align=\"center\">\n <a href=\"https://encord.com\"><img src=\"https://raw.githubusercontent.com/encord-team/encord-agents/main/docs/assets/landing-banner.png\" alt=\"Encord logo\"/></a>\n</h1>\n\n<div style=\"display: flex; justify-content: space-between;\">\n <div style=\"flex: 1; padding: 10px;\">\n <a href=\"https://agents-docs.encord.com/\" target=\"_blank\" style=\"text-decoration:none\">\n <img alt=\"Documentation\" src=\"https://img.shields.io/badge/docs-Online-blue\">\n </a>\n <a href=\"https://github.com/encord-team/encord-notebooks\" target=\"_blank\" style=\"text-decoration:none\">\n <img alt=\"Encord Notebooks\" src=\"https://img.shields.io/badge/Encord_Notebooks-blue?logo=github&label=&labelColor=181717\">\n </a>\n <a href=\"https://colab.research.google.com/drive/1wvKAQ61JPebGnAT4nLXsfJRbx7dvtFdX?usp=sharing\" target=\"_blank\" style=\"text-decoration:none\">\n <img alt=\"Try editor agent\" src=\"https://raw.githubusercontent.com/encord-team/encord-agents/main/docs/assets/tag-colab-editor-agent.svg\">\n </a>\n <a href=\"https://colab.research.google.com/drive/1wvKAQ61JPebGnAT4nLXsfJRbx7dvtFdX?usp=sharing\" target=\"_blank\" style=\"text-decoration:none\">\n <img alt=\"Try task agent\" src=\"https://raw.githubusercontent.com/encord-team/encord-agents/main/docs/assets/tag-colab-task-agent.svg\">\n </a>\n <a href=\"https://join.slack.com/t/encordactive/shared_invite/zt-1hc2vqur9-Fzj1EEAHoqu91sZ0CX0A7Q\" target=\"_blank\" style=\"text-decoration:none\">\n <img alt=\"Join us on Slack\" src=\"https://img.shields.io/badge/Join_Our_Community-4A154B?label=&logo=slack&logoColor=white\">\n </a>\n <a href=\"https://twitter.com/encord_team\" target=\"_blank\" style=\"text-decoration:none\">\n <img alt=\"Twitter Follow\" src=\"https://img.shields.io/twitter/follow/encord_team?label=%40encord_team&style=social\">\n </a>\n </div>\n <div style=\"flex: 1; padding: 10px;\">\n <img alt=\"Python versions\" src=\"https://img.shields.io/pypi/pyversions/encord-agents\">\n <a href=\"https://pypi.org/project/encord-agents/\" target=\"_blank\" style=\"text-decoration:none\">\n <img alt=\"PyPi project\" src=\"https://img.shields.io/pypi/v/encord-agents\">\n </a>\n <img alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-Welcome-blue\">\n <img alt=\"Licence\" src=\"https://img.shields.io/github/license/encord-team/encord-agents\">\n </div>\n</div>\n\nEasily build agents for the Encord ecosystem.\nWith just few lines of code, you can take automation to the next level.\n\n```shell\npython -m pip install encord-agents\n```\n\n**Key features:**\n\n1. \u26a1 **Easy**: Multiple template agents to be adapted and hosted via GCP, own infra, or cloud.\n2. \u23e9 **Convenient**: The library conveniently loads data via the [Encord SDK][encord_sdk] upon request.\n3. \ud83d\udc68\u200d\ud83d\udcbb **Focused**: With essential resources readily available, you can focus on what matters. Create agents with pre-existing (or custom) dependencies for loading labels and data.\n4. \ud83e\udd0f **Slim**: the library is slim at it's `core` and should not conflict with the dependencies of most projects.\n\n> \ud83d\udca1 For the full documentation and end-to-end examples, please see [here][docs-url].\n\nHere are some use-cases:\n\n\n\nHere's how to build an Agent:\n\n```python\nfrom uuid import UUID\nfrom encord.objects.ontology_labels_impl import LabelRowV2\nfrom encord_agents.tasks import Runner\n\nrunner = Runner(project_hash=\"<your_project_hash>\")\n\n\n@runner.stage(\"<your_agent_stage_uuid>\")\ndef by_file_name(lr: LabelRowV2) -> UUID | None:\n # Assuming the data_title is of the format \"%d.jpg\"\n # and in the range [0; 100]\n priority = int(lr.data_title.split(\".\")[0]) / 100\n lr.set_priority(priority=priority)\n return \"<your_pathway_uuid>\"\n\n\nif __name__ == \"__main__\":\n runner.run()\n```\n\nYou can also inject dependencies:\n\n```python\nfrom typing_extensions import Annotated\n\nfrom encord.objects import LabelRowV2\nfrom encord_agents.tasks import Runner, Depends\n\nrunner = Runner(project_hash=\"<your_project_hash>\")\n\ndef my_custom_dependency(label_row: LabelRowV2) -> dict:\n # e.g., look up additional data in own db\n return db.query(\"whatever\")\n\n@runner.stage(stage=\"<my_stage_name>\")\ndef by_custom_data(\n custom_data: Annotated[dict, Depends(my_custom_dependency)]\n) -> str:\n # `custom_data` automatically injected here.\n # ... do your thing\n # then, return name of task pathway.\n\n\nif __name__ == \"__main__\":\n runner.run()\n```\n\nPlease visit our [\ud83d\udcd6 Documentation][docs-url] for a complete reference to how to use the agents library.\n\n[docs-url]: https://agents-docs.encord.com/\n[encord_sdk]: https://pypi.org/project/encord/\n[fastapi]: https://fastapi.tiangolo.com/\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "A framework for producing custom agents for the Encord ecosystem.",
"version": "0.1.7",
"project_urls": {
"Documentation": "https://agents-docs.encord.com",
"Homepage": "https://encord.com",
"Repository": "https://github.com/encord-team/encord-agents"
},
"split_keywords": [
"encord",
" agent",
" agents",
" machine",
" learning",
" data",
" label",
" model",
" quality",
" test",
" automation"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fe9cbb6d21f49ae7f01ff68a464947698284be098912dfc798811e110f45ca8d",
"md5": "3e4dd2431e30d661fae75c861bc4947b",
"sha256": "31c5dcb0bfcb0419bded46d905a0d0a4089b50b331ec72253120dcf9d7556cb3"
},
"downloads": -1,
"filename": "encord_agents-0.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3e4dd2431e30d661fae75c861bc4947b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 55972,
"upload_time": "2025-02-03T13:31:41",
"upload_time_iso_8601": "2025-02-03T13:31:41.010077Z",
"url": "https://files.pythonhosted.org/packages/fe/9c/bb6d21f49ae7f01ff68a464947698284be098912dfc798811e110f45ca8d/encord_agents-0.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7e35de1e0844651e9d040b3b2021cf8926861b87845edfa88992d223934d69b7",
"md5": "13d9603dbcd34807d1610dcd6fe0388d",
"sha256": "8794793862c50641289d5655d7da0085363ff752761c82608a930492fa845c57"
},
"downloads": -1,
"filename": "encord_agents-0.1.7.tar.gz",
"has_sig": false,
"md5_digest": "13d9603dbcd34807d1610dcd6fe0388d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 43854,
"upload_time": "2025-02-03T13:31:43",
"upload_time_iso_8601": "2025-02-03T13:31:43.040922Z",
"url": "https://files.pythonhosted.org/packages/7e/35/de1e0844651e9d040b3b2021cf8926861b87845edfa88992d223934d69b7/encord_agents-0.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-03 13:31:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "encord-team",
"github_project": "encord-agents",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "encord-agents"
}