SLR Platform — Walkthrough
A production-grade AI-powered Systematic Literature Review platform with:
Backend (FastAPI + SQLAlchemy)
Layer
Files
Description
Models
8
User, Paper, Chunk, ExtractionSchema, ExtractionResult, Matrix, AuditLog, ZoteroMapping
Routers
7
Papers, Zotero, Extraction, Matrix, Analytics, Clusters, Conflicts
Services
12
PDF parser, chunker, section classifier, extraction engine, confidence scorer, LLM client, Zotero sync, SLR protocol, matrix builder, analytics, clustering, conflict detection
Schemas
4
Pydantic models for all API request/response types
Utils
1
Provenance tracking and source highlighting
Frontend (Next.js + Tailwind)
Page
Route
Features
Dashboard
/
Stat cards, quick actions
Papers
/papers
Upload, filter, process, delete
Extraction
/extraction
Schema builder, template library
Matrix
/matrix
Papers × fields table with confidence bars
Analytics
/analytics
Bar charts for methods/year distributions
Clusters
/clusters
Semantic clustering with colored cards
Conflicts
/conflicts
Contradictory findings detection
Zotero
/zotero
Connect, browse collections, sync
Key Architecture Decisions
Multi-pass extraction — 4-stage pipeline (retrieve → extract → validate → provenance) ensures structured, grounded outputs
Hybrid section classifier — Regex heading detection first, LLM fallback for ambiguous chunks
Confidence scoring — Multi-factor (source quality, corroboration count, type match, ambiguity detection)
FAISS + sklearn fallback — Clustering works with or without FAISS installed
Audit logging — Every LLM call is logged with prompt, model, and response
Docker and Docker Compose (for PostgreSQL)
Python 3.11+
Node.js 20+
# From the project root — starts PostgreSQL 15 on port 5433
docker compose up -d
# Verify it's running
docker ps | grep slr_postgres
cd backend
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Initialize Database (create tables & seed default user)
python3 init_db.py
# Run the server
PYTHONPATH=. python3 -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
# API docs → http://localhost:8000/docs
cd frontend
npm install
npm run dev
# Dashboard → http://localhost:3000
Prefix
Endpoints
/api/papers
Upload, list, get, update, delete, process, chunks
/api/zotero
Connect, collections, sync
/api/extraction
Schemas CRUD, templates, run, results, corrections
/api/matrix
Build, get, export (CSV/JSON)
/api/analytics
Methods frequency, year trends, distributions
/api/clusters
Generate, get cached
/api/conflicts
Detect, get cached
/api/health
Health check
/api/overview
Dashboard statistics
Please fill in the env accordingly or add support for a different API for the agents required.