Skip to main content
Deterministic rerun lets you run a browser task once with a full agent, then re-execute the same task instantly using a cached script — no LLM, up to 99% cheaper.

Quick start

Use @{{double brackets}} around values that can change between runs. The first call runs the full agent. Every subsequent call with the same template uses the cached script.

How it works

1

You send a task with @{{brackets}}

The brackets mark which parts are parameters:
  • @{{example.com}} → parameter 1
  • @{{electronics}} → parameter 2
The system strips the values to create a template: "Get prices from @{{}} for @{{}}".
2

System hashes the template

Template "Get prices from @{{}} for @{{}}" is hashed to a unique ID like a7f3b2c1. The system checks the workspace for scripts/a7f3b2c1.py.
3

Cache miss → agent creates script

If no script exists, the full agent runs your task. After completing it, the agent saves a standalone Python script that reproduces the result deterministically — no AI needed.
4

Cache hit → script executes directly

If the script exists, it runs directly with the new parameter values. No agent, no LLM. Just the script in a sandbox with browser and proxy.

Auto-detection

Caching activates automatically when both conditions are met:
  • The task contains @{{ and }}
  • A workspace_id is provided
No extra flags needed. You can override with cache_script:

Examples

Parameterized scraping

Run once, then loop over different keywords at $0 LLM each:

No parameters — cache the exact task

Append empty brackets @{{}} to signal “cache this exact task”:

Multiple parameters

Force enable / disable

Inspecting cached scripts

You can download and inspect the scripts the agent created:

Auto-healing

Cached scripts can break when a website changes its layout, adds new elements, or alters its structure. Auto-healing detects these failures and automatically regenerates the script.

How it works

When a cached script runs, the system validates its output:
  1. Fast checks (no LLM) — detects empty results, error fields in JSON, or exception keywords in output.
  2. LLM judge — if fast checks pass, a lightweight model validates whether the output looks correct for the original task.
  3. Heal — if validation fails, the full agent re-runs the task and saves an updated script.
Auto-healing is limited to 1 attempt per run to prevent runaway costs. If the healed script also fails, the output is returned as-is.

Cost impact

Auto-healing is enabled by default for all cached scripts. No configuration needed.

Cost comparison

The browser and proxy still run for cached calls (the script may need them), so there is a small infrastructure cost per execution. LLM cost drops to zero.