
In this blog post, I’ll walk you through how I built a lightweight AI-powered research assistant that takes a query, searches the web, scrapes articles, summarizes them using NLP, and generates a clean markdown report — all inside a simple Streamlit interface.
🧠 What It Does
This tool acts like your mini research buddy:
- You enter a topic (like “History of AI” or “Benefits of Meditation”)
- It uses SerpAPI to search Google
- Scrapes the top 3 pages using BeautifulSoup
- Uses Hugging Face Transformers to summarize the text
- Compiles a clean Markdown report
- You can download the report or preview it directly in the UI
🛠️ Tech Stack
| Tool | Purpose |
|---|---|
Streamlit | Frontend + interface |
SerpAPI | Google search integration |
BeautifulSoup | Web scraping |
Transformers | BART model for summarization |
dotenv | API key management |
🔍 Why I Built It
I’m passionate about building AI tools that are not only smart but actually useful in everyday learning, productivity, and automation. This assistant is designed for students, researchers, and curious learners who want quick research summaries on any topic.
💡 How It Works
- User inputs a topic (e.g. “History of Artificial Intelligence”)
- The app uses SerpAPI to fetch top 3 Google links
- Each page is scraped using BeautifulSoup
- Text is passed into the Hugging Face summarizer pipeline (
facebook/bart-large-cnn) - The results are compiled into a readable markdown report
- The user can preview and download the report
🚀 Live Demo
⚠️ PDF support is disabled on the hosted version due to file size limits.
🧪 Run It Locally
🧬 Step 1: Clone the Repository
git clone https://github.com/aalexandros47/ai-projects.git
cd ai-projects/ai-research-assistant
⚙️ Step 2: Set up Virtual Environment
# Windows
python -m venv venv
.\venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activate
📦 Step 3: Install Dependencies
pip install -r requirements.txt
🔐 Step 4: Add SerpAPI Key
Create a .env file with this:
SERPAPI_KEY=your_actual_serpapi_key
You can get a free key at serpapi.com
🚀 Step 5: Run the App
streamlit run app.py
Visit http://localhost:8501 in your browser.
🧾 Sample Markdown Output
# Research Summary: History of Artificial Intelligence
## Source: https://en.wikipedia.org/wiki/History_of_artificial_intelligence
The study of logic and formal reasoning from antiquity to the present led directly to the invention of the programmable digital computer...
## Source: https://www.ibm.com/think/topics/history-of-artificial-intelligence
Humans have dreamed of creating thinking machines from ancient times. GPT-3 was a landmark moment in AI...
📚 What I Learned
- 🌱 Handling APIs securely with
dotenv - 📎 Managing NLP token length and model constraints
- 🧽 Cleaning and scraping messy HTML content
- 🧠 Using
transformerspipelines effectively - 🎯 Building clean, focused interfaces with Streamlit
🧠 Final Thoughts
This was one of my favorite projects — simple yet powerful. It’s a great starter project to explore AI + automation in a practical, useful way.
You can fork it, extend it, or deploy your own version.
💬 Questions? Reach out via GitHub or email me.
Keep shipping cool things that save people time and boost their learning.