Creating Agents

Agents are the fundamental unit of work in Nexus OS. Each agent is an isolated process that can be started, stopped, monitored, and orchestrated.

Create from Template

The fastest way to create an agent is from a built-in template:

bash
naos create my-agent --template echo

Available Templates

TemplateDescription
echoSimple echo agent that mirrors input
httpHTTP request handler agent
cronScheduled task agent
pipelineData processing pipeline agent

Create from Source

Point to a custom WASM binary:

bash
naos create my-agent --source ./agents/custom.wasm

Agent Structure

Each agent gets a record in the embedded database with:

AGENT RECORD
├── name        unique identifier
├── source      path to WASM binary or template name
├── status      idle | running | stopped | failed
├── created_at  timestamp
└── metadata    JSON key-value pairs

Agent Lifecycle

Created → Idle → Running → Stopped
                    ↓
                  Failed → (restart by supervisor)

Listing Agents

View all registered agents:

bash
naos status

Deleting Agents

Remove an agent (must be stopped first):

bash
naos stop my-agent
naos delete my-agent