Skip to main content

A framework for producing custom agens for the Encord echosystem.

Project description

Documentation | Try it Now | Blog | Join our Community

Encord logo

Easily build agents for the Encord echo system. With just few lines of code, you can take automation to the next level.

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 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.

💡 For the full documentation and end-to-end examples, please see here.

Here are some use-cases:

Decision tree for which agent to use

Here's how to build an Agent:

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:

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 for a complete reference to how to use the agents library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

encord_agents-0.1.3.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

encord_agents-0.1.3-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

File details

Details for the file encord_agents-0.1.3.tar.gz.

File metadata

  • Download URL: encord_agents-0.1.3.tar.gz
  • Upload date:
  • Size: 36.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.6 Linux/6.8.0-1017-azure

File hashes

Hashes for encord_agents-0.1.3.tar.gz
Algorithm Hash digest
SHA256 10f28b447d6d920063cf4aab8c2f81d8337225b684aa4eca4d46ccaff9c0fcf1
MD5 9119f6b8339d6e2f96b42f4e9bfc9d01
BLAKE2b-256 eb763dae2a0c97d029d8e791dc2f158bef2e01089119b6b595b0c3c12a384412

See more details on using hashes here.

File details

Details for the file encord_agents-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: encord_agents-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 47.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.6 Linux/6.8.0-1017-azure

File hashes

Hashes for encord_agents-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b45863d9e5f57d48a51138a25bca7d80daec64fdb11bab9c0b5fe3e82a16562a
MD5 6acfd80f1ffdebcb5340f2f85971c82a
BLAKE2b-256 fa8d9283a51bc8e811f495acf3ae2d653e5f3d96a0bde41c25f51233972469d3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page