A multi-source research agent built with LangGraph that searches Google, Bing, and Reddit to gather and synthesize information on any topic.
This agent performs parallel web searches across multiple platforms, retrieves relevant Reddit discussions with comments, and uses an LLM to analyze and synthesize the findings into a comprehensive answer.
- Parallel Search - Simultaneously searches Google, Bing, and Reddit for the user's query
- Reddit Deep Dive - Analyzes Reddit search results and retrieves full post comments from relevant discussions
- Multi-Source Analysis - Independently analyzes results from each source (Google, Bing, Reddit)
- Synthesis - Combines all analyses into a final, comprehensive answer
- LangGraph - Orchestrates the agent workflow as a directed graph
- LangChain - LLM integration (GPT-4)
- Bright Data - Web scraping API for SERP results and Reddit data
- Python 3.12+
- uv (recommended) or pip
- OpenAI API key
- Bright Data API key
-
Clone the repository:
git clone https://github.com/yourusername/researchAgent.git cd researchAgent -
Install dependencies:
uv sync
-
Create a
.envfile with your API keys:OPENAI_API_KEY=your_openai_api_key BRIGHTDATA_API_KEY=your_brightdata_api_key
uv run python main.pyThen type your research question at the prompt.
For a visual interface with graph visualization and debugging:
-
Install the LangGraph CLI (included in dependencies):
uv pip install langgraph-cli langgraph-api
-
Launch LangGraph Studio:
uv run langgraph dev
-
Open the provided URL in your browser to interact with the agent visually.
researchAgent/
├── main.py # Main agent graph definition and CLI
├── web_operations.py # Google, Bing, and Reddit search functions
├── snapshot_operations.py # Bright Data snapshot polling/download
├── prompts.py # LLM prompts for analysis
├── langgraph.json # LangGraph Studio configuration
└── .env # API keys (not tracked)
This project was built following the tutorial by @TechWithTim:
How to Build an Advanced AI Agent with Search (LangGraph, Python, Bright Data & More)
MIT
