Getting Started with AgentOS: A Hands-On Tutorial
A practical tutorial showing how to install AgentOS, create your first AI agent with file system access, and run multi-agent setups.
Getting Started with AgentOS: A Hands-On Tutorial
In this tutorial, we'll walk through setting up AgentOS and creating your first AI agent with file system access. AgentOS changes the game by giving your AI agents a lightweight, secure operating system that runs as a library β no Docker, no VMs, no SaaS required.
Prerequisites
- Node.js 18+ or Bun
- Basic familiarity with JavaScript and AI agents
- 2GB RAM minimum (4GB recommended for production)
π Want to deploy AgentOS yourself?
Docker configs, system requirements, and installation guides β all on one page.
View AgentOS Tool Page βStep 1: Installation
Install AgentOS via npm:
npm install @rivet-ai/agentos
Step 2: Create Your First Agent
Here's a simple example that creates an agent with file system access:
import { AgentOS } from '@rivet-ai/agentos';
const os = new AgentOS({
storage: './agent-data',
memory: 256, // MB
network: true
});
const agent = await os.spawn({
name: 'my-first-agent',
runtime: 'wasm',
entrypoint: './agent.wasm'
});
await agent.fs.writeFile('/data/hello.txt', 'Hello from AgentOS!');
const content = await agent.fs.readFile('/data/hello.txt');
console.log(content); // Hello from AgentOS!
await os.shutdown();
Step 3: Multi-Agent Setup
One of AgentOS's superpowers is running multiple agents concurrently. Each agent gets its own isolated OS instance:
const agents = await Promise.all(
tasks.map(task => os.spawn({
name: `agent-${task.id}`,
runtime: 'wasm',
context: { task }
}))
);
const results = await Promise.all(
agents.map(agent => agent.waitForCompletion())
);
Performance Benchmarks
| Metric | AgentOS | Docker Container |
|---|---|---|
| Boot Time | ~5ms | ~500ms |
| Memory Overhead | ~10MB | ~100MB+ |
| Max Agents per Host | 1000+ | ~50 |
Conclusion
AgentOS is a paradigm shift for AI agent development. By replacing heavyweight containers with WASM-based isolates, it enables a new class of multi-agent applications that were previously impractical. Whether you're building code generation tools, autonomous research assistants, or data processing pipelines, AgentOS gives you the operating system your agents deserve.
π Deploy AgentOS on your own infrastructure today!
Docker configs, system requirements, and installation guides β all on one page.
View AgentOS Tool Page β