Amna2568/Research_Forge
๐ ResearchForge - Setup & Installation Guide
๐ Overview
ResearchForge is an AI-powered research assistant that automates literature review, gap analysis, and hypothesis generation. This guide will help you get the project running on your local machine.
๐ฏ What This Project Does
ResearchForge performs a complete 4-phase research analysis pipeline:
- ๐ Paper Collection - Automatically gathers 10-15 research papers from arXiv, Google Scholar, and ClinicalTrials.gov
- ๐ Literature Review - Generates comprehensive academic review using GPT-3.5-turbo
- ๐ Gap Analysis - Identifies research gaps using dual AI models (Flan-T5-Large + GPT-4)
- ๐ก Hypothesis Generation - Creates actionable research proposals with novelty scoring
Time savings: What takes researchers weeks โ Done in 2-3 minutes
โ๏ธ System Requirements
- Python: 3.11 or higher
- RAM: 16GB minimum (for Flan-T5-Large model)
- Storage: 5GB free space (for AI models)
- OS: Windows, macOS, or Linux
- Internet: Required for API calls and model downloads
๐ ๏ธ Prerequisites
Before starting, you'll need:
1. OpenAI API Key (Required)
- Sign up at: https://platform.openai.com/
- Create API key at: https://platform.openai.com/api-keys
- Cost: ~$0.42 per complete analysis
2. Google Custom Search API (Required)
- Create project at: https://console.cloud.google.com/
- Enable Custom Search API
- Create credentials: https://developers.google.com/custom-search/v1/introduction
- Create Custom Search Engine: https://programmablesearchengine.google.com/
- Cost: Free tier (100 queries/day)
3. HuggingFace Token (Optional)
- Sign up at: https://huggingface.co/
- Get token at: https://huggingface.co/settings/tokens
- Used for: Faster model downloads (optional)
๐ฆ Installation Steps
Step 1: Clone the Repository
git clone https://github.com/Radia-987/ResearchForge.git
cd ResearchForgeStep 2: Create Virtual Environment
Windows:
python -m venv venv
.\venv\Scripts\activatemacOS/Linux:
python3 -m venv venv
source venv/bin/activateStep 3: Install Dependencies
pip install -r requirements.txtโณ Note: First run will download ~3.5GB of AI models:
- Flan-T5-Large (3.13 GB)
- Sentence-BERT (80 MB)
- This is a one-time download
Step 4: Configure API Keys
Create a .env file in the project root directory:
# Windows
notepad .env
# macOS/Linux
nano .envAdd your API keys:
OPENAI_API_KEY=sk-proj-xxxxxxxxxxxxxxxxxxxx
GOOGLE_API_KEY=AIzaSyxxxxxxxxxxxxxxxxxx
GOOGLE_SEARCH_ENGINE_ID=xxxxxxxxxxxxxxxxxxxx
HF_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxโ ๏ธ Important: Never commit this file to Git (it's already in .gitignore)
Step 5: Verify Installation
Check that all dependencies are installed:
pip listYou should see:
streamlit==1.31.0openai==1.12.0transformers>=4.41.0torch>=2.1.0sentence-transformers>=5.0.0
โถ๏ธ Running the Application
Start the Streamlit App:
streamlit run app.pyExpected Output:
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://192.168.x.x:8501Open in Browser:
The app will automatically open at http://localhost:8501
If it doesn't, manually navigate to the URL shown in the terminal.
๐จ Using the Application
- Enter Research Topic
- Example: "federated learning privacy"
- Example: "machine learning for drug discovery"
- Click "๐ Start Complete Analysis"
- Wait 2-3 minutes (progress shown in terminal)
- View Results in 3 Tabs:
- ๐ Literature Review
- ๐ Gap Analysis
- ๐ก Research Hypotheses
- ๐งช Experiment Design
๐ What Gets Downloaded
On first run, the following models are automatically downloaded:
Total: ~3.2 GB (stored in ~/.cache/huggingface/)
๐ API Costs
Estimated costs per complete analysis:
๐งช Testing the Setup
Quick Test:
python -c "from multi_agent_system import MultiAgentSystem; print('โ
Import successful!')"Check OpenAI Connection:
python -c "from dotenv import load_dotenv; from openai import OpenAI; import os; load_dotenv(); client = OpenAI(api_key=os.getenv('OPENAI_API_KEY')); print('โ
OpenAI connected!')"๐ง Troubleshooting
Issue: `ModuleNotFoundError: No module named 'streamlit'`
Solution:
pip install -r requirements.txtIssue: `OPENAI_API_KEY not found`
Solution:
- Ensure
.envfile exists in project root (same folder asapp.py) - Check API key format:
OPENAI_API_KEY=sk-proj-... - Restart the Streamlit app after creating
.env
Issue: `httpx.ConnectError` or API connection fails
Solution:
pip uninstall httpx
pip install httpx==0.24.1Issue: Model download fails or hangs
Solution:
pip install --upgrade transformers torch sentence-transformersOr manually clear cache and retry:
# Windows
rmdir /s /q %USERPROFILE%\.cache\huggingface
# macOS/Linux
rm -rf ~/.cache/huggingfaceIssue: `Out of Memory` when loading Flan-T5
Solution:
- Ensure you have 16GB+ RAM
- Close other applications
- If still failing, the model will automatically fall back to GPT-4 only
Issue: Streamlit won't start
Solution:
# Check if Streamlit is installed
streamlit --version
# Reinstall Streamlit
pip uninstall streamlit
pip install streamlit==1.31.0
# Try running from project directory
cd ResearchForge
streamlit run app.py๐ Project Structure
ResearchForge/
โโโ app.py # Streamlit web interface
โโโ multi_agent_system.py # Core logic (1932 lines)
โโโ requirements.txt # Python dependencies
โโโ .env # API keys (create this)
โโโ .gitignore # Git ignore rules
โโโ README.md # Project documentation
โโโ PROJECT_DOCUMENTATION.md # Detailed technical docs
โโโ images/ # Architecture diagrams๐ค Support
Issues? Open an issue at: https://github.com/Radia-987/ResearchForge/issues
Questions? Check the detailed documentation: PROJECT_DOCUMENTATION.md
๐ฏ Next Steps
After successful installation:
- โ Test with a simple query (e.g., "machine learning")
- โ Review the generated literature review
- โ Examine the identified research gaps
- โ Explore the generated hypotheses
- โ Check experiment design suggestions
๐ License
This project is open source and available for educational and research purposes.
๐ Acknowledgments
AI Models Used:
- OpenAI GPT-4 & GPT-3.5-turbo
- Google Flan-T5-Large
- Sentence-BERT (all-MiniLM-L6-v2)
Data Sources:
- arXiv API
- Google Custom Search
- ClinicalTrials.gov
๐ You're ready to start! Run `streamlit run app.py` and explore AI-powered research analysis!
