AI agent that researches any topic — PubMed + Semantic Scholar for academic papers, DuckDuckGo for web. Multi-round autonomous research with structured Markdown reports.
Built with Python + GLM-5.2 LLM. Part of my AI Agent Career Portfolio.
- 🔬 Scholarly + Web Research — Auto-detects academic topics → uses PubMed & Semantic Scholar. General topics → DuckDuckGo web search.
- 🔄 Multi-round agent loop — Generates diverse queries → searches → extracts → synthesizes → refines based on gaps
- 📊 Structured reports — Executive Summary, Key Findings, Detailed Analysis, Controversies, Practical Implications, Sources
- 🎨 Beautiful CLI — Rich formatting with live progress panels
- ⚙️ Configurable — Rounds, max results, temperature, sources
Topic → [LLM: Generate queries] → [Is it academic?]
├─ Yes → PubMed + Semantic Scholar
└─ No → DuckDuckGo web search
↓
[Extract abstracts/content]
↓
[LLM: Synthesize round]
↓
[Refine queries from gaps]
↓
[Generate structured report]
git clone https://github.com/Meshkat22/research-agent.git
cd research-agent
pip install -r requirements.txt
# Academic research (auto-uses PubMed + Semantic Scholar)
python main.py -t "BCI motor imagery CNN Transformer hybrid architectures" -r 1
# General research (auto-uses DuckDuckGo)
python main.py -t "AI agent job market trends 2026" -r 2 -o report.md
# Verbose debug mode
python main.py -t "Quantum computing 2026" --verbose| Layer | Technology |
|---|---|
| LLM | GLM-5.2 (OpenAI-compatible) |
| Academic Search | PubMed Entrez API + Semantic Scholar |
| Web Search | DuckDuckGo |
| Content Extraction | trafilatura + BeautifulSoup fallback |
| CLI | rich |
| Language | Python 3.9+ |
research_agent/
├── main.py # CLI entry point
├── agent.py # ResearchAgent class (orchestration)
├── scholarly_tools.py # PubMed + Semantic Scholar integration
├── tools.py # DuckDuckGo web search + scraping
├── config.py # LLM, agent, PubMed configuration
├── requirements.txt # Dependencies
└── README.md
This project demonstrates:
- Agent Loop Design — Multi-step autonomous research cycle
- Tool Selection — Auto-detects academic vs web-appropriate sources
- API Integration — PubMed, Semantic Scholar, DuckDuckGo, OpenAI-compatible
- Prompt Engineering — Query generation, synthesis, structured reporting
- Error Resilience — Graceful degradation when APIs fail (LLM knowledge fallback)
- Clean Architecture — Separated concerns, configurable, testable
- Streamlit web UI
- SerpAPI fallback for web search
- Europe PMC / OpenAlex integration
- PDF report output
- LangFuse observability
- Source claim verification
Built by Meshkat Ahmad — AI Agent Career Portfolio Project 1/7