Skip to main content
Agentbase provides agents with complete Linux computer environments featuring shell access, multiple programming runtimes, package managers, and development tools for complex workflows.

Overview

The Computer primitive represents the full Linux operating system environment that agents can access for executing code, running commands, installing packages, and performing system-level operations. Unlike simple code execution, the computer environment provides:
  • Shell Access: Full bash shell for running any command
  • Multiple Runtimes: Python, Node.js, and more pre-installed
  • Package Management: apt, pip, npm for installing dependencies
  • Development Tools: git, curl, wget, vim, and standard Unix utilities
  • Internet Access: Download packages, make API calls, clone repositories
  • Persistent State: Installed packages and files persist across requests

Full Linux OS

Debian GNU/Linux 12 (bookworm) with kernel 6.1.134 x86_64

Pre-installed Runtimes

Python 3.11.2, Node.js 18.20.4, and essential development tools

Package Managers

apt for system packages, pip for Python, npm for Node.js

Internet Enabled

Full outbound internet access for downloads and API calls

When Computer Environments Are Created

Computer environments are created automatically when agents need to perform tasks that require:

Code & Development

Python, Node.js, or other language execution, package installation, testing, and debugging

File Operations

Creating, reading, writing, or processing files, data transformation, and file system management

Web Interaction

Web scraping, browser automation, form submission, and website testing

System Operations

Shell commands, system configuration, process management, and tool installation
Automatic Creation: You don’t need to explicitly request a computer - agents create them automatically when tasks require persistent state or system access.

System Specifications

Operating System

# System details
OS: Debian GNU/Linux 12 (bookworm)
Kernel: 6.1.134 x86_64
Architecture: x86_64
Working Directory: /home/pointer

Pre-installed Software

  • Python 3.11.2: Full Python runtime with pip package manager
  • Node.js 18.20.4: JavaScript runtime with npm
  • Bash 5.2.15: Shell scripting and command execution
python --version  # Python 3.11.2
node --version    # v18.20.4
npm --version     # 9.5.0
  • git: Version control system
  • curl/wget: HTTP clients for downloading files
  • vim/nano: Text editors
  • grep/sed/awk: Text processing utilities
  • tar/gzip: Archive and compression tools
  • gcc/make: Compilation tools (available via apt)
git --version     # git version 2.39.2
curl --version    # curl 7.88.1
  • apt: Debian package manager for system packages
  • pip: Python package installer
  • npm: Node.js package manager
apt --version     # apt 2.6.1
pip --version     # pip 23.0.1
npm --version     # 9.5.0
  • Google Chrome 140.0.7339.127: Full browser for web automation
  • Headless and GUI modes supported
  • ChromeDriver included for Selenium automation
google-chrome --version  # 140.0.7339.127
  • ps/top: Process monitoring
  • df/du: Disk usage
  • netstat/ss: Network statistics
  • chmod/chown: File permissions
  • find/locate: File search
  • cat/less/more: File viewing

Resource Allocation

  • CPU: Shared allocation based on agent mode
  • Memory: 2GB for flash/base modes, 4GB for max mode
  • Disk: 10GB persistent storage per session
  • Network: Unlimited bandwidth with rate limiting
  • File Descriptors: Standard Linux limits

Code Examples

Running Shell Commands

// Simple command execution
const result = await agentbase.runAgent({
  message: "Run 'ls -la' to list all files"
});

// Command with pipes
const pipeline = await agentbase.runAgent({
  message: "List all Python files and count them"
});

// Multiple commands
const multi = await agentbase.runAgent({
  message: "Create a directory, navigate to it, and create a file"
});

Installing and Using Packages

// Install Python packages
const installPython = await agentbase.runAgent({
  message: "Install pandas, numpy, and matplotlib using pip"
});

// Install Node.js packages
const installNode = await agentbase.runAgent({
  message: "Install express and axios using npm"
});

// Install system packages
const installSystem = await agentbase.runAgent({
  message: "Install imagemagick using apt"
});

// Use installed packages (same session)
const usePackage = await agentbase.runAgent({
  message: "Use pandas to read a CSV file and create a summary",
  session: installPython.session
});

Running Scripts

// Run Python script
const python = await agentbase.runAgent({
  message: "Create and run a Python script that analyzes data.csv"
});

// Run Node.js script
const node = await agentbase.runAgent({
  message: "Create a Node.js script to fetch data from an API and save it"
});

// Run bash script
const bash = await agentbase.runAgent({
  message: "Create a bash script to backup all .txt files"
});

Git Operations

// Clone repository
const clone = await agentbase.runAgent({
  message: "Clone the repository from https://github.com/user/repo.git"
});

// Work with git (same session)
const gitOps = await agentbase.runAgent({
  message: "Navigate to the cloned repo, check the branches, and list recent commits",
  session: clone.session
});

