Skip to content

Kernel-Science/metascience_platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

FQxI Metascience Platform

An open-source research platform that helps academics and curious minds search, map, and evaluate scientific literature with AI assistance. A Next.js web app sits on top of a Python/FastAPI engine that unifies multiple scholarly databases (ArXiv, OpenAlex, INSPIRE-HEP, NASA ADS) and modern AI models.

License: MIT

Live instance: https://metascience.fqxi.org


✨ Features

  • πŸ€– Assistant β€” a conversational research agent (Claude) that searches, builds citation networks, analyses trends, and assesses papers, rendering rich results inline.
  • πŸ” Multi-source search β€” one query fans out to ArXiv, OpenAlex, INSPIRE-HEP, and NASA ADS, then results are deduplicated and reranked for relevance.
  • πŸ•ΈοΈ Citation networks β€” interactive citation graphs built on an OpenAlex identifier backbone, with Semantic Scholar / OpenCitations for citation data.
  • πŸ“ˆ Trend analysis β€” theme clustering plus an AI-written synthesis of how a field is evolving.
  • πŸ“ Paper assessment β€” automated, peer-review-style scoring of an uploaded paper (Gemini), with per-criterion justifications.
  • πŸ§‘β€πŸ’» Public Developer API β€” generate an API key and call the same engines from your own projects (see Developer API).

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  frontend/ (Next.js 15) β”‚  HTTP  β”‚  backend/ (FastAPI)     β”‚
β”‚  β€’ App Router UI        β”‚ ─────▢ β”‚  β€’ search orchestrator  β”‚
β”‚  β€’ /api proxy routes    β”‚        β”‚  β€’ citation network     β”‚
β”‚  β€’ /api/v1 public API   β”‚        β”‚  β€’ trends + clustering  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚  β€’ AI paper review      β”‚
            β”‚                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚ auth + per-user data             β”‚ literature + AI
            β–Ό                                  β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            ArXiv Β· OpenAlex Β· INSPIRE-HEP
   β”‚  Supabase        β”‚            NASA ADS Β· Semantic Scholar
   β”‚  (Postgres+Auth) β”‚            Anthropic Claude Β· Google Gemini
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Frontend (/frontend) β€” Next.js 15 (App Router) + HeroUI/Tailwind. Hosts the UI, thin /api proxy routes to the engine, and the public /api/v1 Developer API.
  • Backend (/backend) β€” Python/FastAPI engine that orchestrates the literature sources, citation-network builder, trend clustering, and AI review.
  • Supabase β€” authentication and per-user data (chat history, saved reviews, API keys, feedback) under row-level security.

πŸš€ Quick start

Prerequisites

  • Node.js 18+ and pnpm (or npm)
  • Python 3.11+ (3.13 supported)
  • A Supabase project (free tier is fine)
  • Anthropic API key (Assistant, query understanding, trends)
  • Google AI API key (paper review + embeddings)

1. Clone

git clone https://github.com/Kernel-Science/Metascience_Platform.git
cd Metascience_Platform

2. Backend

cd backend
python -m venv .venv
source .venv/bin/activate           # Windows: .\.venv\Scripts\Activate.ps1
pip install -r requirements.txt

cp .env.example .env                # then edit .env (see table below)
uvicorn app.main:app --reload       # http://localhost:8000

3. Supabase (database & auth)

In your Supabase project's SQL editor, run the migration files in frontend/ (order doesn't matter, but run all four):

supabase_migration_feedback.sql
supabase_migration_chat.sql
supabase_migration_reviewer3.sql
supabase_migration_api_keys.sql

For profile avatars, create a public Storage bucket named avatars. Enable the Email and (optionally) Google auth providers under Authentication > Providers.

4. Frontend

cd frontend
pnpm install
cp .env.example .env.local          # then edit .env.local (see table below)
pnpm dev                            # http://localhost:3000

For production: pnpm build && pnpm start.

πŸ”‘ Environment variables

Backend (backend/.env)

Variable Required Purpose
ANTHROPIC_API_KEY βœ… Claude β€” query understanding, trends, rerank fallback
GOOGLE_API_KEY βœ… Gemini β€” paper review + embeddings
ANTHROPIC_MODEL – Override the Claude model (default claude-sonnet-4-6)
GEMINI_REVIEW_MODEL – Override the review model (default gemini-flash-latest)
OPENALEX_MAILTO – Email for OpenAlex's polite pool (higher rate limits)
SEMANTIC_SCHOLAR_API_KEY – Lifts Semantic Scholar rate limits
ADS_API_TOKEN – Enables the NASA ADS source
RERANK_PROVIDER – auto / google / anthropic / none
REVIEWER3_API_KEY, REVIEWER3_USER_ID – Optional Reviewer3 multi-reviewer integration

Frontend (frontend/.env.local)

Variable Required Purpose
NEXT_PUBLIC_SUPABASE_URL βœ… Supabase project URL
NEXT_PUBLIC_SUPABASE_ANON_KEY βœ… Supabase anon key (auth)
NEXT_PUBLIC_SITE_URL βœ… Base URL for auth callbacks (e.g. http://localhost:3000)
NEXT_PUBLIC_BACKEND_URL βœ… FastAPI engine URL (e.g. http://localhost:8000)
ANTHROPIC_API_KEY βœ… Assistant (chat) calls Claude from the Next.js server
SUPABASE_SERVICE_ROLE_KEY βœ…* Server-only; verifies public API keys. Required only for the Developer API.

πŸ§‘β€πŸ’» Developer API

Signed-in users can create API keys at /developer and call the platform's engines over HTTP at https://<your-host>/api/v1:

Endpoint Method Description
/api/v1/search GET Multi-source paper search
/api/v1/citation-network POST Build a citation graph from a DOI
/api/v1/trends POST Trend clustering + AI synthesis for a topic
/api/v1/review POST AI paper assessment (multipart file upload)

Authenticate with Authorization: Bearer <key>. Full reference and code samples live on the in-app Developer page. See frontend/README.md for implementation details.

πŸ“ Repository structure

Metascience_Platform/
β”œβ”€β”€ frontend/                 # Next.js web app
β”‚   β”œβ”€β”€ app/                  # routes (research, citation, review, docs, developer, api)
β”‚   β”œβ”€β”€ components/           # UI components
β”‚   β”œβ”€β”€ lib/                  # stores, supabase clients, api gateway helpers
β”‚   └── supabase_migration_*.sql
β”œβ”€β”€ backend/                  # FastAPI engine
β”‚   └── app/
β”‚       β”œβ”€β”€ routes/           # HTTP endpoints
β”‚       └── services/         # search, citations, trends, review, clustering, cache
└── README.md

πŸ“š Component docs

🀝 Contributing

Contributions are welcome β€” see CONTRIBUTING.md and the Code of Conduct.

πŸ“„ License

MIT.

πŸ›‘οΈ Security

To report a vulnerability, see the Security Policy.

About

Metascience Platform by Kernel Science SRL for FQXI

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors