agent.run()

Run smarter
agents.
Use fewer tokens.

AgentRun is an open-source platform that supercharges your agents. It adds self-improvement, durable execution and a control plane to your favorite agent harness.

Works with Claude Code, Codex, Pi, and OpenCode.

Read the docs

Earlier attempts inform a tested workflow. An illustrative comparison from input to output across runs. Colored agents replay earlier runs, pausing to find tools, plan an approach, retry, and repair output. The orange agent represents a later run: reuse a learned skill, run a saved workflow, apply known rules, and check the result. It skips exploration stops and reaches the output while earlier runs are still working. Movement illustrates less repeated reasoning, not a measured speed or token benchmark. Input Reuseskill Run savedworkflow Use knownrules Checkresult Output Find a tool Plan an approach Retry the request Read the docs Find missing data Repair output

01 SELF-LEARNING

Make your agents smarter
and cheaper with every run.

Repeated steps become reusable skills and tested workflows. Later runs reuse what works instead of planning it all again.

  1. Learn from each run.

    AgentRun turns repeated steps into proposed skills and workflows.

  2. Test before reusing.

    Proposals are checked and graded before they are accepted.

  3. Reuse what worked.

    Later runs spend fewer tokens on repeated planning and tool discovery.

LEARNING BETWEEN RUNSLearn the steps. Reuse the workflow.
The first run finds, plans, fetches, and checks a result. AgentRun checks and saves a reusable workflow. A later run skips repeated exploration. Its orange route and four stations then become a descending line labeled relative cost per run. This illustrates less repeated work, not measured cost savings. FIRST RUN Task FindAPI Readdocs Planrequest Fetch Check Result LATER RUN REUSABLE WORKFLOWFetch → Check Task Fetch Check Result A first route finds and plans the steps. A checked workflow is saved for a later run. Its orange route and four stations move into a relative-cost chart showing less repeated work. The chart is illustrative, not a measured benchmark. FIRST RUN Task Find Plan Fetch Check Result LATER RUN REUSABLE WORKFLOWFetch → Check Task Fetch Check Result
Relative cost per run As learned steps are reused MoreLessEarly runsLater runs

02 PLATFORM

Your choice of harness.
One platform around it.

Your harness handles reasoning and tool use. AgentRun manages its runs, workspace, recovery, and learning through one API.

Four harnesses. One AgentRun platform. Pi, Claude Code, Codex, and OpenCode connect to the same orange platform route, with shared stops for tools, workspace, recovery, and learning. The selected harness handles reasoning and tool use; AgentRun provides the platform around it. Pi Claude Code Codex OpenCode AgentRun platform One API. Shared operations. Tools Workspace Recovery Learning Choose a harness. Share the AgentRun platform. Four harness routes join one AgentRun route through tools, workspace, recovery, and learning. The platform manages runs around the harness you choose. Pi Claude Code Codex OpenCode AgentRun platform One API. Shared operations. Tools Workspace Recovery Learning
Any supported harness. One platform for every run.
Create and run an agent
research.ts
import { AgentRun } from "@parcha/agentrun-client";

// Reads AGENTRUN_BASE_URL and AGENTRUN_API_KEY.
const client = new AgentRun();

const agent = await client.agents.create({
  definition: {
    version: 1,
    name: "Research assistant",
    instructions: "Research requests. Cite sources. Ask which aspect to focus on before you start.",
    harness: "pi",
    learning: true,
    tools: ["web_search", "web_fetch", "ask_person"],
    skills: [],
  },
});

const started = await client.runs.start(agent.agent_id, {
  input: { content: "Research acme.com" },
  max_cost_usd: 1,
});
let run = await client.runs.wait(started.run_id, { timeoutMs: 600_000 });

if (run.pending?.kind === "question") {
  console.log(run.pending.question);
  await client.runs.message(run.run_id, { content: "Pricing and plans." });
  run = await client.runs.wait(run.run_id, { timeoutMs: 600_000 });
}

console.log(run.status, run.result);

Install with npm i @parcha/agentrun-client. Set AGENTRUN_BASE_URL and AGENTRUN_API_KEY for your deployment.

The same client manages every run.

03 COMPUTE

Give your agents
the right compute.

Keep the agent loop separate from the computer doing the work. Connect your provider once; AgentRun handles commands, files, and cleanup through one API.

Lightweight sandboxes

Run quick scripts, inspect files, and generate small reports.

Development environments

Install dependencies, build, and test code in an isolated Linux environment.

High-resource sandboxes

Configure more CPU and memory for larger datasets and batch processing.

Choose your compute provider. Keep the same agent API.

04 DURABLE EXECUTION

Keep your progress.
Even when a run stops.

AgentRun saves the conversation, files, and completed tool results. After an interruption, recover the run from saved state instead of rebuilding its context.

One recovery layer

Keep the same recovery API across harnesses. No need to rebuild persistence around each one.

Saved work

Keep completed tool results alongside the conversation and workspace.

Restart recovery

A new process reopens the saved state and continues the run.

Continue a stopped runTypeScript client
import { AgentRun } from "@parcha/agentrun-client";

const client = new AgentRun();

// A stopped run keeps its conversation and files.
await client.runs.message("your-run-id", {
  content: "Continue with the saved context.",
});
const run = await client.runs.wait("your-run-id");
console.log(run.status, run.result);
New turn. Same conversation and files.
Saved context survives a stopped runAn agent stops after completing several steps. Its conversation, files, and run state remain saved. A new turn continues with that history. Run stoppedContinue withsaved context ConversationFilesRun state Continue with saved contextA stopped agent keeps its conversation, files, and run state. The next turn continues using that saved history. Run stoppedContinue withsaved context ConversationFilesRun state
Continue from saved history.

05 AGENT MANAGEMENT

Manage all your agents
in one place.

See what your agents are doing, find the runs that need attention, and inspect their results through one console and API.

AgentRun Mission Control populated with sample data: three agents, running jobs, attention items, recent results, and activity and token usage charts.
AGENTRUN CONSOLE / SAMPLE DATAView full size (opens in a new tab)

Agents and revisions

Manage instructions, tools, and the revision each agent runs.

Runs and results

Monitor progress, respond to requests for input, and inspect files.

Learning notes

Review what an agent learned and the context available to its next run.

PLATFORM COMPARISON

Why AgentRun?

Choose your harness. Own your infrastructure. Turn repeated work into reusable skills and tested workflows.

Included Not offered Partial / different scope Not documented

Scroll to compare platforms

What you get Open sourceAgentRun AnthropicClaude Managed Agents OpenAIAgents API Google CloudGemini Enterprise Agent Platform
Open source & self-hostableFull platform, including the console Apache 2.0 Managed service Managed service Managed service
One API across harnessesChoose how your agents run Pi · Claude Code
Codex · OpenCode
Claude only Codex only Custom integration
Learns skills & workflowsFrom completed runs Built-in, evaluated learning Memory learning
Preview
Not documented Skill optimization
Experimental
Durable executionRecover interrupted work Built-in recovery Durable sessions Durable sessions Opt-in resume
Run multiple agentsManage concurrent work Shared API & console Agent teams Parallel subagents Multi-agent workflows

Compares the named platforms.

06 DEPLOYMENT

Open source.
Or hosted for you.

Learning, recovery, and the console are all open source. Run AgentRun with your own API keys, or choose a hosted deployment.

01 / YOUR INFRASTRUCTURE

AGENTRUN OPEN SOURCE

Self-hosted

Run AgentRun on your machine or server. Bring your own model API keys and keep control of your agents and data.

  • Self-learning and reusable workflows
  • Run history and recovery
  • Agent management console

Free under Apache-2.0 · View on GitHub
02 / MANAGED INFRASTRUCTURE

AGENTRUN CLOUD

Cloud

Choose hosted AgentRun from the team at Grep. Build and run your agents while we manage the infrastructure.

  • Hosted AgentRun deployment
  • No server to maintain
  • Start in the Cloud console
