Saleh
Remove sdk_version to force dependency install from requirements.txt
73386ad
---
title: AI Research Paper Analyst
emoji: πŸ”¬
colorFrom: blue
colorTo: indigo
sdk: gradio
python_version: "3.10"
app_file: app.py
pinned: false
license: mit
---
# πŸ”¬ AI Research Paper Analyst
Automated Peer-Review System powered by Multi-Agent AI (CrewAI + GPT-4o).
## πŸš€ Features
- **Multi-Agent Pipeline**: 7 agents (1 safety gate + 6 analysis) review methodology, novelty, and quality.
- **Programmatic Safety**: Deterministic guardrails for PII redaction, prompt injection detection, and malicious URL blocking (regex/logic-based β€” no LLM).
- **Structured Output**: All agent outputs enforced via Pydantic schemas.
- **15-Point Rubric**: Binary quality scoring with automatic enhancement for failed criteria.
- **Interactive UI**: Gradio interface with 6 tabs, real-time progress tracking, and report export.
## πŸ› οΈ Agents
1. **Safety Guardian** β€” Programmatic gate that blocks unsafe documents (no LLM).
2. **Paper Extractor** (GPT-4o) β€” Structures raw text into metadata, methodology, findings.
3. **Methodology Critic** (GPT-4o-mini) β€” Evaluates study design, reproducibility, bias risks.
4. **Relevance Researcher** (GPT-4o-mini) β€” Checks novelty via Semantic Scholar / OpenAlex.
5. **Review Synthesizer** (GPT-4o-mini) β€” Drafts the initial peer-review report.
6. **Rubric Evaluator** (GPT-4o-mini) β€” Scores against 15 strict binary criteria.
7. **Enhancer** (GPT-4o-mini) β€” Polishes the final output into a publication-ready report.
## πŸ”§ Tools
| Tool | Purpose |
|---|---|
| `pdf_parser` | Extract text from PDF (pdfplumber) |
| `pii_detector` | Detect & redact PII (emails, SSNs, phones, credit cards) |
| `injection_scanner` | Detect 9 prompt-injection patterns |
| `url_validator` | Blocklist check for malicious URLs |
| `citation_search` | Search Semantic Scholar / OpenAlex for related papers |
## πŸ“š How to Use
### Prerequisites
- Python 3.10+
- OpenAI API key with GPT-4o access
### Setup & Run
```bash
# 1. Install dependencies
pip install -r requirements.txt
# 2. Create .env file with your API key
echo "OPENAI_API_KEY=your-key-here" > .env
# 3. Launch the app
python app.py
```
Open **http://localhost:7860** in your browser, upload a PDF, and click **"Analyze Paper"**.
### On HuggingFace Spaces
Add `OPENAI_API_KEY` as a **Secret** in Space Settings.
## πŸ“ Project Structure
```
β”œβ”€β”€ app.py # Main pipeline + Gradio UI
β”œβ”€β”€ agents/ # 6 CrewAI agent definitions
β”œβ”€β”€ tools/ # 5 custom tool implementations
β”œβ”€β”€ schemas/models.py # 8 Pydantic output schemas
β”œβ”€β”€ requirements.txt # Python dependencies
β”œβ”€β”€ walkthrough.md # Detailed project walkthrough
└── PROJECT_DOCUMENTATION.md # Full technical documentation
```
## πŸ”‘ Environment Variables
| Variable | Required | Purpose |
|---|---|---|
| `OPENAI_API_KEY` | Yes | OpenAI API access (GPT-4o required) |
---
*Homework 5 β€” Agentic AI Bootcamp*