Ambar: Tiered Memory Management for Agentic AI Sandboxes at Scale

Ambar (arXiv:2611.35212) solves the CPU-versus-DRAM bottleneck in datacenter agent sandboxes. Because tools execute in sub-second bursts (119 ms median in SWE-agent, 1.0 ms in DABStep) followed by 2.6–17.7 second LLM inference waits, sandbox memory stays stranded. Using idle-time prediction, hot-page snapshotting, and hardware-offloaded CXL/SSD tiering and compression, Ambar packs 5.9x more agents per server and lifts CPU utilization 5.0x with <=6.3% P99 latency impact.
Ambar: Tiered Memory Management for Agentic AI Sandboxes at Scale: Ambar (arXiv:2611.35212) solves the CPU-versus-DRAM bottleneck in datacenter agent sandboxes. Because tools execute in sub-second bursts (119 ms median in SWE-agent, 1.0 ms in DABStep) followed by 2.6–17.7 second LLM inference waits, sandbox memory stays stranded. Using idle-time prediction, hot-page snapshotting, and hardware-offloaded CXL/SSD tiering and compression, Ambar packs 5.9x more agents per server and lifts CPU utilization 5.0x with <=6.3% P99 latency impact. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 5.9x Higher Sandbox Density: Eliminates stranded DRAM across idle coding and data-analysis containers waiting on remote LLM API calls.
- 5.0x Host CPU Utilization: Colocates nearly six times as many active tool-execution sandboxes without triggering out-of-memory thrashing.
- Eager Hot-Page Restoration: Tracks working-set pages across tool bursts and restores only pages required by the upcoming tool call.
- Hardware-Offloaded Tiering: Offloads memory compression and CXL/SSD page migration to accelerators so host CPU cores stay free for tool execution.
import { createAgent } from '@smoke-monkey/harness';const sandboxCoordinator = createAgent({agentId: 'ambar-tiered-sandbox-runner',provider: 'anthropic',model: 'claude-sonnet-4-5',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},sandbox: {tieringPolicy: 'idle-predict',hotPagePrefetch: true,coldTier: 'cxl-ssd',},});async function runParallelEvaluations(taskIds: string[]) {const res = await sandboxCoordinator.run(`Dispatch ${taskIds.length} isolated sandbox containers, checkpoint idle DRAM during LLM calls, and eagerly restore hot pages prior to pytest runs.`);console.log('Sandbox Batch Result:', res.summary);}runParallelEvaluations(['swe-101', 'swe-102', 'swe-103']).catch(console.error);
Watch: Related Video Guides
AI Agent Sandboxes Explained: MicroVMs, gVisor and Containers
Agent Memory EXPLAINED - Complete Architecture
What Is Ambar? Characterizing the Agentic CPU-Memory Mismatch
Unlike traditional microservices or batch jobs, agentic AI sandboxes alternate between ultra-short local CPU tool bursts and long remote GPU inference waits. Characterization of SWE-agent (100 SWE-bench Verified tasks) and DABStep shows median tool calls last just 119 ms (SWE-agent) and 1.0 ms (DABStep), with 99% finishing under 1 second.
Meanwhile, median remote LLM inference waits take 2.6 seconds in SWE-agent and 5.8 seconds in DABStep (with P90 waits reaching 12.9 seconds and 17.7 seconds). Because each sandbox holds gigabytes of repository state and runtime heaps in DRAM while sitting completely idle for 95%+ of wall-clock time, host CPUs run starved while DRAM hits 100% saturation.
Sandbox Duty-Cycle Telemetry & Ambar Scaling Results
Naive swap or generic zram degrades tool tail latency by burning CPU cycles on page faults during resumption. Ambar resolves this by jointly optimizing compression and CXL/SSD tiering with three targeted mechanisms.
| Metric / Workload Characteristic | SWE-agent (SWE-bench Verified) | DABStep | Ambar Cluster Gain |
|---|---|---|---|
| Median Tool Execution Burst | 119 ms | 1.0 ms | 99% of calls finish <1 s |
| Median LLM Inference Wait | 2.6 s | 5.8 s | Primary reclamation window |
| P90 LLM Inference Wait | 12.9 s | 17.7 s | Deep tiering (CXL / NVMe SSD) |
| Agents Packed per Server | 1.0x Baseline | 1.0x Baseline | 5.9x Concurrent Agents |
| Datacenter CPU Utilization | 1.0x Baseline | 1.0x Baseline | 5.0x CPU Utilization |
| Tool Resume P99 Latency Delta | — | — | <= 6.3% Bounded Increase |
Ambar achieves this bounded tail latency via: (1) lightweight differential snapshotting, (2) hot-page tracking that eagerly restores only pages touched by the next tool invocation, and (3) hardware accelerator offload for memory compression and tier transfers.
Inspecting Sandbox Working Sets & Configuring Memory Reclamation
Before tuning tiering thresholds in Linux container or microVM hosts, measure active RSS versus page-cache growth across idle LLM wait windows using cgroup memory telemetry and smem.
# Inspect per-sandbox cgroup v2 memory pressure and working set (anon vs file cache)
for cg in /sys/fs/cgroup/sandboxes/*; do
echo "=== $(basename "$cg") ==="
grep -E "^(anon |file |pgscan|pgsteal)" "$cg/memory.stat"
cat "$cg/memory.current"
done
# Enable zswap / tiered CXL NUMA balancing on Linux kernels for idle sandbox reclamation
echo 1 | sudo tee /sys/module/zswap/parameters/enabled
echo zstd | sudo tee /sys/module/zswap/parameters/compressorNever Demote Before Measuring Restore Cost
Ambar only migrates or compresses a sandbox when predicted idle duration (`2.6s–17.7s`) exceeds the combined reclamation and eager-restore latency budget.
Scaling Isolated Agent Sandboxes in Smoke Monkey
Smoke Monkey Harness cleanly separates remote LLM provider calls from local workspace tool execution (read_file, write_file, run_command). Deploying Smoke Monkey worker pools with Ambar-style idle-window tiering allows infrastructure teams to colocate nearly 6x more parallel coding, test, and verification agents on existing CPU nodes without sacrificing interactive tool responsiveness.
Frequently Asked Questions
Q:Why do AI agent sandboxes underutilize datacenter CPUs?
Agent tools run in sub-second bursts (1 ms–119 ms median), then sit idle for 2.6–17.7 seconds waiting on remote LLM responses. Their allocated DRAM stays pinned, exhausting server memory long before CPUs are busy.
Q:How does Ambar avoid stalling when an idle agent resumes tool execution?
Ambar tracks hot working-set pages per sandbox and eagerly restores only the memory pages needed for the upcoming tool call, keeping P99 latency increases within 6.3%.
Q:Does memory compression steal CPU cycles from active agents?
Ambar offloads data movement and compression to hardware accelerators, preserving host CPU cycles for active sandboxes and driving 5.0x higher CPU utilization.
Q:What memory tiers does Ambar support?
Ambar jointly manages local DRAM compression and slower memory tiers including CXL memory expanders and NVMe SSDs based on predicted sandbox idle duration.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.