Skip to content

An intelligent research discovery platform that automatically crawls ArXiv papers, generates multimodal embeddings, and delivers personalized recommendations through advanced vector search and machine learning-driven user preference modeling.

License

Notifications You must be signed in to change notification settings

aymen-000/PaperLens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฌ ArXiv PaperLens: Intelligent Research Paper Discovery System

Python 3.9+

React License: MIT

An AI-powered research assistant that learns your preferences and delivers personalized ArXiv paper recommendations

๐Ÿ“บ Demo Video


๐ŸŒŸ Overview

ArXiv PaperLens is a sophisticated RAG (Retrieval-Augmented Generation) system that revolutionizes how researchers discover and interact with academic papers. Using advanced machine learning techniques, it creates personalized research experiences by understanding user preferences through implicit and explicit feedback mechanisms.

โœจ Key Features

  • ๐Ÿค– Intelligent Paper Discovery: Daily ArXiv crawling with ML-powered recommendations
  • ๐Ÿง  Multimodal RAG Chat: Converse with papers using text and images via Google Gemini Pro
  • ๐Ÿ“Š Advanced User Profiling: Dynamic embedding updates using exponential moving average algorithms
  • ๐ŸŽฏ Personalized Recommendations: Adaptive scoring system based on user interaction patterns
  • ๐Ÿ” Semantic Search: FAISS-powered vector similarity search across 100k+ papers
  • ๐Ÿ“ฑ Multi-Channel Notifications: Email digests and Telegram bot integration
  • ๐ŸŽจ Modern UI: Responsive React frontend with real-time interactions

๐Ÿ—๏ธ System Architecture

graph TB
    subgraph "Data Layer"
        A[ArXiv API] --> B[Daily Crawler Agent]
        B --> C[PDF Processing]
        C --> D[Text & Image Extraction]
        D --> E[Vector Database<br/>FAISS Index]
    end
    
    subgraph "AI Layer"
        F[Multimodal Embedder<br/>CLIP + BGE] --> G[User Embedding Service]
        G --> H[Recommendation Engine<br/>Exponential Moving Average]
        I[Gemini Pro RAG Agent] --> J[Multimodal Q&A]
    end
    
    subgraph "Application Layer"
        K[Backend] --> L[React Frontend]
        M[LangGraph Agents] --> N[Notification Service<br/>Email + Telegram]
    end
    
    E --> I
    E --> H
    G --> K
    H --> K
    J --> L
    N --> L
Loading

๐Ÿงฎ Mathematical Foundation

User Embedding Update Algorithm

The system employs an Exponential Moving Average (EMA) approach for updating user embeddings:

E_new = (1 - ฮฑ) ร— E_current + ฮฑ ร— E_weighted_papers

Where:

  • ฮฑ: Learning rate (default: 0.1)
  • E_weighted_papers: Weighted average of paper embeddings based on interaction types
  • Interaction weights: Like(+1.0), Bookmark(+0.8), Share(+0.6), View(+0.1), Dislike(-0.5), Delete(-0.9)

Temporal Decay Mechanism

E_decayed = E ร— (decay_factor^(days_since_update/30))

This ensures recent preferences have higher influence while preventing embedding staleness.

Relevance Scoring

Paper relevance is computed using cosine similarity:

relevance = (cosine_similarity(E_user, E_paper) + 1) / 2

Normalized to [0,1] range for intuitive scoring.

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.9+
  • Node.js 16+ (for React frontend)
  • Google API Key (Gemini Pro)
  • PostgreSQL (for metadata storage)
  • Docker (optional deployment)

Installation

  1. Clone and Setup

    git clone https://github.com/aymen-000/PaperLens
    cd Paperlans
    
    # Install Python dependencies
    pip install -r requirements.txt
    # or using uv (recommended)
    uv sync
  2. Environment Configuration

    # Create .env file
    cat > .env << EOF
    GOOGLE_API_KEY = "your_key"
    CRAWLER_AGENT_MODEL_ID="gemini-2.5-flash"
    PROVIDER = "langchain_google_genai.ChatGoogleGenerativeAI"
    HUGGINGFACE_TOKEN_KEY = "your_token"
    JWT_SECRET_KEY = "your_key"
  3. Database Initialization

    python scripts/init_db.py
    python scripts/seed_user.py
  4. Start Services

    # Terminal 1: Backend API
    source .venv/bin/activate
    export PYTHONAPATH=.
    python3 backend/app/app.py
    
    # Terminal 2: Frontend (separate terminal)
    npm install 
    npm run dev
    
  5. Access Application

๐Ÿ› ๏ธ Technology Stack

Backend

  • Flask: High-performance async web framework
  • LangChain: LLM orchestration and document processing
  • LangGraph: Agent workflow management
  • FAISS: Vector similarity search (Facebook AI)
  • PostgreSQL: Metadata and user data storage
  • SQLAlchemy: Database ORM

