What are Python Agents?
Python Agents are code-based automations that run directly in the browser using the Narada Python SDK. Unlike GUI workflow agents (which use a visual step-by-step editor), Python Agents give you the full flexibility of Python code to build complex automations with loops, conditions, data processing, and API calls.Full Python
Write real Python code with access to the Narada SDK, Pydantic, and common libraries
AI-Generated
Created automatically by Agent Maker and Imitation Learning
SDK-Powered
Use all Narada SDK methods:
agent(), go_to_url(), agentic_selector(), and moreHow Python Agents Are Created
There are three ways to create a Python Agent in Agent Studio:1. Agent Maker (Recommended for new users)
Describe your goal in natural language, and Agent Maker generates a complete Python Agent for you:2. Imitation Learning
Record yourself performing a task in the browser, and Imitation Learning generates an agent from your recording.3. Manual Creation
Create a Python Agent from scratch in Agent Studio:Writing Python Agent Code
Python Agents have access to the Narada SDK through a pre-initializedwindow object of type LocalBrowserWindow. Here’s the typical structure:
Using Structured Output
Extract typed data using Pydantic models:Using Input Variables
Python Agents can accept input variables when invoked, making them reusable with different data:Google Sheets Integration
Read from and write to Google Sheets:Available SDK Methods
Python Agents have access to all Narada SDK methods:| Method | Description |
|---|---|
agent() | Execute AI-powered automation tasks |
go_to_url() | Navigate to a URL |
agentic_selector() | Interact with specific UI elements |
get_screenshot() | Capture a screenshot |
get_full_html() | Get the page’s full HTML |
get_simplified_html() | Get cleaned/simplified HTML |
print_message() | Show a message in the side panel chat |
upload_file() | Upload a file for use in agent requests |
read_google_sheet() | Read data from Google Sheets |
write_google_sheet() | Write data to Google Sheets |
close() | Close the browser window |
Agent Types
When callingwindow.agent(), choose the right agent for the task:
OPERATOR
Web automation: clicks, navigation, form filling, data extraction from pages
CORE_AGENT
Read-only observation: extracting visible data, answering questions about page content, and web searches without taking browser actions
Running Python Agents
From Agent Studio
Click the Run button in the Agent Studio editor to execute your Python Agent in the current browser.From the SDK
Invoke a custom Python Agent from the SDK using the namespaced format:From Chat
Type the agent shortcut in the Narada chat:Best Practices
Use new_tab=True First
Always open a new tab for the first navigation to avoid closing the workflow tab
Handle Errors
Wrap
agent() calls in try/except for NaradaTimeoutError to handle slow pagesUse Structured Output
Define Pydantic models for reliable data extraction instead of parsing text responses
Print Progress
Use
print_message() to show progress updates in the side panel during long workflowsNext Steps
Agent Maker
Generate Python Agents from natural language descriptions
Imitation Learning
Record your actions to generate agents
Agent Studio
Manage and organize all your agents
Python SDK Reference
Full API reference for the agent() method
