Create a new agent.
Parameters for creating the agent.
Optionaloptions: RequestOptions<unknown>Request options.
An Agent instance.
Create an agent from an NPM package:
const runloop = new RunloopSDK();
const agent = await runloop.agent.create({
name: 'my-agent',
source: {
type: 'npm',
npm: {
package_name: '@my-org/agent',
npm_version: '1.0.0'
}
}
});
console.log(`Created agent: ${agent.id}`);
Create an agent from a Git repository:
const runloop = new RunloopSDK();
const agent = await runloop.agent.create({
name: 'my-git-agent',
source: {
type: 'git',
git: {
repository: 'https://github.com/my-org/agent-repo',
ref: 'main'
}
}
});
Create an agent from a storage object:
const runloop = new RunloopSDK();
// First, upload your agent code as a storage object
const storageObject = await runloop.storageObject.uploadFromDir(
'./my-agent',
{ name: 'agent-package' }
);
// Then create an agent from it
const agent = await runloop.agent.create({
name: 'my-object-agent',
source: {
type: 'object',
object: {
object_id: storageObject.id
}
}
});
Create an agent from an NPM package.
Parameters for creating the agent.
NPM package name.
NPM version constraint.
NPM registry URL.
Setup commands to run after installation.
NPM package name.
Optionalnpm_version?: stringNPM version constraint.
Optionalregistry_url?: stringNPM registry URL.
Optionalagent_setup?: string[]Setup commands to run after installation.
Optionaloptions: RequestOptions<unknown>Request options.
An Agent instance.
Basic usage:
const runloop = new RunloopSDK();
const agent = await runloop.agent.createFromNpm({
name: 'my-npm-agent',
package_name: '@my-org/agent'
});
Create an agent from a Pip package.
Parameters for creating the agent.
Pip package name.
Pip version constraint.
Pip registry URL.
Setup commands to run after installation.
Pip package name.
Optionalpip_version?: stringPip version constraint.
Optionalregistry_url?: stringPip registry URL.
Optionalagent_setup?: string[]Setup commands to run after installation.
Optionaloptions: RequestOptions<unknown>Request options.
An Agent instance.
Basic usage:
const runloop = new RunloopSDK();
const agent = await runloop.agent.createFromPip({
name: 'my-python-agent',
package_name: 'my-agent-package'
});
Create an agent from a Git repository.
Parameters for creating the agent.
Git repository URL.
Optional Git ref (branch/tag/commit), defaults to main/HEAD.
Setup commands to run after cloning.
Git repository URL.
Optionalref?: stringOptional Git ref (branch/tag/commit), defaults to main/HEAD.
Optionalagent_setup?: string[]Setup commands to run after cloning.
Optionaloptions: RequestOptions<unknown>Request options.
An Agent instance.
Basic usage with public repository:
const runloop = new RunloopSDK();
const agent = await runloop.agent.createFromGit({
name: 'my-git-agent',
repository: 'https://github.com/my-org/agent-repo'
});
Create an agent from a storage object.
Parameters for creating the agent.
Storage object ID.
Setup commands to run after unpacking.
Storage object ID.
Optionalagent_setup?: string[]Setup commands to run after unpacking.
Optionaloptions: RequestOptions<unknown>Request options.
An Agent instance.
Upload agent code and create agent:
const runloop = new RunloopSDK();
// Upload agent directory as a storage object
const storageObject = await runloop.storageObject.uploadFromDir(
'./my-agent-code',
{ name: 'agent-package' }
);
// Create agent from the storage object
const agent = await runloop.agent.createFromObject({
name: 'my-object-agent',
object_id: storageObject.id
});
With setup commands:
const runloop = new RunloopSDK();
const storageObject = await runloop.storageObject.uploadFromDir(
'./my-agent-code',
{ name: 'agent-package' }
);
const agent = await runloop.agent.createFromObject({
name: 'my-object-agent',
object_id: storageObject.id,
agent_setup: [
'chmod +x setup.sh',
'./setup.sh',
'pip install -r requirements.txt'
]
});
Complete workflow: storage object → agent → devbox:
const runloop = new RunloopSDK();
// 1. Upload agent code
const storageObject = await runloop.storageObject.uploadFromDir(
'./my-agent',
{ name: 'agent-v1' }
);
// 2. Create agent from storage object
const agent = await runloop.agent.createFromObject({
name: 'my-agent',
object_id: storageObject.id
});
// 3. Create devbox with agent mounted
const devbox = await runloop.devbox.create({
name: 'devbox-with-agent',
mounts: [{
type: 'agent_mount',
agent_id: agent.id,
agent_name: null,
agent_path: '/home/user/agent'
}]
});
Get an agent object by its ID.
The ID of the agent.
An Agent instance.
List agents with optional filters (paginated).
Optionalparams: AgentListParamsOptional filter parameters.
Optionaloptions: RequestOptions<unknown>Request options.
An array of Agent instances.
Agent SDK interface for managing agents.
Remarks
Overview
The
AgentOpsclass provides a high-level abstraction for managing AI agent entities. Agents can be sourced from npm, pip, git repositories, or object storage, and mounted into devboxes for execution.Usage
This interface is accessed via RunloopSDK.agent. You should construct a RunloopSDK instance and use it from there:
Example