You can integrate browser automation into your CrewAI agents by using create_browser_toolkit. This function returns both a toolkit object (used for resource management) and a list of browser_tools that can be assigned directly to an Agent.
Important: Always call toolkit.sync_cleanup() when your process is finished to release browser resources.
from crewai import Agent, Task, Crew, LLM
from crewai_tools.aws.bedrock.browser import create_browser_toolkit
# Create the browser toolkit
toolkit, browser_tools = create_browser_toolkit(region="us-west-2")
# Create the Bedrock LLM
llm = LLM(
model="bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0",
region_name="us-west-2",
)
# Create a CrewAI agent that uses the browser tools
research_agent = Agent(
role="Web Researcher",
goal="Research and summarize web content",
backstory="You're an expert at finding information online.",
tools=browser_tools,
llm=llm
)
# ... define tasks and crew ...
result = crew.kickoff()
# Clean up browser resources when done
toolkit.sync_cleanup()