An AI-powered Research Assistant built using Groq API, Llama 3.3, and LangChain that autonomously researches topics by searching the web, reading webpages, and generating structured research reports using tool-calling AI agents.
Instead of answering solely from the LLM's knowledge, the agent dynamically decides when to use external tools, retrieves up-to-date information from the web, and synthesizes information into professional markdown reports.
This project demonstrates the fundamentals of AI Agents, Tool Calling, LLM Orchestration, Prompt Engineering, and Web-Augmented Generation.
- π AI Agent with Tool Calling
- π DuckDuckGo Web Search Integration
- π Automatic Webpage Reading
- π§Ή HTML Content Extraction using BeautifulSoup
- π€ Groq + Llama 3.3 Integration
- π§ Prompt Engineering
- π Multi-Step Agent Reasoning Loop
- π Professional Markdown Report Generation
- π Automatic Report Saving
- β‘ Ultra-fast Inference using Groq
- π Secure API Key Management using Environment Variables
- ποΈ Modular Production-Style Project Structure
User Query
β
βΌ
Llama 3.3 (Groq)
β
Determines Required Tool
β
ββββββββββββββββββ΄ββββββββββββββββββ
βΌ βΌ
DuckDuckGo Search Tool Read Webpage Tool
β β
ββββββββββββββββββ¬ββββββββββββββββββ
βΌ
Tool Execution
β
βΌ
Tool Observations
β
βΌ
LLM Reasoning Loop
β
βΌ
Professional Research Report
β
βΌ
Markdown File (.md)
research-assistant/
β
βββ app.py # Entry point
βββ agent.py # Agent reasoning loop
βββ llm.py # Groq model configuration
βββ prompts.py # Prompt templates
βββ tools.py # AI tools
β
βββ utils/
β βββ scraper.py # Webpage reader
β βββ report.py # Markdown report generator
β
βββ outputs/ # Generated reports
β
βββ requirements.txt
βββ .env.example
βββ .gitignore
βββ README.md
| Component | Technology |
|---|---|
| Language | Python |
| LLM Provider | Groq API |
| Model | Llama 3.3 70B Versatile |
| Framework | LangChain |
| Agent Pattern | Tool Calling |
| Search Engine | DuckDuckGo |
| Web Scraping | BeautifulSoup + Requests |
| Output | Markdown Report |
| Environment Variables | python-dotenv |
git clone https://github.com/your-username/research-assistant.git
cd research-assistantpython -m venv venvvenv\Scripts\activatesource venv/bin/activatepip install -r requirements.txtCreate a .env file.
GROQ_API_KEY=your_groq_api_keypython app.pyExample:
Research Topic:
AI Agents
The application automatically:
- Searches the web
- Reads relevant webpages
- Extracts useful content
- Performs multi-step reasoning
- Generates a professional markdown research report
- User enters a research topic.
- The LLM determines whether external knowledge is required.
- The AI agent calls the Web Search tool.
- Search results are returned.
- The AI agent decides which webpages to read.
- HTML content is cleaned and converted into plain text.
- Tool observations are returned to the LLM.
- The reasoning loop continues until sufficient information has been gathered.
- The LLM generates a structured research report.
- The report is saved as a Markdown file.
Building autonomous LLM applications capable of reasoning and interacting with external tools.
Allowing LLMs to dynamically decide which tools to invoke during problem solving.
Implementing iterative reasoning using the cycle:
Think β Tool β Observation β Think β Answer
Combining real-time web search with LLM reasoning to produce current and factual responses.
Extracting clean textual content from webpages using BeautifulSoup.
Designing prompts that guide the LLM to generate structured, high-quality research reports.
Automatically exporting research findings into reusable Markdown documents.
Separating the application into independent modules for tools, prompts, agent logic, LLM configuration, and utilities.
- π§ Multi-Agent Research System
- π Tavily Search Integration
- π PDF Export
- π DOCX Export
- π― Research Planning Agent
- π§ Memory for Previous Research
- π Multi-language Support
- π Research Quality Evaluation
- β‘ Streaming Responses
- βοΈ FastAPI REST API
- π³ Docker Support
- βοΈ Cloud Deployment (Render / AWS)
- Webpages may block scraping.
- Research quality depends on publicly available information.
- No persistent memory between sessions.
- Limited by the LLM context window for very large webpages.
After completing this project, you will understand:
- AI Agent Architecture
- Tool Calling
- LangChain Tools
- Agent Loops
- Groq API Integration
- Web Search Integration
- Web Scraping
- Prompt Engineering
- Markdown Report Generation
- Modular AI Application Design
- Production-Ready Project Organization
Contributions are welcome!
Possible improvements:
- Better planning strategies
- Additional search providers
- Improved prompts
- Better error handling
- More export formats
- Memory support
- Multi-agent workflows
- Groq for ultra-fast LLM inference
- Meta for the Llama models
- LangChain for agent abstractions
- DuckDuckGo for web search
- BeautifulSoup for HTML parsing
Built as a hands-on learning project while exploring Generative AI, AI Agents, Tool Calling, Prompt Engineering, LLM Applications, and Production-Ready AI Systems.