Skip to content

Add ElevenLabs integration: voice agent + browser agent#84

Open
shubh24 wants to merge 1 commit into
mainfrom
shubh24/elevenlabs-integration
Open

Add ElevenLabs integration: voice agent + browser agent#84
shubh24 wants to merge 1 commit into
mainfrom
shubh24/elevenlabs-integration

Conversation

@shubh24
Copy link
Copy Markdown

@shubh24 shubh24 commented Jun 1, 2026

What

Adds a standalone Next.js example under examples/integrations/elevenlabs/ that integrates an ElevenLabs voice agent with a Browserbase-backed browser agent.

The two agents share a single run state:

  • ElevenLabs is the voice shell — it listens, speaks, and exposes one client tool (control_demo) for issuing high-level browser instructions.
  • A single controller owns all browser state. It uses the Claude Agent SDK as a step planner and executes browser actions through the Browserbase browse CLI against a shared persistent Browserbase session.
  • The same session is rendered in a live iframe, so the user can watch the browser act while talking to the voice agent.

This lets you say things out loud ("open Browserbase, find the docs, read me the first heading") and have a real cloud browser carry it out, narrated back by voice.

Contents

  • app/ — Next.js UI (Browserbase-branded) + API routes (session, control, stream)
  • lib/demo-controller.ts — controller: Claude Agent SDK planner + browse CLI executor over a shared Browserbase session
  • lib/demo-types.ts — shared types
  • README.md — local setup, required env vars, and ElevenLabs agent configuration
  • .env.exampleANTHROPIC_API_KEY, BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID, NEXT_PUBLIC_ELEVENLABS_AGENT_ID

Also adds an elevenlabs/ entry to the monorepo README integration list.

Run locally

cd examples/integrations/elevenlabs
pnpm install
pnpm dev   # http://127.0.0.1:3001

Requires the Browserbase browse CLI on your PATH.

🤖 Generated with Claude Code


Note

Low Risk
Isolated example app and documentation only; no changes to published packages or core library behavior.

Overview
Adds a new ElevenLabs + Browserbase example under examples/integrations/elevenlabs/ and lists it in the root README.

The demo is a Next.js app where ElevenLabs handles voice and calls a single client tool (control_demo), while a shared controller owns browser state: it spins up a persistent Browserbase session (live iframe), plans steps with the Claude Agent SDK, and runs actions via the browse CLI. The UI polls GET /api/demo/session, streams snapshots over SSE (/api/demo/stream), and posts instructions to POST /api/demo/control.

The controller layer adds queuing, duplicate detection, optional interrupt, direct-navigation shortcuts, snapshot-based planning, and voice-oriented outcomes/guidance returned to the agent. Docs cover env vars (.env.example), local run on port 3001, and suggested ElevenLabs agent tool/system copy.

Reviewed by Cursor Bugbot for commit e2c3d89. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds a standalone Next.js example under examples/integrations/elevenlabs
showing ElevenLabs as the voice shell driving a Browserbase-backed browser
agent. A single controller owns browser state: ElevenLabs handles voice, the
Claude Agent SDK plans steps, and execution runs through the Browserbase
browse CLI against a shared persistent session rendered in a live iframe.

Includes the Browserbase-branded UI, API routes, controller logic,
.env.example, and local setup docs. Also lists the integration in the
monorepo README.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@shubh24 shubh24 requested a review from a team as a code owner June 1, 2026 18:55
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e2c3d89. Configure here.

pushEvent(session, "system", "Browserbase live view is ready.");
pushEvent(session, "system", `Browse CLI is attached to Browserbase session ${browserSession.id}.`);
publishSession(session);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Browse setup skipped after failure

High Severity

If ensureBrowseRemoteMode fails after a Browserbase session is created, browserbaseSessionId is already set. Later calls to ensureBrowserRuntime return immediately and never retry Browse CLI remote setup, so that demo can stay unable to run browser commands until the process is restarted.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e2c3d89. Configure here.

setControlOutcome(session, "error", message);
pushEvent(session, "error", message);
publishSession(session);
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Queued runs stall on error

Medium Severity

When a run finishes, the next queued instruction is started via executeInstruction in a fire-and-forget promise. If that call rejects, the handler sets error state but does not start further queue items, so remaining queued instructions never run while the snapshot still shows a non-zero queue.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e2c3d89. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant