Agent framework integration

Twin Browser + CrewAI

CrewAI is a Python framework for multi-agent “crews” — role-playing agents that collaborate on tasks. Tools are shared across the crew, and `@tool` from `crewai.tools` turns a function into one, using the docstring as the description the agents read.

Agent framework4-step setupBearer key auth

How Twin plugs into CrewAI

Give the crew one browser tool and every agent in it can reach the web. Twin is the right shape for this because the expensive part happens once: whichever agent triggers a cold run pays the planning, and every later agent that asks for something similar hits the compiled skill through the dispatch cache instead. The credential vault matters here too — a crew of agents does not each need their own copy of a password.

Twin is the browser execution layer your stack calls. The first run cold-compiles a skill via skill compilation; every similar request after that is matched from the cache and replayed deterministically, so your marginal cost per run trends toward zero rather than climbing with usage.

app.example.com
  1. Receive goal from CrewAIdone
  2. Compile DOM → token-efficient indexed statedone
  3. Match the semantic dispatch cacherunning
  4. Replay compiled skill — 0 LLM callsqueued

Wire it up

Drop Twin into CrewAI.

Copy, paste, and swap in your Bearer key. The first run compiles a skill; repeats match the semantic dispatch cache and replay deterministically.

CrewAI — a shared browser toolpython
import os, requests
from crewai.tools import tool

TWIN = "https://twin-browser.com/api/v1"

@tool("Browser task")
def twin_run(url: str, prompt: str) -> str:
    """Perform a task in a real browser on an authorized URL — including
    pages that require signing in. Returns the structured result."""
    r = requests.post(
        f"{TWIN}/run",
        headers={"Authorization": f"Bearer {os.environ['TWIN_API_KEY']}"},
        json={"url": url, "prompt": prompt, "success": {"kind": "extracted"}},
        timeout=300,
    )
    return str(r.json())

# researcher = Agent(role="Researcher", tools=[twin_run], ...)

Base URL https://twin-browser.com/api/v1 · auth Authorization: Bearer ab_live_… · over MCP the same engine is run_goal, compile_skill and run_skill the full tool table.

  1. Install CrewAI

    pip install crewai. Nothing Twin-specific is installed.

  2. Set your key

    Export TWIN_API_KEY with a key from the dashboard.

  3. Define the tool

    Decorate a function with @tool from crewai.tools; write a clear docstring — the agents read it.

  4. Share it with the crew

    Pass the tool to the agents that need the web. Skills compiled by one are available to all.

FAQ

CrewAI on Twin — common questions

Do all the agents in a crew share compiled skills?
Yes. Skills are stored against your tenant, not against a process or an agent, so a skill compiled during one agent’s task is available to every other agent using the same key — and to your REST and MCP callers.
How do credentials work when several agents need the same login?
They live once in the encrypted vault, keyed by host and optional account label. Agents reference the account label; none of them ever sees the secret.

Wire up CrewAI in minutes.

Free to start. Usage-based credits from $29/mo — each call billed the higher of its flat action price or its metered cost.