// Make changes
const changes = await agentbase.runAgent({
  message: "Create a new file in the repo and show git status",
  session: clone.session
});

System Monitoring

// Check disk usage
const disk = await agentbase.runAgent({
  message: "Show disk usage with df -h"
});

// Monitor processes
const processes = await agentbase.runAgent({
  message: "Show running Python processes"
});

// Check memory
const memory = await agentbase.runAgent({
  message: "Display memory usage with free -h"
});

// Network information
const network = await agentbase.runAgent({
  message: "Show network connections and listening ports"
});

Use Cases

1. Software Development

Complete development workflows:
const development = await agentbase.runAgent({
  message: `Create a Python web scraper project:
  1. Create project structure (src/, tests/, requirements.txt)
  2. Install beautifulsoup4 and requests
  3. Create scraper.py with basic scraping logic
  4. Create tests for the scraper
  5. Run the tests to verify everything works`
});

2. Data Analysis

Process and analyze data files:
const analysis = await agentbase.runAgent({
  message: `Analyze sales data:
  1. Install pandas and matplotlib
  2. Read sales.csv
  3. Calculate monthly totals and trends
  4. Create visualization charts
  5. Generate a summary report as PDF`
});

3. System Administration

Automate system tasks:
const sysadmin = await agentbase.runAgent({
  message: `System maintenance tasks:
  1. Check disk usage and identify large files
  2. Clean up temporary files older than 7 days
  3. Check for available system updates
  4. Generate a system health report`
});

4. CI/CD Workflows

Build and test pipelines:
const cicd = await agentbase.runAgent({
  message: `Run CI/CD pipeline:
  1. Clone the repository
  2. Install dependencies
  3. Run linting and code quality checks
  4. Execute test suite
  5. Build the application
  6. Generate coverage report`
});

5. Web Scraping and Automation

Extract data from websites:
const scraping = await agentbase.runAgent({
  message: `Scrape product data:
  1. Install selenium and beautifulsoup4
  2. Navigate to product listing pages
  3. Extract product names, prices, and reviews
  4. Save data to products.json
  5. Create a CSV summary`
});

6. Machine Learning

Train and evaluate models:
const ml = await agentbase.runAgent({
  message: `Build ML model:
  1. Install scikit-learn and tensorflow
  2. Load and preprocess training data
  3. Train a classification model
  4. Evaluate model performance
  5. Save the trained model
  6. Create prediction script`
});

Core Capabilities & Tools

The computer environment provides comprehensive built-in capabilities:
Bash access: Full shell command execution for system operations, package installation, and process management.Use cases: Installing dependencies, running scripts, system configuration, file operations
const shell = await agentbase.runAgent({
  message: "Use bash to find all log files and compress them"
});
Complete file access: Read, write, create, and manage files across the entire Linux filesystem.Use cases: Code development, data processing, configuration management, artifact storage
const files = await agentbase.runAgent({
  message: "Create a project with multiple files and organize them"
});
Full browser capabilities: Navigate websites, interact with web applications, and extract data from web pages.Use cases: Web scraping, testing web applications, research, form automation
const browser = await agentbase.runAgent({
  message: "Open Chrome, navigate to a website, and extract data"
});
Screen capture: Take screenshots of the desktop, applications, or specific regions for visual debugging.Use cases: UI testing, visual verification, debugging graphical applications
const screenshot = await agentbase.runAgent({
  message: "Take a screenshot of the website homepage"
});
Internet access: Make HTTP requests, download files, clone repositories, access APIs.Use cases: API integration, data fetching, package downloads, repository cloning
const network = await agentbase.runAgent({
  message: "Download data from API and save to file"
});
Process control: Start, stop, monitor processes and background jobs.Use cases: Running servers, background tasks, monitoring applications
const process = await agentbase.runAgent({
  message: "Start a development server in the background"
});

Best Practices

Package Management

// Good: Install once, use across multiple requests
const setup = await agentbase.runAgent({
  message: "Install pandas, numpy, scikit-learn"
});

// Reuse session for subsequent operations
const analyze = await agentbase.runAgent({
  message: "Use pandas to analyze data.csv",
  session: setup.session
});

// Packages still installed
const visualize = await agentbase.runAgent({
  message: "Use matplotlib to create charts",
  session: setup.session
});
// Good: Use requirements.txt for Python dependencies
const setup = await agentbase.runAgent({
  message: `Create requirements.txt with:
  pandas==2.0.0
  numpy==1.24.0
  Then install with pip install -r requirements.txt`
});
// Good: Pin versions for reproducibility
const install = await agentbase.runAgent({
  message: "Install tensorflow==2.13.0 numpy==1.24.0"
});

// Avoid: Unpinned versions may cause issues
const install = await agentbase.runAgent({
  message: "Install tensorflow numpy"
});

Command Execution

