An autonomous AI agent that researches any topic by searching the web, extracting content from multiple sources, and generating a structured research report — all powered by Groq LLM and Tavily Search API.
- 🔍 Real-time web search using Tavily API
- 📄 Multi-source content extraction with BeautifulSoup
- 🤖 AI summarization of each source using Groq LLM
- 🧠 Iterative thinking — agent decides follow-up searches autonomously
- 📝 Structured markdown report with Introduction, Key Findings, Analysis, Conclusion
- 🔗 Full source citation for every piece of information
- 📥 Export report as TXT or PDF
- 💻 Clean Streamlit UI with live agent thinking process
- Python — Pure Python agent logic, no frameworks
- Groq API — LLM provider (llama-3.3-70b-versatile)
- Tavily API — Real-time web search
- BeautifulSoup4 — Web content extraction
- Streamlit — User interface
- fpdf2 — PDF export
- Clone the repository
git clone https://github.com/zainaliqureshi174/ai-research-agent.git
cd ai-research-agent- Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Create a
.envfile in the root directory
GROQ_API_KEY=your_groq_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here
- Run the app
streamlit run app.pyai-research-agent/
│
├── .env # API keys (not included)
├── requirements.txt # Dependencies
├── app.py # Streamlit UI
│
├── agent/
│ ├── research_agent.py # Core agent logic
│ ├── tools.py # Web search + content extraction
│ ├── summarizer.py # Groq LLM summarization
│ └── report_generator.py # Report builder
│
└── utils/
└── export.py # PDF and TXT export
- Get your free Groq API key at console.groq.com
- Get your free Tavily API key at app.tavily.com