Write an agent#

Define, test and release a native agent that runs on the reference orchestration. To run agents on other orchestration, see Custom orchestration.

Native agents#

A native agent is one agent.yaml (config_format: nemo-agents-spec-v1) that runs on the DeepAgents harness in NeMo Platform. The definition names the agent’s instructions, the skills it may load and the tools it may call. It holds no project, collection, endpoint, model-provider or credential binding: the agent service injects those when a deployment is created, and an invocation cannot widen them. Agent orchestration shows the whole path.

The checked-in agents are examples:

Folder

Agents

reference/orchestration/templates/agents/

report-generator, retrieval-assistant

reference/orchestration/maritime/agents/

Vessel observers, vessel-fusion-analyst, regional and collection observers

reference/orchestration/templates/examples/

Optional examples outside the release catalog

Any folder with a valid agent.yaml works with the commands below.

Prerequisites#

Native packaging and invocation require the locked NeMo Platform image, client wheel, and skills snapshot. The public checkout carries the agent source and examples. Obtain the locked inputs separately to run this path, or use the Custom orchestration guide with your own agent.

  • The reference orchestration lives in reference/orchestration/nemo/, a separate Python environment, not a workspace member. Install it from that folder.

  • Packaging and release need Docker, the locked NeMo Platform toolchain image, and a registry you can push to. The toolchain image and the reviewed client wheel come from the GeoNeMo image registry, which requires access.

  • A checkout of the skills at the revision in skills.commit.

Steps#

  1. Create a definition and edit its fields:

    geonemo-agent new agents/my-agent --name my-agent
    

    From a checkout, ./scripts/geonemo-dev agent-new <dir> runs the same command with this repository’s defaults.

  2. Choose the agent’s tools and skills in agent.yaml:

    Field

    Rule

    skills.paths

    One entry per skill: ./workspace/skills/<skill-name>

    mcp.servers.geonemo.allowed_tools

    Names of existing tools only. See Agent bridge tools

    tools.blocked

    Keep the shell, file-write and task tools blocked

    models.default

    A model alias; the deployment binds the real model

    Keep each agent to one role: no subagents and no task tool. If it needs a procedure that does not exist, write the skill first (Write a skill). If it needs a capability that is not a tool, add the tool (Add an MCP tool family).

  3. Check the definition:

    geonemo-agent validate agents/my-agent
    geonemo-agent inspect agents/my-agent
    

    validate loads the definition with the NeMo Platform loader. inspect prints the derived assignments as JSON.

  4. Try it locally without publishing anything. From a checkout, ./scripts/geonemo-dev materialize <dir> builds an ephemeral bundle with local scope bindings, and ./scripts/geonemo-dev invoke-local <dir> "<prompt>" runs it in the toolchain container with a scoped model key. See Direct local invocation.

  5. Export, package and release:

    geonemo-agent export agents/my-agent --output my-agent.tar.gz
    geonemo-agent package agents/my-agent \
      --pyproject ./pyproject.toml \
      --skills-root <skills-checkout> \
      --registry registry.example.com/geonemo \
      --platform-image <toolchain-image>@sha256:<digest>
    

    export writes a deterministic archive (UTF-8 only, no links, at most 475 files). package builds and pushes an immutable image. release does the same and then imports the archive and image digest into the agent service and commits a release; add --deploy --project-id <project> --collections '["<collection>"]' --wait to also create a candidate deployment. publish imports an image that already exists.

  6. Call it through the public API, not the private runtime:

    geonemo-agent invoke my-agent "What imagery is available?" \
      --services-url https://geonemo.example.com
    

    invoke creates a durable conversation, follows its run events and prints the assistant message.

Result#

geonemo-agent release prints JSON with the archive path, the image digest and the committed release. The agent appears under /v1/agent-definitions and can be deployed and invoked through the agent service.