Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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

Features β€’ Quick Start β€’ Installation β€’ Configuration β€’ API β€’ Deployment


✨ 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

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages