CoolFace
Apppublic

Pratham13/research-paper-finder

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

Research Paper Finder

An agentic research workspace for finding related papers, research sources, GitHub repositories, and implementation references from a prompt, uploaded paper, or arXiv link.

The backend follows the Mem0 graph-memory pattern: each research run stores session memories and durable user memories keyed by the required username, embeds memories for semantic recall, and mirrors extracted entities and relations into a graph. Supabase is used as the database when credentials are configured; a local SQLite store remains available for development.

Stack

  • —Backend: FastAPI, LangGraph, Groq, LlamaIndex, Hugging Face sentence embeddings, Supabase client, SQLite
  • —Frontend: React, TypeScript, Vite, lucide icons, SVG knowledge graph
  • —Search agents: papers, blogs/web, GitHub repositories, document ingestion

Quick Start

bash
cp .env.example .env
# Add GROQ_API_KEY and optional Supabase values.

cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000

For local Hugging Face sentence-transformer embeddings instead of the lightweight fallback:

bash
pip install -r backend/requirements-hf.txt
bash
cd frontend
npm install
npm run dev

Open http://localhost:5173.

Production Deploy

The app can deploy as one Docker web service. The backend serves both /api/* and the built React app, so the public link is a single URL.

Required production environment variables:

bash
GROQ_API_KEY=
GROQ_MODEL=llama-3.3-70b-versatile
SUPABASE_URL=
SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
APP_DATABASE_PATH=/tmp/research_finder.db

Free Public Option: Hugging Face Spaces

Hugging Face Spaces Docker is the best free fit for a durable public link. The URL is stable and public, the app restarts after sleeps or crashes, and Supabase keeps durable user data. The tradeoff is cold starts after idle periods.

  1. 1.Create a new Space on Hugging Face.
  2. 2.Choose Docker as the Space SDK.
  3. 3.Push this repository to the Space.
  4. 4.Add these Space secrets:
bash
GROQ_API_KEY=
GROQ_MODEL=llama-3.3-70b-versatile
SUPABASE_URL=
SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
APP_DATABASE_PATH=/tmp/research_finder.db

The Dockerfile listens on port 7860, which is the expected Spaces port. Supabase stores durable records, and the backend hydrates local graph memory from Supabase when a Space instance restarts.

Render is also preconfigured through render.yaml, but reliable always-on Render hosting generally requires a paid instance.

Supabase

The app does not require frontend Supabase sign-in. The required username is the identity key, and the backend writes profiles, sessions, memories, and graph data into Supabase using server-side credentials.

  1. 1.Create a Supabase project.
  2. 2.Run backend/supabase_schema.sql.
  3. 3.Set SUPABASE_URL, SUPABASE_ANON_KEY, and SUPABASE_SERVICE_ROLE_KEY in .env. The backend still treats SQLite as the operational graph store so graph memory queries work locally and during development, while Supabase receives mirrored durable records.

API

POST /api/research accepts multipart form data:

  • —user_name required
  • —prompt optional
  • —arxiv_url optional
  • —file optional PDF/text upload

At least one of prompt, arxiv_url, file, or bucket_papers must be present.

Optional:

  • —bucket_papers JSON array of previously returned paper objects. These papers are treated as user-selected seeds for a wider but targeted follow-up search.

Paper results include confidence_score and confidence_reason, computed from semantic match to the prompt, selected bucket context, source evidence, abstract quality, and citation signal.

Memory Design

The implementation is inspired by Mem0 graph memory docs and paper:

  • —Mem0 graph memory docs: https://docs.mem0.ai/open-source/features/graph-memory
  • —Mem0 LangGraph integration: https://docs.mem0.ai/integrations/langgraph
  • —Mem0 paper: https://arxiv.org/abs/2504.19413