AI/ML Components

  • Google Gemini Pro: Multimodal language model
  • CLIP (OpenAI): Image-text understanding
  • BGE Embeddings: Semantic text embeddings
  • Sentence Transformers: Text encoding
  • PyTorch: Deep learning framework

Frontend

  • React: Modern UI framework
  • Tailwind CSS: Utility-first styling
  • Axios: HTTP client

๐Ÿ“Š Project Structure

Paperlens/
โ”œโ”€โ”€ agents/                           # ๐Ÿค– AI Agent System
โ”‚   โ”œโ”€โ”€ system_agents/               # Core intelligent agents
โ”‚   โ”‚   โ”œโ”€โ”€ crawler.py              # ArXiv paper crawler
โ”‚   โ”‚   โ””โ”€โ”€ papers_rag.py           # Multimodal RAG system
โ”‚   โ”œโ”€โ”€ data/                       # Data processing & embeddings
โ”‚   โ”‚   โ”œโ”€โ”€ embedding.py            # User embedding service
โ”‚   โ”‚   โ”œโ”€โ”€ indexing.py             # Vector indexing
โ”‚   โ”‚   โ””โ”€โ”€ vector_db.py            # FAISS operations
โ”‚   โ”œโ”€โ”€ tools/                      # Agent utility tools
โ”‚   โ”‚   โ”œโ”€โ”€ crawler_tools.py        # PDF processing tools
โ”‚   โ”‚   โ””โ”€โ”€ rag_tools.py            # RAG helper functions
โ”‚   โ”œโ”€โ”€ prompts/                    # LLM prompt templates
โ”‚   โ””โ”€โ”€ config.py                   # Agent configurations
โ”‚
โ”œโ”€โ”€ backend/                          # โšก FastAPI Application
โ”‚   โ””โ”€โ”€ app/
โ”‚       โ”œโ”€โ”€ models/                 # Database models
โ”‚       โ”‚   โ”œโ”€โ”€ user.py             # User profiles
โ”‚       โ”‚   โ”œโ”€โ”€ paper.py            # Paper metadata
โ”‚       โ”‚   โ”œโ”€โ”€ user_embedding.py   # User preference vectors
โ”‚       โ”‚   โ””โ”€โ”€ user_feedback.py    # Interaction tracking
โ”‚       โ”œโ”€โ”€ routes/                 # API endpoints
โ”‚       โ”‚   โ”œโ”€โ”€ papers_api.py       # Paper CRUD operations
โ”‚       โ”‚   โ”œโ”€โ”€ papers_bot.py       # RAG chat endpoints
โ”‚       โ”‚   โ””โ”€โ”€ user.py             # User management
โ”‚       โ”œโ”€โ”€ services/               # Business logic
โ”‚       โ”‚   โ”œโ”€โ”€ db_service.py       # Database operations
โ”‚       โ”‚   โ””โ”€โ”€ handle_interaction.py # User feedback processing
โ”‚       โ””โ”€โ”€ database.py             # SQLAlchemy setup
โ”‚
โ”œโ”€โ”€ frontend/                         # ๐ŸŽจ Next.js Application
โ”‚   โ”œโ”€โ”€ app/                        # Next.js App Router
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx                # Dashboard homepage
โ”‚   โ”‚   โ”œโ”€โ”€ login/                  # Authentication pages
โ”‚   โ”‚   โ””โ”€โ”€ signup/
โ”‚   โ”œโ”€โ”€ components/                 # UI components
โ”‚   โ”‚   โ”œโ”€โ”€ paper-feed.tsx          # Paper recommendation feed
โ”‚   โ”‚   โ”œโ”€โ”€ rag-panel.tsx           # Chat interface
โ”‚   โ”‚   โ”œโ”€โ”€ paper-search.tsx        # Search functionality
โ”‚   โ”‚   โ”œโ”€โ”€ settings-page.tsx       # User preferences
โ”‚   โ”‚   โ””โ”€โ”€ ui/                     # Shadcn/UI components
โ”‚   โ””โ”€โ”€ lib/                        # Utilities & API clients
โ”‚
โ”œโ”€โ”€ faiss_index/                      # ๐Ÿ” Vector Database
โ”‚   โ”œโ”€โ”€ text_index.faiss            # Text embeddings (BGE)
โ”‚   โ”œโ”€โ”€ image_index.faiss           # Image embeddings (CLIP)
โ”‚   โ””โ”€โ”€ faiss_index/                # Legacy unified index
โ”‚
โ”œโ”€โ”€ storage/                          # ๐Ÿ“ File Storage
โ”‚   โ”œโ”€โ”€ raw/                        # Original PDF papers
โ”‚   โ”œโ”€โ”€ processed/                  # Extracted content
โ”‚   โ”‚   โ”œโ”€โ”€ images/                 # Figures & diagrams
โ”‚   โ”‚   โ””โ”€โ”€ paper_*/                # Per-paper text & images
โ”‚   โ””โ”€โ”€ papers/                     # Downloaded PDFs
โ”‚
โ””โ”€โ”€ scripts/                          # ๐Ÿ› ๏ธ Utility Scripts
    โ”œโ”€โ”€ init_db.py                  # Database initialization
    โ”œโ”€โ”€ seed_user.py                # Sample user creation
    โ””โ”€โ”€ run_agents.py               # Agent orchestration

