CoolFace
Apppublic

Amna2568/Research_Forge

sourceHugging Facemitupdated 10mo agoView on Hugging Face
0likes
App README

๐Ÿš€ 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:

  1. 1.๐Ÿ“„ Paper Collection - Automatically gathers 10-15 research papers from arXiv, Google Scholar, and ClinicalTrials.gov
  2. 2.๐Ÿ“š Literature Review - Generates comprehensive academic review using GPT-3.5-turbo
  3. 3.๐Ÿ” Gap Analysis - Identifies research gaps using dual AI models (Flan-T5-Large + GPT-4)
  4. 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

bash
git clone https://github.com/Radia-987/ResearchForge.git
cd ResearchForge

Step 2: Create Virtual Environment

Windows:

bash
python -m venv venv
.\venv\Scripts\activate

macOS/Linux:

bash
python3 -m venv venv
source venv/bin/activate

Step 3: Install Dependencies

bash
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:

bash
# Windows
notepad .env

# macOS/Linux
nano .env

Add your API keys:

env
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:

bash
pip list

You should see:

  • โ€”streamlit==1.31.0
  • โ€”openai==1.12.0
  • โ€”transformers>=4.41.0
  • โ€”torch>=2.1.0
  • โ€”sentence-transformers>=5.0.0

โ–ถ๏ธ Running the Application

Start the Streamlit App:

bash
streamlit run app.py

Expected Output:

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501
Network URL: http://192.168.x.x:8501

Open 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

  1. 1.Enter Research Topic
  2. 2.Example: "federated learning privacy"
  3. 3.Example: "machine learning for drug discovery"
  1. 1.Click "๐Ÿš€ Start Complete Analysis"
  1. 1.Wait 2-3 minutes (progress shown in terminal)
  1. 1.View Results in 3 Tabs:
  2. 2.๐Ÿ“š Literature Review
  3. 3.๐Ÿ” Gap Analysis
  4. 4.๐Ÿ’ก Research Hypotheses
  5. 5.๐Ÿงช Experiment Design

๐Ÿ“Š What Gets Downloaded

On first run, the following models are automatically downloaded:

ModelSizePurpose
google/flan-t5-large3.13 GBGap analysis (local)
sentence-transformers/all-MiniLM-L6-v280 MBNovelty scoring

Total: ~3.2 GB (stored in ~/.cache/huggingface/)


๐Ÿ”‘ API Costs

Estimated costs per complete analysis:

ServiceCost per Analysis
OpenAI GPT-3.5 (Literature Review)~$0.02
OpenAI GPT-4 (Gap Analysis)~$0.15
OpenAI GPT-4 (Hypothesis Generation)~$0.25
Google Custom SearchFree (100/day)
arXiv APIFree
ClinicalTrials.gov APIFree
Total~$0.42

๐Ÿงช Testing the Setup

Quick Test:

bash
python -c "from multi_agent_system import MultiAgentSystem; print('โœ… Import successful!')"

Check OpenAI Connection:

bash
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:

bash
pip install -r requirements.txt

Issue: `OPENAI_API_KEY not found`

Solution:

  • โ€”Ensure .env file exists in project root (same folder as app.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:

bash
pip uninstall httpx
pip install httpx==0.24.1

Issue: Model download fails or hangs

Solution:

bash
pip install --upgrade transformers torch sentence-transformers

Or manually clear cache and retry:

bash
# Windows
rmdir /s /q %USERPROFILE%\.cache\huggingface

# macOS/Linux
rm -rf ~/.cache/huggingface

Issue: `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:

bash
# 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:

  1. 1.โœ… Test with a simple query (e.g., "machine learning")
  2. 2.โœ… Review the generated literature review
  3. 3.โœ… Examine the identified research gaps
  4. 4.โœ… Explore the generated hypotheses
  5. 5.โœ… 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!