ASK KNOX
beta
LESSON 329

Level 1-2: From Chat to Its Own Computer

Giving your agent its own dedicated machine is not a nice-to-have — it is the isolation layer that makes everything above it safe to build.

7 min read·The Seven Levels of Agent Orchestration

Introduction

The first upgrade you make to a persistent agent is also the most important one: you give it its own computer.

This sounds simple. It is simple. But it changes everything about how you reason about agent failures, resource usage, and uptime.

At level 1, you have a chat session — maybe a fancy one with a system prompt and tool calls. It runs in your browser or your terminal. When you close your laptop, it stops. When it crashes, it takes your session with it. When it consumes all available memory hunting through a large codebase, your dev environment slows to a crawl.

At level 2, you have a machine — a VPS, a spare computer, an Intel NUC, a Raspberry Pi — that runs your agent and nothing else. The agent can crash without affecting you. It can run all night without your laptop staying open. It can be configured with exactly the tools it needs and nothing more.

That is what isolation buys you: safety, uptime, and control.

Core Concept

The Dedicated Machine Philosophy

Agent Framework is explicit about this: "each agent runs on its own computer." That is not a technical constraint — it is a design principle.

When an agent has its own machine, you can:

  • Install exactly the dependencies it needs, versioned precisely, without polluting your dev environment
  • Set resource limits so a runaway process cannot consume all available RAM
  • Keep it online 24/7 without depending on your laptop's uptime or battery
  • SSH in from anywhere to inspect logs, restart services, or push updates
  • Run multiple agents on separate machines without them interfering with each other

This is the same reasoning behind containerization (Docker) and virtual machines — separation of concerns applied to operational reliability. The difference is that with a persistent agent, the stakes are higher: you are running autonomous software that takes actions in the world.

VPS vs. Physical Hardware

Both work. The choice depends on your use case and budget.

A cloud VPS (DigitalOcean, Hetzner, Linode) costs $6-30/month for a basic instance. It is cheap, globally accessible, and disposable — you can snapshot it, clone it, or destroy it without physical consequences. It is the right choice if your agent needs to be near a specific cloud region, or if you do not want to manage physical hardware.

Physical dedicated hardware — an Intel NUC, a Raspberry Pi 5, or any repurposed desktop — has higher upfront cost but zero ongoing compute cost. It often has better single-threaded performance for the price. It is the right choice if your agent runs CPU-intensive workloads, if you are already comfortable managing local hardware, or if you want the agent on your home network.

Agent Gateway runs on dedicated physical hardware at a fixed IP on a home network. That machine runs 24/7, handles 40+ scheduled cron jobs, and is accessible from anywhere via SSH. Total ongoing cost: electricity. The hardware was already owned.

Setting Up the Machine

Regardless of hardware, the setup checklist is the same:

# 1. Install your runtime (Python, Node, etc.) via a version manager
curl https://pyenv.run | bash   # pyenv for Python
# or
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash  # nvm for Node

# 2. Install launchd/systemd service management
# macOS: use launchd plists in ~/Library/LaunchAgents/
# Linux: use systemd units in ~/.config/systemd/user/

# 3. Configure SSH access
# Add your public key to ~/.ssh/authorized_keys
# Test: ssh user@machine-ip 'echo connected'

# 4. Set up a process supervisor
# macOS launchd handles KeepAlive automatically — the agent restarts on crash
# Linux: use systemd or supervisord

The critical piece is the . Without it, if your agent crashes at 2am, it stays crashed until you notice. With a supervisor (launchd on macOS, systemd on Linux), it restarts automatically. This is non-negotiable for a production persistent agent.

Practical Application

Here is what the actual service definition looks like on macOS using launchd. This is the pattern Agent Gateway uses in production:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.yourname.agent</string>

  <key>ProgramArguments</key>
  <array>
    <string>/opt/homebrew/bin/python3</string>
    <string>/Users/yourname/agent/main.py</string>
  </array>

  <key>RunAtLoad</key>
  <true/>

  <key>KeepAlive</key>
  <true/>

  <key>StandardOutPath</key>
  <string>/Users/yourname/agent/logs/agent.log</string>

  <key>StandardErrorPath</key>
  <string>/Users/yourname/agent/logs/agent-error.log</string>

  <key>EnvironmentVariables</key>
  <dict>
    <key>PATH</key>
    <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin</string>
  </dict>
</dict>
</plist>

RunAtLoad: true starts the agent when the machine boots. KeepAlive: true restarts it if it crashes. The PATH in EnvironmentVariables is essential — launchd does not inherit your shell's PATH, so tools like python3 or docker will not be found without it.

Load the service:

launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.yourname.agent.plist

Common Mistakes

Running the agent on your dev machine. You will hit resource conflicts, and when your laptop sleeps or reboots, the agent dies. This defeats the purpose.

Forgetting the PATH in your launchd/systemd service. This is one of the most common failure modes. Non-interactive service sessions do not inherit your shell environment. Every tool your agent calls must be reachable via an explicitly set PATH.

Not logging stdout and stderr. When something breaks at 3am, logs are your only forensic tool. Set StandardOutPath and StandardErrorPath from day one.

Using an underpowered machine. If your agent is running complex LLM calls, spawning sub-agents, and managing file I/O simultaneously, a 512MB RAM VPS will not cut it. Size for your peak load, not your average load.

No monitoring. A supervisor restarts crashed agents. But what about agents that are running but stuck in an infinite loop, or consuming 100% CPU? You need a watchdog process — a separate lightweight monitor that checks the agent's health and can kill and restart it if health checks fail.

Summary

  • Level 2 is giving your agent a dedicated, isolated machine — the safety and uptime foundation for everything above
  • VPS or physical hardware both qualify; the requirement is isolation and 24/7 availability
  • A process supervisor (launchd or systemd) is non-negotiable — it restarts crashed agents automatically
  • Always set an explicit PATH in your service definition — launchd/systemd do not inherit shell environments
  • Log everything from day one — logs are your only diagnostic tool when things fail overnight
  • Size your machine for peak load, not average load

What's Next

With a dedicated machine running 24/7, the next question is: how do you talk to your agent from anywhere? The next lesson covers the messaging layer — connecting your agent to Discord, Telegram, or Slack so you can interact with it from any device, and building the skill library that gives it reusable capabilities.