Skip to main content

Overview

Narada can control an existing browser window from another machine or process. Use RemoteBrowserEnvironment when you already have a browser window ID and want to run an Agent against that browser.

Prerequisites

Install Narada

Install Narada on the remote machine

Chrome Extension

Install and sign in to the Narada extension in Chrome

Python SDK

Set up the Python SDK on the controlling machine

Getting Started

1

Initialize the remote browser

On the remote machine:
  1. Open Chrome with the Narada extension installed.
  2. Visit https://app.narada.ai/initialize.
  3. Copy the browser window ID displayed by the initialization page.
Keep this browser window ID secure because it grants access to the remote browser.
2

Create the control script

Create a Python script on your controlling machine:
import asyncio

from narada import Agent, RemoteBrowserEnvironment


async def main() -> None:
    browser_window_id = "REPLACE_WITH_BROWSER_WINDOW_ID"

    env = RemoteBrowserEnvironment(browser_window_id=browser_window_id)
    agent = Agent(environment=env)

    response = await agent.run(
        prompt=(
            'Search for "LLM Compiler" on Google and open the first arXiv paper '
            "on the results page, then tell me who the authors are."
        )
    )

    print("Response:", response.text)


if __name__ == "__main__":
    asyncio.run(main())
Replace browser_window_id with the ID from your remote browser.
3

Run the remote task

Execute your control script:
python your_script.py
If successful, the remote browser executes your command and returns the result.

How It Works

  1. Browser Window ID: Each initialized browser window has a unique ID that identifies the remote execution target.
  2. Remote Environment: RemoteBrowserEnvironment(browser_window_id=...) points the SDK at that existing browser.
  3. Agent Execution: Agent(environment=env) sends browser automation requests to the remote window.
  4. Response Handling: Agent.run() returns an AgentResponse that you can inspect in Python.

Reconnecting to Cloud Browser Sessions

If you’re using Cloud Browser Sessions, provide both the browser window ID and the cloud browser session ID:
import asyncio

from narada import Agent, RemoteBrowserEnvironment


async def main() -> None:
    env = RemoteBrowserEnvironment(
        browser_window_id="saved-browser-window-id",
        cloud_browser_session_id="saved-cloud-session-id",
    )
    agent = Agent(environment=env)

    try:
        response = await agent.run(prompt="What page am I currently on?")
        print("Response:", response.text)
    finally:
        await env.close()


if __name__ == "__main__":
    asyncio.run(main())
Closing a RemoteBrowserEnvironment backed by a cloud session stops the entire cloud session. Make sure you’re done before calling close().