Easily build agents for the Encord echo system. With just few lines of code, you can take automation to the next level.
For a workflow with a prioritization agent node looking like this:
Here's how to build a Task Agent that prioritizes annotation tasks based on data titles.
from encord.objects.ontology_labels_impl import LabelRowV2
from encord_agents.tasks import Runner
runner = Runner(project_hash="<your_project_hash>")
@runner.stage("1e7751b3-6dc8-4796-a64b-d1323918b8f4")
def by_file_name(lr: LabelRowV2) -> str | 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 "to_annotation" # <- pathway name
if __name__ == "__main__":
runner.run()
💡 For the full end-to-end example, please see here.
This repository provides utility functions and examples for building both editor agents and task agents.
Key features:
- ⚡Easy: Multiple template agents to be adapted and hosted via GCP, own infra, or cloud.
- ⏩ Convenient: The library conveniently loads data via the Encord SDK upon request.
- 👨💻 Focus: With essential resources readily available, you can focus on what matters. Create agents with pre-existing (or custom) dependencies for loading labels and data.
- 🤏 Slim: the library is slim at it's
core
and should not conflict with the dependencies of most projects.
Choose what type of agent to use:
Upon installation and authentication, you should continue your reading as follows:
- If you plan to build an editor agent, please go to the Editor agents section.
- If you plan to build a task agent, please go to the Task agents section.