CrewAI
Add Lightcone browser automation as a tool for CrewAI multi-agent workflows.
Use Lightcone as a CrewAI tool to give your agents the ability to browse the web, fill forms, take screenshots, and extract data.
Install
Section titled “Install”pip install crewai tzafonExample
Section titled “Example”from crewai import Agent, Task, Crewfrom crewai.tools import BaseToolfrom tzafon import Lightcone
class LightconeBrowserTool(BaseTool): name: str = "browser" description: str = ( "Browse a website and return a screenshot URL. " "Input should be a URL to visit." )
def _run(self, url: str) -> str: client = Lightcone() with client.computer.create(kind="browser") as computer: computer.navigate(url) computer.wait(2) result = computer.screenshot() return computer.get_screenshot_url(result)
# Create an agent with the browser toolresearcher = Agent( role="Web Researcher", goal="Find information on websites", backstory="You are a skilled web researcher.", tools=[LightconeBrowserTool()],)
task = Task( description="Visit https://news.ycombinator.com and describe the top 3 stories", expected_output="A summary of the top 3 stories on Hacker News", agent=researcher,)
crew = Crew(agents=[researcher], tasks=[task])result = crew.kickoff()print(result)How it works
Section titled “How it works”The integration wraps Lightcone’s browser actions into a CrewAI BaseTool. When a CrewAI agent decides it needs to visit a website, it calls the tool, which:
- Creates a Lightcone browser session
- Navigates to the URL
- Takes a screenshot and returns the URL
- Terminates the session
You can extend the tool to support more actions (clicking, typing, form filling) based on your workflow needs.
Resources
Section titled “Resources”See also
Section titled “See also”- LangChain — document loader and browser tool for LangChain
- Vercel AI SDK — Lightcone tools for TypeScript agents
- Run an agent — use Lightcone’s built-in agent instead