๐Ÿค– Intelligent Agents

1. ArXiv Crawler Agent

  • Purpose: Automated daily paper discovery
  • Capabilities:
    • Fetches 50+ papers daily based on user categories
    • PDF text extraction using PyPDF2
    • Figure/diagram extraction using PIL
    • Metadata enrichment and storage

2. Multimodal RAG Agent

  • Purpose: Intelligent Q&A over research papers
  • Capabilities:
    • Text-based semantic search
    • Image understanding and analysis
    • Context-aware response generation
    • Source attribution and citation

3. User Learning Agent

  • Purpose: Preference modeling and adaptation
  • Capabilities:
    • Real-time embedding updates
    • Interaction pattern analysis
    • Cold-start problem handling
    • Temporal preference drift detection

4. Recommendation Engine

  • Purpose: Personalized content delivery
  • Capabilities:
    • Multi-factor scoring algorithms
    • Diversity-aware recommendations
    • Category-based filtering
    • Performance analytics

๐Ÿ”ง Advanced Configuration

Custom Categories and Weights

# User category preferences with weights
CATEGORY_WEIGHTS = {
    "cs.AI": 0.2,          # Artificial Intelligence
    "cs.LG": 0.2,          # Machine Learning  
    "cs.CV": 0.2,          # Computer Vision
    "stat.ML": 0.4,        # Statistics ML
}

๐Ÿค Contributing

We welcome contributions!

Development Workflow

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Make changes with tests
  4. Commit with conventional commits (feat:, fix:, docs:)
  5. Push and create Pull Request

Areas for Contribution

  • ๐Ÿ” New embedding models integration
  • ๐Ÿ“Š Advanced analytics dashboards
  • ๐ŸŒ Multi-language support
  • โšก Performance optimizations
  • ๐ŸŽจ UI/UX improvements
  • ๐Ÿ” User feedbacks
  • ๐Ÿ” notification channels

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • ArXiv for providing open access to research papers
  • Google for Gemini Pro API access
  • Hugging Face for transformer models and embeddings
  • Facebook AI for FAISS vector search
  • OpenAI for CLIP multimodal understanding

๐Ÿ”ฎ Future Enhancements

๐ŸŽฏ Roadmap

Advanced Recommendation System

  • ๐ŸŽฐ Reinforcement Learning Recommender
    • Multi-Armed Bandit algorithms for exploration vs exploitation
    • Deep Q-Network (DQN) for long-term user engagement optimization
    • Contextual bandits considering user state, time, and reading patterns
    • A/B testing framework for recommendation strategy evaluation

Enhanced User Feedback & Analytics

  • ๐Ÿ“Š Rich Feedback Mechanisms

    • Star ratings and detailed paper reviews
    • Reading time tracking and attention heatmaps
    • Bookmark organization with custom tags and collections
    • Social features: following researchers, sharing reading lists
    • Citation network analysis for impact-based recommendations
  • ๐Ÿ”ฌ Advanced Analytics Dashboard

    • Personal research journey visualization
    • Topic evolution and trend analysis
    • Collaboration opportunity detection
    • Research gap identification using knowledge graphs

Multi-Source Content Aggregation

  • ๐ŸŒ Diversified Content Sources

    • LinkedIn Research Posts: Professional insights and industry research
    • Twitter/X Academic Threads: Real-time research discussions and preprints
    • Google Scholar: Citation networks and h-index tracking
    • Research Gate: Social academic networking integration
    • Medium/Towards Data Science: Practical implementations and tutorials
    • GitHub Research Repos: Code implementations and reproducible research
  • ๐Ÿ“ก Social Media Intelligence

    • Tweet sentiment analysis for trending topics
    • LinkedIn post engagement metrics
    • Research influencer identification
    • Conference hashtag monitoring (#NeurIPS2024, #ICML2024)

Phase 4: AI-Powered Research Assistant

  • ๐Ÿค– Advanced AI Capabilities

    • Literature gap analysis using LLMs
    • Automated research proposal generation
    • Cross-paper concept linking and knowledge graphs
    • Research methodology recommendations
    • Collaborative filtering with similar researchers
  • ๐Ÿ”— Research Workflow Integration

    • Zotero/Mendeley synchronization
    • LaTeX reference management
    • Notion/Obsidian knowledge base integration
    • Calendar integration for reading schedules
    • Email digest with personalized research summaries

๐Ÿ“ž Support & Contact


Built with โค๏ธ for the research community

Making academic research discovery intelligent, personalized, and delightful

โฌ† Back to Top

About

An intelligent research discovery platform that automatically crawls ArXiv papers, generates multimodal embeddings, and delivers personalized recommendations through advanced vector search and machine learning-driven user preference modeling.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published