Skip to content

Integrations

Guides for integrating Oryn with AI agent frameworks and other tools.

Overview

Oryn is designed to be integrated into AI agent systems. The CLI provides a simple interface that agents can control via standard input/output.

Integration Approaches

CLI Wrapper

The simplest approach is to wrap the oryn CLI as a subprocess:

import subprocess

class OrynBrowser:
    def __init__(self, mode="headless"):
        self.process = subprocess.Popen(
            ["oryn", mode],
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            text=True
        )

    def execute(self, command: str) -> str:
        self.process.stdin.write(command + "\n")
        self.process.stdin.flush()
        return self._read_response()

Tool Definition

For agent frameworks that support tools/functions:

def browser_action(command: str) -> str:
    """
    Execute a browser action using Oryn Intent Language.

    Args:
        command: Intent command (e.g., 'goto google.com', 'click "Login"')

    Returns:
        Result of the action
    """
    return browser.execute(command)

Supported Frameworks

Framework Status Documentation
IntentGym Supported Guide
Python SDK (oryn-python) Supported Guide
Remote Extension (extension) Supported Guide
WASM Extension (extension-w) Supported Guide
Google ADK Supported Guide
LangChain Planned Coming soon
AutoGPT Planned Coming soon
CrewAI Planned Coming soon

Best Practices

Oryn-W Documentation Map

For full extension-w coverage (features, architecture, setup, usage, testing, release, troubleshooting), start here:

Tool Descriptions

Provide clear tool descriptions for the agent:

TOOL_DESCRIPTION = """
Execute browser actions using Oryn Intent Language.

Available commands:
- goto <url>: Navigate to a page
- observe: List interactive elements
- click <target>: Click element by ID or text
- type <target> <text>: Type into input
- login <user> <pass>: Execute login intent
- search <query>: Execute search intent

Examples:
- goto google.com
- click "Sign in"
- type email "user@test.com"
- login "user@test.com" "password"
"""

Session Management

Keep a single browser session per task:

# Good: Reuse session
browser = OrynBrowser()
browser.execute("goto site1.com")
browser.execute("goto site2.com")

# Avoid: New session per command

Error Handling

Parse Oryn responses to detect errors:

def execute_with_retry(command: str, max_retries: int = 3) -> str:
    for attempt in range(max_retries):
        result = browser.execute(command)
        if not result.startswith("error"):
            return result
        if "element not found" in result:
            browser.execute("observe")  # Refresh element IDs
    return result