Golem create agent instance ts

From golemcloud/golem · View interactive version

Golem create agent instance ts is an AI agent skill from the GitHub repository golemcloud/golem. Creating a new TypeScript Golem agent instance with golem agent create or golem agent upsert. Use when asked to create, instantiate, or pre-create an agent without invoking a method.

How to use this skill

Skill file

Creating a Golem Agent Instance with `golem agent create`

Both golem and golem-cli can be used — all commands below work with either binary.

Usage

golem agent create <AGENT_TYPE>(<PARAMETERS>) [--keyed] [OPTIONS]
golem agent upsert <AGENT_TYPE>(<PARAMETERS>)

golem agent create creates a new agent instance without invoking any method on it. The agent is initialized with its constructor parameters and starts in an idle state, ready to receive invocations. The command prints the new agent's agent ID (a UUID that Golem issues) and fingerprint. If the agent's component has not been deployed yet and the CLI is run from an application directory, it will automatically build and deploy the component first.

golem agent upsert gets the keyed agent of the constructor parameters, and creates it when it does not exist. It takes no environment variables or configuration.

Unlike golem agent invoke, which implicitly creates the keyed agent on first call, golem agent create explicitly pre-creates the agent — useful when you need to set environment variables or configuration at creation time.

Agent Addresses

AgentTypeName(params) is the agent's key: it addresses the keyed agent of the agent type and its constructor parameters:

AgentTypeName(param1, param2, ...)

AgentTypeName[<agent-id>] and a bare <agent-id> address an agent by its agent ID. Every form can optionally be prefixed with environment or application paths:

| Format | Description |

|--------|-------------|

| AgentTypeName(params) | Keyed agent |

| AgentTypeName[<agent-id>] or <agent-id> | Agent by its ID |

| env/AgentTypeName(params) | Environment-specific |

| app/env/AgentTypeName(params) | Application and environment-specific |

| account/app/env/AgentTypeName(params) | Account, application, and environment-specific |

For agents with no constructor parameters, use empty parentheses: AgentTypeName().

Examples

Create an agent with no constructor parameters

golem agent create 'MyAgent()'

Create the keyed agent of constructor parameters

golem agent create --keyed 'ChatRoom("general")'

Get or create the keyed agent

golem agent upsert 'ChatRoom("general")'

Create an agent with environment variables

golem agent create 'MyAgent("user-123")' --env API_KEY=sk-abc123 --env LOG_LEVEL=debug

Create an agent with configuration

golem agent create 'MyAgent()' --config maxRetries=5 --config timeoutSeconds=30

Create an agent in a specific environment

golem agent create 'staging/MyAgent("user-123")'

Combine environment variables and configuration

golem agent create 'OrderProcessor("us-east")' \
  --env DATABASE_URL=postgres://... \
  --config batchSize=100 \
  --config retryPolicy.maxAttempts=3

Available Options

| Option | Description |

|--------|-------------|

| --keyed | Create the keyed agent of the constructor parameters; fails when it already exists |

| -i, --idempotency-key <KEY> | Idempotency key of the create; a create retried with the same key returns the agent of the first create |

| -e, --env <ENV=VAL> | Environment variables visible to the agent (can be repeated) |

| -c, --config <PATH=VALUE> | Configuration entries for the agent, using dot-separated paths (can be repeated). Only configuration declared by the agent can be provided. If not provided, the default from the manifest (agents.*.config) is used. |

Auto-Deploy

If the agent's component has not been deployed yet and the CLI is run from an application directory, golem agent create will automatically build and deploy the component before creating the agent.

Value Syntax

The constructor parameters use TypeScript syntax:

golem agent create 'UserManager({ region: "us-east", maxConnections: 10 })'

When to Use `golem agent create` vs `golem agent invoke`

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.