Skip to main content

Documentation | Try it Now | Blog

Encord Agents

Easily build agents for the Encord ecosystem. 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. 👨‍💻 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.

For help choosing between an editor agent and a task agent, see the documentation. Runnable examples — Colab notebooks, GCP, FastAPI, Modal and Celery deployments, and pre-built containerised agents — live in examples/.

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.

Metadata

Release files for encord-agents 0.2.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for encord-agents 0.2.12
File Size Uploaded Provenance Actions
encord_agents-0.2.12.tar.gz 3.2 MB Without provenance Details for encord_agents-0.2.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for encord-agents 0.2.12
File Interpreter ABI Platform Actions
encord_agents-0.2.12-py3-none-any.whl Python 3 none any Details for encord_agents-0.2.12-py3-none-any.whl

Total release size: 3.3 MB

Release files / encord_agents-0.2.12.tar.gz

Download URL encord_agents-0.2.12.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
71131d6a7a318b87fbaa7bbee40a769a65c0f6b67b22edeca02b4b68979fd05c
BLAKE2b-256 checksum
How to use checksums
f65eebe19bd2074df0f1bdaadf345597448f383ac9f4674b40c04d669fc4f5c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.12

Release files / encord_agents-0.2.12-py3-none-any.whl

Download URL encord_agents-0.2.12-py3-none-any.whl
Size 87.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba746874f5e52334f19cd3897f3d6293ca25114b2af97ae9c7abcd577b4880a6
BLAKE2b-256 checksum
How to use checksums
0480e40cff42154abddc0f0c6c2b491e03aad713547bf4cd5ea2f69cfd2825a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.12

Security for encord-agents 0.2.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page