Overview
Integration details
| Class | Package | Serializable | JS support | Version |
|---|---|---|---|---|
| BrowserToolkit | langchain-aws | β | β |
Tool features
| Returns artifact | Native async | Supports browser interaction | Pricing |
|---|---|---|---|
| β | β | β | Pay-per-use (AWS) |
Available tools
The toolkit provides multiple tools for browser automation:| Tool | Description |
|---|---|
navigate_browser | Navigate to a URL |
click_element | Click on an element using CSS selector |
type_text | Type text into an input field |
extract_text | Extract all text content from the page |
extract_hyperlinks | Extract all hyperlinks from the page |
get_elements | Get elements matching a CSS selector |
current_webpage | Get the current page URL and title |
navigate_back | Go back to the previous page |
take_screenshot | Take a screenshot of the page |
scroll_page | Scroll the page in a direction |
wait_for_element | Wait for an element to appear |
Setup
The integration lives in thelangchain-aws package. It also requires playwright and beautifulsoup4 for browser automation and HTML parsing.
Credentials
You need AWS credentials configured with permissions for Bedrock AgentCore Browser. See the Amazon Bedrock AgentCore documentation for required IAM permissions. Itβs also helpful (but not needed) to set up LangSmith for best-in-class observability:Instantiation
The toolkit is created using a factory function:Invocation
Direct tool usage
Get specific tools and invoke them:Use within an agent
Thread-based session isolation
The toolkit maintains separate browser sessions for eachthread_id. This enables concurrent usage without interference:
Browser actions
Navigation
Interacting with elements
Extracting content
Screenshots and scrolling
Session cleanup
Always clean up browser sessions when done to release resources:Note: Whilecreate_browser_toolkit()is synchronous, thecleanup()method is asynchronous and must be awaited.
Concurrency protection
The toolkit includes built-in concurrency protection. Each browser session is tied to a specificthread_id, and attempting to access the same session while itβs already in use will raise a RuntimeError. Use different thread_id values for concurrent operations.