Error Handling: Always check command exit codes and handle errors appropriately. Agents do this automatically but you can be explicit in your instructions.
// Explicit error handling in instructions
const result = await agentbase.runAgent({
  message: `Run the test suite. If tests fail, show the error details
  and suggest fixes. If they pass, show the coverage report.`
});

Resource Management

Monitor resource usage to avoid limits:
// Check resources before heavy operations
const check = await agentbase.runAgent({
  message: "Check available disk space and memory before processing large files"
});

// Clean up after operations
const cleanup = await agentbase.runAgent({
  message: "Remove temporary files and cached data after processing",
  session: check.session
});

Security Considerations

Sensitive Data: Be cautious with secrets and credentials. While the environment is isolated, avoid hardcoding sensitive information in files.
// Good: Use environment variables or secure parameters
const secure = await agentbase.runAgent({
  message: "Connect to database using environment variable DATABASE_URL",
  system: `Environment: DATABASE_URL=${process.env.DATABASE_URL}`
});

// Avoid: Hardcoding secrets
const insecure = await agentbase.runAgent({
  message: "Create config.json with password: secret123"
});

Integration with Other Primitives

With Sandbox

The computer environment runs within a sandbox:
// Each session has its own computer environment
const session1 = await agentbase.runAgent({
  message: "Install package and run script"
});

const session2 = await agentbase.runAgent({
  message: "Install different package and run different script"
});

// Completely isolated computer environments
Learn more: Sandbox Primitive

With File System

Shell commands interact with the file system:
const combined = await agentbase.runAgent({
  message: "Create files, organize them into directories, and run a script on them"
});
Learn more: File System Primitive

With Browser

Use shell to control browser automation:
const webAutomation = await agentbase.runAgent({
  message: "Install selenium, write a script to scrape data, and run it"
});
Learn more: Browser Primitive

With Custom Tools

Combine system commands with custom tools:
const integration = await agentbase.runAgent({
  message: "Use bash to download data, then use custom tool to process it"
});
Learn more: Custom Tools

Performance Considerations

Execution Speed

  • Command execution: Milliseconds for simple commands
  • Package installation: Varies (30s - 5min depending on package)
  • Script execution: Depends on script complexity
  • File operations: Near-instant for files under 10MB

Optimization Strategies

Cache Dependencies

Install packages once per session and reuse

Parallel Operations

Use background processes for concurrent tasks

Efficient Scripts

Optimize scripts for speed and resource usage

Minimal Installs

Only install required packages, not full suites

Performance Example

// Efficient: Parallel installation
const efficient = await agentbase.runAgent({
  message: "Install multiple packages in parallel using & and wait"
});

// Efficient: Reuse session
const step1 = await agentbase.runAgent({
  message: "Install dependencies"
});

const step2 = await agentbase.runAgent({
  message: "Run analysis",
  session: step1.session  // Dependencies already installed
});

Advanced Usage

Working Directory

Default working directory is /home/pointer:
// Check current directory
const pwd = await agentbase.runAgent({
  message: "Show current working directory with pwd"
});

// Navigate directories
const navigate = await agentbase.runAgent({
  message: "Create projects folder, navigate to it, and create files there"
});

Environment Variables

Set and use environment variables:
const env = await agentbase.runAgent({
  message: "Set environment variable API_KEY=xyz and use it in a script"
});

Background Processes

Run processes in the background:
const background = await agentbase.runAgent({
  message: "Start a development server in the background and show logs"
});

Cron Jobs and Scheduling

While cron isn’t directly supported, use sessions for scheduled tasks:
// Not recommended (cron not persistent)
// Instead, use Agentbase scheduling:
const scheduled = await agentbase.runAgent({
  message: "Run this analysis task",
  schedules: [{
    schedule: "0 0 * * *",  // Daily at midnight
    message: "Run daily analysis"
  }]
});

Troubleshooting

Problem: Command or package not availableSolution: Install the package first
const fix = await agentbase.runAgent({
  message: "Install the missing package using apt, pip, or npm"
});
Problem: Insufficient permissions for operationSolution: Use sudo or adjust file permissions
const fix = await agentbase.runAgent({
  message: "Use sudo for system-level operations or chmod for file permissions"
});
Problem: Process exceeds memory limitsSolution: Optimize script or use max mode
const optimized = await agentbase.runAgent({
  message: "Process data in chunks to reduce memory usage",
  mode: "max"  // More memory available
});
Problem: pip or npm installation errorsSolution: Check error messages and dependencies
const debug = await agentbase.runAgent({
  message: "Show detailed error from package installation and suggest fixes"
});
Problem: Running out of storageSolution: Clean up unnecessary files
const cleanup = await agentbase.runAgent({
  message: "Find and remove large temporary files and caches"
});

Additional Resources

Remember: Computer environments are created automatically when tasks require them. Simply describe your goal - agents will handle provisioning, tool selection, and environment management.