Skip to main content

Overview

Execute autonomous agents powered by LLMs that can navigate websites, perform complex workflows, and complete tasks through natural language instructions.

Agent Management with Python SDK

The following snippet shows how to manage your agents using the Notte Python SDK.
from notte_sdk import NotteClient

notte = NotteClient()
with notte.Session() as session:
    agent = notte.Agent(session=session, max_steps=10)
    response = agent.run(task="Find the best italian restaurant in SF and book a table for 2 at 7pm today")
    print(f"Agent terminated with status: {response.success} and answer: {response.answer}")

Agent Fallbacks

Agents can also be used to handle script execution failures. This is useful to continue an otherwise deterministic script execution after a failure.
agent_fallback.py
from notte_sdk import NotteClient, actions

notte = NotteClient()
url = "https://www.linkedin.com/feed/"
company_name = "nottelabs"

# scrape all new posts (post url, date, title, content) from the company page on LinkedIn
with notte.Session() as session:
	session.execute(actions.Goto(url=url))
	# spin up agent fallback if the search for the company name fails
	with notte.AgentFallback(session,
		task=f"Open the company page for {company_name}. Fail if user is not logged in.") as agent:
		# search for the company name
		session.execute(actions.Fill(selector="internal:role=combobox[name=\"Search\"i]", value=company_name))
		# press enter to search
		session.execute(actions.PressKey(key="Enter"))
		# click on the company link
		session.execute(actions.Click(selector=f"internal:role=link[name=\"{company_name}\"s] >> nth=0"))
	# open the post tab on the company page
	session.execute(actions.Click(selector="internal:role=link[name=\"Posts\"i]"), raise_on_failure=False)
	data = session.scrape(instructions="scrape all new posts (post url, date, title, content)")
	print(f"Scraped data: {data}")
I