Encord logo

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:

  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 upon request.
  3. 👨‍💻 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.
  4. 🤏 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:

Decision tree for which agent to use

Upon installation and authentication, you should continue your reading as follows: