Skip to content
Dashboard
Integrations

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.

Terminal window
pip install crewai tzafon
from crewai import Agent, Task, Crew
from crewai.tools import BaseTool
from 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 tool
researcher = 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)

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:

  1. Creates a Lightcone browser session
  2. Navigates to the URL
  3. Takes a screenshot and returns the URL
  4. Terminates the session

You can extend the tool to support more actions (clicking, typing, form filling) based on your workflow needs.

  • 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