Skip to main content
BCTRL integrates powerful AI agent systems that let you automate browsers and desktops using natural language instead of writing selectors or scripts.

Available Agents

Web Agents

Work with cloud browsers to automate web-based tasks.
AgentDescriptionUse Case
StagehandFast, action-oriented AISingle actions, data extraction
Browser-useAutonomous multi-step agentComplex workflows, research tasks

Desktop Agents

Work with cloud computers and local desktops to automate native applications.
AgentDescriptionUse Case
CUAComputer Use AgentDesktop automation, native apps, multi-app workflows

Quick Comparison

FeatureStagehandBrowser-useCUA
EnvironmentCloud browsersCloud browsersCloud computers, local desktop
Best ForQuick actions, extractionResearch, multi-siteNative apps, OS-level tasks
Vision SupportYesYesYes
Multi-stepVia agent()Built-inBuilt-in
AutonomyLow-MediumHighHigh

Quick Examples

import { playwright } from '@bctrl/sdk';
import { z } from 'zod';

const session = await playwright.connect({
  apiKey: process.env.BCTRL_API_KEY
});

// Single action
await session.stagehand.act('Click the login button');

// Extract data
const prices = await session.stagehand.extract(
  'Get all product prices',
  z.array(z.number())
);

// Multi-step agent
const agent = session.stagehand.agent();
await agent.execute('Fill out the contact form');

await session.close();
Best for: Quick actions, data extraction, structured tasks

Accessing AI Agents

Web Agents (Stagehand & Browser-use)

AI agents are available as namespaces on any browser session (except Selenium):
import { playwright } from '@bctrl/sdk';

const session = await playwright.connect({
  apiKey: process.env.BCTRL_API_KEY
});

// Stagehand methods
session.stagehand.act(...)
session.stagehand.extract(...)
session.stagehand.observe(...)
session.stagehand.agent(...)

// Browser-use methods
session.browserUse.agent(...)
session.browserUse.codeAgent(...)

Desktop Agent (CUA)

CUA is available on desktop connections:
import { bctrl } from '@bctrl/sdk';

const desktop = await bctrl.desktop.connect({
  apiKey: process.env.BCTRL_API_KEY,
  os: 'windows' // or 'macos', 'linux'
});

// CUA methods
desktop.cua.run(...)

When to Use AI Agents

Use AI When...

  • Selectors change frequently
  • Tasks are described in natural language
  • You need to extract unstructured data
  • The workflow is complex or multi-step
  • Automating native desktop applications
  • Complex multi-app workflows
  • Tasks that need screen understanding

Use Traditional APIs When...

  • Performance is critical
  • Selectors are stable
  • You need precise control
  • Tasks are simple and repetitive

Hybrid Approach

Combine traditional automation with AI for the best of both worlds:
import { playwright } from '@bctrl/sdk';
import { z } from 'zod';

const session = await playwright.connect({ apiKey: '...' });
const page = session.page;

// Traditional: fast, reliable navigation
await page.goto('https://example.com');
await page.locator('#username').fill('[email protected]');
await page.locator('#password').fill('password');
await page.locator('button[type="submit"]').click();

// AI: handle dynamic content
await session.stagehand.act('Dismiss any popup or modal that appears');

// Traditional: known selectors
await page.locator('nav a[href="/products"]').click();

// AI: extract unstructured data
const products = await session.stagehand.extract(
  'Get all products with name, price, and rating',
  z.array(z.object({
    name: z.string(),
    price: z.number(),
    rating: z.number()
  }))
);

console.log(products);
await session.close();

LLM Configuration

All agents support configuring the underlying LLM:
// Stagehand
await session.stagehand.act('Click login', {
  modelName: 'gpt-4o',           // or 'claude-3-5-sonnet', 'gemini-2.0-flash'
  temperature: 0.1
});

// Browser-use
const agent = session.browserUse.agent({
  llm: 'gpt-4o',
  useVision: true
});

// CUA
await desktop.cua.run('Open Notepad', {
  model: 'gpt-4o'
});

Next Steps