An AI-powered research agent that searches the web, analyzes multiple sources, and generates structured research reports using LangGraph.
Enter a research topic and let the agent search the web with Tavily, synthesize the results with GPT-4o-mini, and return a clear report with summaries, key findings, and sources.
The Web Research Agent automates the research process by combining web search with AI-powered synthesis.
Instead of manually searching multiple websites and organizing information, simply provide a research query and let the agent gather and summarize relevant information.
Research Query → Web Search → Source Collection → AI Synthesis → Research Report
-
🔍 Web Search Search the web for relevant information using Tavily.
-
🧠 AI-Powered Research Use GPT-4o-mini to analyze and synthesize search results.
-
🔗 LangGraph Workflow Organize the research process using a structured agent workflow.
-
📄 Structured Reports Generate reports with:
- Summary
- Key Findings
- Sources
-
🎯 Custom Research Queries Research any topic directly from the command line.
-
⚡ Simple CLI Interface Start researching with a single command.
flowchart LR
A[User Research Query] --> B[Search Node]
B --> C[Tavily Web Search]
C --> D[Search Results]
D --> E[Synthesize Node]
E --> F[GPT-4o-mini]
F --> G[Structured Research Report]
- The user provides a research query.
- The Search Node sends the query to Tavily.
- Tavily retrieves relevant web results.
- The Synthesize Node processes the search results.
- GPT-4o-mini analyzes the information.
- The agent generates a structured research report.
| Technology | Purpose |
|---|---|
| Python | Core application language |
| LangGraph | Agent workflow orchestration |
| GPT-4o-mini | Research synthesis |
| OpenAI | Large Language Model provider |
| Tavily | Web search and research retrieval |
git clone https://github.com/your-username/your-repository.git
cd your-repositorypip install -r requirements.txtCreate your environment file:
cp .env.example .envAdd your API keys:
OPENAI_API_KEY=your_openai_api_key
TAVILY_API_KEY=your_tavily_api_keyYou will need:
- OpenAI API Key for AI-powered research synthesis
- Tavily API Key for web search
Tavily provides a free tier for getting started.
python agent.pypython agent.py \
--query "latest advances in quantum computing"What are the latest advances in AI agents?
What are the current trends in cybersecurity?
What are the latest advances in quantum computing?
Compare LangGraph, CrewAI, and AutoGen.
What are the latest developments in large language models?
🔍 Researching: latest advances in AI agents 2024
============================================================
📄 RESEARCH REPORT
============================================================
## Summary
AI agents have seen significant advances in reasoning,
tool use, and multi-agent collaboration.
## Key Findings
- Agent frameworks are increasingly being used for production workflows.
- LLMs are improving their ability to use external tools.
- Multi-agent systems are becoming more capable of handling complex tasks.
## Sources
- https://example.com
- https://example.com
User Query
↓
Search Node
↓
Tavily Web Search
↓
Search Results
↓
Synthesize Node
↓
GPT-4o-mini
↓
Structured Research Report
.
├── agent.py
├── requirements.txt
├── .env.example
├── .gitignore
└── README.md
This project can serve as a foundation for:
- AI-powered research assistants
- Market research tools
- Competitive intelligence systems
- News and trend analysis
- Academic research assistants
- Business intelligence platforms
- Automated research reporting
- Add a web interface with Streamlit or Next.js
- Support multi-step research workflows
- Add source credibility scoring
- Add citation validation
- Support PDF and document research
- Add research history and persistence
- Implement multi-agent research workflows
- Add export to Markdown and PDF
- Add parallel web search across multiple sources
Never commit your API keys to GitHub.
Make sure .env is included in .gitignore:
.env
Use environment variables to securely manage your API credentials.
If you find this project useful, consider giving it a ⭐ on GitHub.