Skip to content

Dakes/agent-foundry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Agent Foundry

Lightweight, isolated microVMs for autonomous AI coding agents

Run AI coding agents 24/7 in isolated Firecracker VMs. Each project gets its own VM with full context, multi-repo support, and autonomous operation.

Features

  • πŸ€– Autonomous - supports ralph-claude-code and ralph-orchestrator
  • πŸ”’ Isolated - Dedicated VM per project, zero host pollution
  • πŸš€ Concurrent - Run unlimited VMs simultaneously
  • πŸ“š Rich Context - Company docs, standards, architecture included
  • πŸ”„ Multi-Repo - Agents work across multiple repositories
  • 🎯 Simple CLI - Host commands abstract VM complexity

Quick Start

# Install
git clone https://github.com/user/agent-foundry.git
cd agent-foundry
./install.sh --prefix ~/.local

# Setup
foundry host setup
foundry template build base
foundry template build golden

# Create and run
foundry vm create my-project --project example-project
foundry agent start my-project ralph
foundry agent logs my-project --follow

Ralph Variants

Agent Foundry supports two autonomous Ralph integrations:

  • ralph (backed by frankbria/ralph-claude-code)
  • ralph-orchestrator (backed by mikeyobrien/ralph-orchestrator)

Each VM image should include exactly one Ralph variant. Configure template builds with:

# ~/.config/foundry/config.conf
RALPH_AGENT_VARIANT=ralph-claude-code
# or
RALPH_AGENT_VARIANT=ralph-orchestrator

Project examples:

  • projects/example-project/ (ralph-claude-code)
  • projects/example-project-orchestrator/ (ralph-orchestrator)

Architecture

Host System (Arch/NixOS)
  ↓ Foundry CLI
  ↓ Firecracker + TAP (172.16.0.0/24)
  ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  VM 1   β”‚  VM 2   β”‚  VM 3   β”‚
β”‚  .11    β”‚  .12    β”‚  .13    β”‚
β”‚ /root/  β”‚ /root/  β”‚ /root/  β”‚
β”‚  β”œrepos β”‚  β”œrepos β”‚  β”œrepos β”‚
β”‚  β””.ralphβ”‚  β””.ralphβ”‚  β””.ralphβ”‚
β”‚ Ralph β†’ β”‚ Gemini  β”‚ Codex   β”‚
β”‚ Claude  β”‚  CLI    β”‚  CLI    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Use Cases

  • Autonomous Features: Define in PROMPT.md, agent implements across repos
  • 24/7 Work: Start agent on refactoring, review progress in morning
  • Parallel Development: Run 3-5 VMs on different projects simultaneously
  • Team Collaboration: Share base templates with company standards

Ralph File Structure

ralph-claude-code projects typically use this layout:

/root/                          # VM workspace
β”œβ”€β”€ .ralphrc                    # Config (optional, overrides default)
β”œβ”€β”€ .ralph/                     # Ralph files
β”‚   β”œβ”€β”€ PROMPT.md              # Mission: what to do
β”‚   β”œβ”€β”€ fix_plan.md           # Tasks: - [ ] checklist
β”‚   β”œβ”€β”€ AGENT.md              # Commands: npm test, etc
β”‚   β”œβ”€β”€ specs/                 # Requirements (optional)
β”‚   └── logs/                  # Execution logs
└── repos/                      # Your code
    β”œβ”€β”€ backend/
    └── frontend/

How it works:

  1. Ralph reads PROMPT.md β†’ Understands mission
  2. Reads fix_plan.md β†’ Gets next task
  3. Reads AGENT.md β†’ Knows how to test
  4. Makes changes β†’ Runs tests β†’ Checks off task
  5. Repeats until all done

For ralph-orchestrator, use top-level ralph.yml and PROMPT.md (see projects/example-project-orchestrator/).

Configuration

.ralphrc (Two-Tier System)

Default (templates/.ralphrc.template) - Full tool access, used when no project config exists

Project-Specific (projects/your-project/.ralphrc) - Overrides default

Customize: ALLOWED_TOOLS, MAX_CALLS_PER_HOUR, CLAUDE_TIMEOUT_MINUTES, circuit breaker thresholds

# Customize for a project
cp templates/.ralphrc.template projects/my-project/.ralphrc
vim projects/my-project/.ralphrc
foundry workspace sync my-vm my-project  # Apply to VM

VM Resources

Defaults: 4 vCPUs, 8GB RAM, 20GB disk

Override:

  • Global: ~/.config/foundry/config.conf
  • At create time: choose a different template and per-VM SSH key

SSH Keys

Per-VM keypair in ~/.local/share/foundry/vms/<name>/ssh/. Never reads ~/.ssh/ unless you pass --ssh-key <path>.

Custom Packages

Add to ~/.config/foundry/packages.txt:

postgresql
redis
go
rustup

CLI Commands

# VM lifecycle
foundry vm create <name> [template] [--project <project>] [--ssh-key <path>]
foundry vm start <name>
foundry vm stop <name>
foundry vm ssh <name> [command]
foundry vm destroy <name>
foundry vm list
foundry vm status <name>
foundry vm update <name>

# VM operations
foundry vm copy <src> <dst>
foundry vm rename <old> <new>
foundry vm snapshot <name> <snapshot>

# Agent management
foundry agent start <vm> <agent-type>  # ralph, ralph-orchestrator, claude, gemini, codex
foundry agent stop <vm>
foundry agent restart <vm>
foundry agent logs <vm> [--follow]
foundry agent attach <vm>
foundry agent status <vm>
foundry agent gh-watcher <action> <vm>

# Workspace
foundry workspace init <vm> <config.json>
foundry workspace sync <vm> [project]
foundry workspace init-ralph <vm>
foundry workspace edit <vm> <file>
foundry workspace info <vm>
foundry workspace template [file]

# Templates
foundry template build base      # Downloads Ubuntu 22.04 base
foundry template build golden    # Configures AI tools (apt based)
foundry template list

# Host setup
foundry host setup
foundry host status

# Network
foundry network init
foundry network status
foundry network cleanup

Full reference: CLI-REFERENCE.md

Requirements

Host System:

  • Linux (Arch, NixOS, Ubuntu, Fedora)
  • KVM enabled (hardware virtualization)
  • 4+ CPU cores, 16GB+ RAM recommended
  • 100GB+ disk space

Dependencies:

  • Firecracker, QEMU utils (qemu-img), iproute2 (ip), iptables/nftables, jq, SSH, Git

NixOS: Use included shell.nix

Documentation

Development

# For NixOS
nix-shell

# Run tests
# (tests are not fully scaffolded yet)

# Build templates
./scripts/build-ubuntu-base.sh

Release bundle is built automatically by install.sh if needed.

Project Status

🚧 Early Development - Core architecture defined, implementation in progress.

See TODO.md for roadmap.

License

MIT License - See LICENSE

Contributing

  1. Read VISION.md and ARCHITECTURE.md
  2. Check TODO.md for open tasks
  3. Create issue or PR
  4. Follow existing code style

Credits

Built on Firecracker β€’ Supports ralph-claude-code and ralph-orchestrator β€’ Inspired by the Ralph Wiggum technique

Support

  • GitHub Issues: Report bugs, request features
  • Discussions: Ask questions, share setups
  • Wiki: Community guides and tips

Note: Agent Foundry is for development use only. Not intended for production workload hosting.

About

A micro VM framework for autonomous AI Agents using Firecracker VMs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors