Skill compilation
Compile once. Replay for almost nothing.
Most browser agents re-run the LLM on every execution, so cost scales with usage. Twin turns a successful run into a named skill, matches re-phrased requests to it semantically, and replays it deterministically — so the curve bends the other way.
How it works
From one run to a replayable skill.
Three moves turn an unpredictable, LLM-driven browse into a deterministic program: minimize the successful path, match the next request to it by meaning, then replay it with no model in the loop.
A run compiles into a skill
The first time a goal succeeds, the planner’s exploration is minimized into a deterministic skill — the essential steps over indexed DOM state, with the exploration noise stripped out.
The semantic cache dispatches
A new, differently-worded request is embedded and vector-matched to a skill compiled earlier for the same host, then adapted to the new values — no cold start at full LLM cost.
Replay runs with no LLM
Call a compiled skill by name and it blind-replays deterministically — no model in the loop at all. The most-repeated workflows trend toward zero marginal LLM cost.
The surface
Two calls. One of them never touches a model.
Compilation and replay are separate, named operations in the public API — so “deterministic replay” is something you can call, not something you have to take on trust.
- POST
/api/v1/skillscompile_skillDiscover a path once, minimize it, and store it under a name you choose.
- POST
/api/v1/skills/{name}/runrun_skillReplay that skill deterministically. No model is called.
- POST
/api/v1/dispatchdispatchHand it a goal instead of a name: cache hit replays, cache miss compiles.
- GET
/api/v1/librarysearch_librarySearch the cross-tenant corpus of sanitized skeletons. Metadata only, free.
# 1 · Compile once — discover, minimize, name it.
curl -X POST https://twin-browser.com/api/v1/skills \
-H "Authorization: Bearer $TWIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"target": "https://app.example.com/invoices",
"goal": "download the latest invoice PDF",
"as": "latest-invoice"
}'
# 2 · Replay forever — same call, no model in the loop.
curl -X POST https://twin-browser.com/api/v1/skills/latest-invoice/run \
-H "Authorization: Bearer $TWIN_API_KEY"Prefer to skip naming things? POST /api/v1/dispatch takes the goal and decides for you — replay on a cache hit, compile on a miss. The full reference lives in the API docs.
The cost ladder
The same goal gets cheaper as it repeats.
A workflow moves down this ladder on its own: you pay a model once to learn the path, then pay browser time to walk it again.
| Tier | What actually runs | LLM cost per run |
|---|---|---|
| Cold compile | The planner discovers a path and minimizes it to the essential steps. You pay the model once and keep a reusable skill. | Full LLM |
| Dispatch cache hit | A differently-worded request vector-matches an existing skill for that host and is adapted to the new values. The structure is already known. | ~5× cheaper |
| Deterministic replay | A compiled skill is called by name and blind-replays against the live page. No model call at any step. | ~$0 LLM |
Cross-tenant corpus
The structure is shared. Your data never is.
Your agents inherit skeletons the whole network has already compiled, while your values, credentials and exact paths stay yours alone.
Shared skeleton
- The host a skill was compiled for.
- The ordered structure of the run — which kinds of elements, in what order.
- A short description of the intent.
Never leaves your tenant
- Any value you or your agent typed.
- Credentials and secrets — they stay in your vault.
- Results, page content, or your exact compiled path.
Read the full disclosure on the security page.
FAQ
Skill compilation, answered
How is the semantic cache different from exact-match replay?
What is the cross-tenant skill corpus?
Why does cost fall as usage grows?
How do I compile and replay a skill?
Stop paying the model twice for the same task.
Compile once, dispatch semantically, replay deterministically. The first run buys the path; every run after it walks the path you already own.