Agent Configuration

This page explains how to configure your agent, including the configuration for the build (npm/pnpm) and runtime.

NPM Configuration

We declare a section "vertesia" in your package definition (package.json) to configure the behaviors for building your agent.

  • pm is the package manager used.
  • profile is the profile used in the vertesia CLI for communicating to the Vertesia backend services
  • image is a group of configuration entries related to the building and publishing of the docker images.

Putting those entries together, you can see a snippet like this:

{
    // ...
    "vertesia": {
        "pm": "pnpm",
        "profile": "my-project",
        "image": {
            "repository": "my-repo",
            "organization": "my-org",
            "name": "my-agent",
            "version": "my-version"
        }
    }
}

Application Configuration

When starting an agent, you must import the runner from the Agent Runner SDK (@dglabs/agent-runner). Starting the application requires three parameters: the activities, the workflow bundle, and the domain. Activities are a collection of functions, each representing a single, well-defined action. A workflow bundle is a precompiled JavaScript file containing the workflow code and its dependencies. The domain is a unique name in Vertesia’s agent system representing your agent. The name should use the convention {org}/{agent}, i.e. prefixed with your organization's name.

import { run, WorkerRunOptions, resolveScriptFile } from "@dglabs/agent-runner";

const workflowBundle = await resolveScriptFile("@dglabs/github-agent/workflows-bundle", import.meta.url);
const activities = await import('./activities.js');

const options: WorkerRunOptions = {
    workflowBundle,
    activities,
    domain: "vertesia/github-agent",
};

await run(options).catch((err: any) => {
    console.error(err);
}).finally(() => {
    process.exit(0);
});

Was this page helpful?