A loop is easy.
The rest is Anchor.
Your strategy. Your tools. Anchor SDK handles the infrastructure between “do this” and actually done. Context, recovery, and sandboxed work in one TypeScript harness.
npm install anchor-ai-sdkBuilt for the turns
that don’t go to plan.
Models can reason.
Give yours the system to keep going.
A context window is not a memory.
Agents can keep notes on disk while older conversation is summarized. Built-in tools attempt to spill oversized output to sandbox files for later reads.
Under the hoodFix retry behavior in the HTTP client.
The timeout resets on every attempt.
Patch the deadline. Test the slow path.
Your sandbox.
Not another integration to rebuild.
Configure an E2B template, a Heyo image, or a Docker image. Anchor adapts the machine lifecycle and execution surface so the agent and its built-in tools use the same Sandbox interface.
A shared conformance suite tests the contract. Provider accounts, toolchains, and optional capabilities still differ. The layer can also be used without an agent.
Configure your sandboximport { heyo } from "anchor-ai-sdk/sandbox/heyo";
// Configuration fragment. requiredEnv validates host configuration.
// Complete runnable setup is in the docs.
const provider = heyo({
token: requiredEnv("HEYO_TOKEN"),
server: requiredEnv("HEYO_SERVER"),
namespace: requiredEnv("HEYO_NAMESPACE"),
image: requiredEnv("HEYO_IMAGE"),
imageKind: "artifact",
imageStore: requiredEnv("HEYO_IMAGE_STORE"),
sizeClass: "small",
diskSizeGb: 10,
});
const sandbox = provider.create({ repoUrl, ref: "main" });
// Start it, then pass sandbox to runAgent.Nine of ten.
The record is open.
Anchor vs. mini-swe-agent.
10 SWE-bench Lite tasks. Parasail GLM 5.3.
9 resolved for each arm. Different failure paths.
A selected sample, with different budgets. Mini’s remaining task has a recorded patch-extraction failure.
Anchor records $4.3162; mini usage is not reported. No cost comparison is claimed for this round.
Small pieces.
A harness of your own.
Phases shape the approach. Tools do the work. Compose them into an agent; bring the model and runtime. No custom agent loop to maintain.
Build from primitivesimport { readFileTool, searchTool, runAgent } from "anchor-ai-sdk";
export const phases = [
{ id: "inspect", goal: "Read the relevant code." },
{ id: "respond", goal: "Explain findings with file references." },
];
export const strategy = {
name: "review",
phases,
requiresSandbox: true,
systemPrompt: () => phases
.map(({ id, goal }) => `${id}: ${goal}`).join("\n"),
};
export const agent = {
name: "reviewer", strategy,
tools: [searchTool, readFileTool],
};
// Supply your llm and a started sandbox. Full setup is in the docs.
const result = await runAgent(
{ task: "Explain the retry behavior" },
{ llm, sandbox, agent },
);