Skip to content

RedEye1605/ResearchHub

Repository files navigation

ResearchHub Logo

Next.js FastAPI Python TypeScript License

🧠 ResearchHub

An enterprise-grade AI Research Assistant
Like NotebookLM, but free and open-source

FeaturesQuick StartInstallationConfigurationAPIDeployment


✨ Features

📄 Document Intelligence

  • PDF Processing - Upload and analyze research papers with OCR support
  • Multi-Document Analysis - Process multiple documents simultaneously
  • Smart Chunking - Intelligent text splitting for optimal retrieval

💬 AI-Powered Chat

  • Neural Search - Hybrid BM25 + Vector search with AI re-ranking
  • Streaming Responses - Real-time AI responses with Llama 3.3 70B
  • Citation Tracking - Automatic source attribution with page numbers
  • Conversation History - Persistent chat sessions per project

🎙️ Audio Podcasts

  • AI-Generated Discussions - Create podcast-style content from your research
  • Multi-Voice Support - Natural dialogue with different speakers
  • Transcript Sync - Follow along with synchronized transcripts

🕸️ Knowledge Graph

  • Visual Relationships - Interactive 3D visualization of document connections
  • Entity Extraction - Automatic identification of key concepts
  • Semantic Clustering - Group related documents automatically

📊 Intelligence Panel

  • Research Summaries - AI-generated executive summaries
  • Key Insights - Extract main findings and conclusions
  • Methodology Analysis - Understand research approaches

📝 Export & Citations

  • Multiple Formats - BibTeX, APA, MLA, Chicago, IEEE
  • PDF Reports - Generate formatted research reports
  • Batch Export - Export all citations at once

🚀 Quick Start

# Clone the repository
git clone https://github.com/RedEye1605/ResearchHub.git
cd ResearchHub

# Setup Backend
cd backend
pip install -r requirements.txt
cp .env.example .env  # Edit with your API keys
uvicorn app.main:app --reload

# Setup Frontend (new terminal)
cd frontend
npm install
npm run dev

Open http://localhost:3000 and start researching! 🎉


📦 Installation

Prerequisites

  • Python 3.11+ - Backend runtime
  • Node.js 18+ - Frontend runtime
  • Git - Version control

Backend Setup

cd backend

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # Linux/Mac
# or
.\venv\Scripts\activate  # Windows

# Install dependencies
pip install -r requirements.txt

# Initialize database
python -c "from app.core.database import init_db; import asyncio; asyncio.run(init_db())"

Frontend Setup

cd frontend

# Install dependencies
npm install

# Build for production (optional)
npm run build

⚙️ Configuration

Environment Variables

Create a .env file in the backend/ directory:

# Required - Authentication
SECRET_KEY=your-super-secret-key-minimum-32-characters

# Required - AI Services (get free at https://console.groq.com)
GROQ_API_KEY=gsk_your_groq_api_key

# Optional - Additional AI Provider
TOGETHER_API_KEY=your_together_api_key

# Database (default: SQLite)
DATABASE_URL=sqlite+aiosqlite:///./data/researchhub.db

# Storage Paths
CHROMA_PERSIST_DIR=./data/chroma
UPLOAD_DIR=./data/uploads

# Token Settings
ACCESS_TOKEN_EXPIRE_MINUTES=30
REFRESH_TOKEN_EXPIRE_DAYS=7

Frontend Configuration

Create .env.local in frontend/:

NEXT_PUBLIC_API_URL=http://localhost:8000

🔌 API Reference

Authentication

Endpoint Method Description
/api/v1/auth/register POST Register new user
/api/v1/auth/login POST Login and get tokens
/api/v1/auth/refresh POST Refresh access token
/api/v1/auth/me GET Get current user info

Projects

Endpoint Method Description
/api/v1/projects GET List all projects
/api/v1/projects POST Create new project
/api/v1/projects/{id} GET Get project details
/api/v1/projects/{id} DELETE Delete project

Documents

Endpoint Method Description
/api/v1/documents/{project_id}/upload POST Upload document
/api/v1/documents/{project_id} GET List project documents
/api/v1/documents/{project_id}/{doc_id} DELETE Delete document

Search

Endpoint Method Description
/api/v1/search/{project_id} GET Hybrid neural search

Chat

Endpoint Method Description
/api/v1/chat/{project_id} POST Send chat message (streaming)
/api/v1/history/{project_id}/sessions GET List chat sessions
/api/v1/history/{project_id}/sessions/{session_id} GET Get session messages

Intelligence

Endpoint Method Description
/api/v1/intelligence/{project_id}/summary GET Generate AI summary
/api/v1/intelligence/{project_id}/insights GET Extract key insights

Podcast

Endpoint Method Description
/api/v1/podcast/{project_id}/generate POST Generate podcast
/api/v1/podcast/{project_id} GET List podcasts
/api/v1/podcast/{project_id}/{podcast_id}/audio GET Stream audio

Export

Endpoint Method Description
/api/v1/export/{project_id}/citations GET Export citations
/api/v1/export/{project_id}/report GET Generate PDF report

📖 Full API documentation available at http://localhost:8000/docs (Swagger UI)


🏗️ Tech Stack

Frontend

Technology Purpose
Next.js 14 React framework with App Router
TypeScript Type-safe JavaScript
Tailwind CSS Utility-first styling
Framer Motion Animations
Zustand State management
React Query Data fetching

Backend

Technology Purpose
FastAPI High-performance Python API
SQLAlchemy Async ORM
ChromaDB Vector database
LangChain LLM orchestration
sentence-transformers Text embeddings

AI Services

Service Model Purpose
Groq Llama 3.3 70B Chat & Analysis
HuggingFace all-mpnet-base-v2 Embeddings
Edge TTS Neural voices Podcast audio

🚢 Deployment

Frontend (Vercel)

cd frontend
npm run build
vercel deploy --prod

Backend (Fly.io)

We recommend Fly.io for best performance with SQLite databases.

  1. Install Fly CLI: Documentation
  2. Login: fly auth login
  3. Deploy from backend directory:
cd backend
fly launch
fly deploy

See docs/FLY_IO.md for detailed deployment instructions including Volume setup.


📁 Project Structure

ResearchHub/
├── backend/
│   ├── app/
│   │   ├── api/v1/          # API endpoints
│   │   ├── core/            # Security, database, prompts
│   │   ├── models/          # SQLAlchemy models
│   │   ├── schemas/         # Pydantic schemas
│   │   ├── services/        # Business logic
│   │   └── main.py          # FastAPI app
│   ├── data/                # Runtime data (gitignored)
│   ├── tests/               # Pytest tests
│   └── requirements.txt
├── frontend/
│   ├── src/
│   │   ├── app/             # Next.js App Router pages
│   │   ├── components/      # React components
│   │   ├── lib/             # Utilities
│   │   └── stores/          # Zustand stores
│   └── package.json
└── README.md

🧪 Testing

# Backend tests
cd backend
pytest -v

# Frontend tests
cd frontend
npm test

🤝 Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

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


🙏 Acknowledgments

  • Groq - Lightning-fast LLM inference
  • LangChain - LLM application framework
  • ChromaDB - Open-source vector database
  • Vercel - Frontend deployment platform

Made with ❤️ by RedEye1605

About

AI-powered research assistant - like NotebookLM but open-source. Features neural search, RAG chat with citations, podcast generation, and knowledge graph. Built with Next.js 14 + FastAPI.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors