Safety & Control
~8 min readUpdated: November 2026

Ambar: Tiered Memory Management for Agentic AI Sandboxes at Scale

Ambar Memory Management for Agentic AI Sandboxes in Smoke Monkey

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.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

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.

Key Architectural Takeaways
Quick Implementation Exampleambar-sandbox-scheduler.ts
ambar-sandbox-scheduler.tstypescript
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);
Video Guides

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 CharacteristicSWE-agent (SWE-bench Verified)DABStepAmbar Cluster Gain
Median Tool Execution Burst119 ms1.0 ms99% of calls finish <1 s
Median LLM Inference Wait2.6 s5.8 sPrimary reclamation window
P90 LLM Inference Wait12.9 s17.7 sDeep tiering (CXL / NVMe SSD)
Agents Packed per Server1.0x Baseline1.0x Baseline5.9x Concurrent Agents
Datacenter CPU Utilization1.0x Baseline1.0x Baseline5.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.

bash
# 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/compressor

Never 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.

Google Search Questions & Answers

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 guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness