An autonomous agent that searches the web, scrapes articles, and synthesizes 10-page research reports on any topic.
Initialize a Python environment and install the necessary agentic frameworks.
Open Python / LangChainpip install langchain-anthropic langchain-community tavily-python python-dotenv
touch agent.py .envGive the agent the ability to search the web and scrape pages.
Open Tavilyfrom langchain_community.tools.tavily_search import TavilySearchResults
from langchain_community.document_loaders import WebBaseLoader
search_tool = TavilySearchResults(max_results=5)
def scrape_webpage(url: str):
loader = WebBaseLoader(url)
return loader.load()[0].page_content
tools = [search_tool, scrape_webpage]Instruct the agent to think step-by-step and use its tools iteratively.
Open ClaudeYou are an expert Research Analyst.
Given a topic, you must:
1. Search the web for recent, highly credible sources.
2. Scrape the full content of the most relevant URLs.
3. Synthesize the findings into a comprehensive, deeply technical 10-page report using Markdown.
You have access to the following tools: {tool_names}
Use them wisely. Always cite your sources.