Get started

Infrastructure managed by the Grep team.

03 / YOUR ORGANIZATION

AGENTRUN ENTERPRISE

Enterprise

Work with the Grep team to plan an AgentRun deployment around your infrastructure, access requirements, and support needs.

  • Deployment planning
  • Security and access review
  • Team onboarding and support
Talk to sales

Discuss your requirements with our team.

Built by the team behind Grep AI, whose platform powers business process agents at Worldpay, IG.com, Citizens, and Airwallex. Self-host AgentRun with your own keys, or let us host it on AgentRun Cloud.

FAQ

Frequently asked questions

How learning works, where the savings come from, and what stays under your control.

What does AgentRun add to my agent harness?

AgentRun is the platform around your chosen harness. Define agents, run them through a common API, and manage their revisions, run history, recovery, and learning in one place. The harness still handles the agent’s reasoning and tool use.

Explore the platform

Is AgentRun open source? How does it relate to Grep?

AgentRun is open source under Apache-2.0, built by the team behind Grep. Learning, recovery, and the console are included. You can self-host with your own model API keys; model and infrastructure costs are yours. Grep is our managed platform for business agents. AgentRun Cloud is our hosted AgentRun offering, and is optional when you self-host.

AgentRun on GitHub · About Grep

How does self-learning work?

When learning is enabled, the agent reflects on its runs and proposes notes, reusable skills, and workflow drafts. Accepted changes are versioned and available to later runs, so repeated steps can be reused instead of planned again. This updates the agent’s saved knowledge and procedures, not the model’s weights.

How learning works

How does that reduce token usage?

An agent can spend tokens rediscovering an API, planning the same request, or deciding how to validate a result. Reusing a skill or workflow can skip that repeated reasoning. The agent still uses models and tools where needed. Potential savings come from reducing repeated work.

Reusable skills and workflows

How much will I save?

Savings depend on how much work repeats. The launch post reported a 90% cost reduction for one compliance workload. Results vary, and reflection and grading also add cost. Measure total spend and answer quality on your own workload, including the cost of learning.

Launch example · Learning costs

What happens when a decision is uncertain?

You define the threshold and the fallback in your workflow. Uncertain results can go to an agent for further investigation or trigger escalation for review. A confidence score is a routing signal, not a guarantee of accuracy. Choose thresholds using evaluated examples and the consequences of getting the decision wrong.

Confidence and fallback · Interpreting scores

Do I need Jev to use AgentRun?

No. Jev is an optional integration for focused decisions in workflows you author, such as choosing a category or returning a score. Agents and self-learning work without it. Automatically learned workflows currently use supported model and tool steps; they do not automatically turn into Jev decisions.

Jev integration · Learned workflow support

Do I have to turn my whole agent into a workflow?

No. Keep open-ended tasks agentic and make repeatable steps reusable. Workflows can include agent investigation at defined points, so you can automate routine paths while deciding how exceptions should be handled. You control where a workflow continues, retries, or asks for help.

See a workflow with agent investigation

How are learned changes checked?

Proposals pass structural checks and an AI grader before they can be reused. Changes that widen trust, loosen checks, or direct money or data require owner approval. You can inspect changes, edit notes, or retire learned material. These checks help filter proposals; you still need to evaluate results on your tasks.

Validation and approval

Which harnesses can I use?

Pi, Claude Code through the Claude Agent SDK, Codex, and OpenCode. Choose a harness in your AgentRun agent definition while keeping shared run management and learning. Each harness needs its own configuration, and available models and tools can differ.

Harness setup

Can I run AgentRun on my own infrastructure?

Yes. Self-host the open-source platform locally or on your own server and bring your model API keys. Agent definitions, runs, and learned material live in your configured data directory. Model calls and hosted browser sessions still go to the providers you configure.

Self-hosting instructions

AGENT.RUN() / GET STARTED

Set up AgentRun
with your agent.

Follow the AgentRun quickstart with your coding agent. Open the prompt in an app, or copy it into your terminal agent.

Download Markdown