Queue-driven, adaptive literature discovery engine — bidirectional citation traversal, LLM screening, thematic synthesis
Project description
LitDiscover
Queue-driven, adaptive literature discovery. Give it seed papers and inclusion criteria; LitDiscover traverses the citation graph bidirectionally, surfaces semantically similar papers from outside the graph, screens candidates with an LLM, and writes a thematic narrative review with numbered citations.
This is the active development repository. The empirical paper validating the approach (Robust Literature Discovery from Minimal Seeds) is maintained separately.
Looking for the older v1 pipeline? See automated-lit-reviews (archived).
Quick start
# 1. Install
git clone https://github.com/davidcagoh/automated-lit-reviews-v2.git
cd automated-lit-reviews-v2
pip install -e .
cp .env.example .env # fill in keys (see Environment variables)
# 2. Apply DB schema (once, in Supabase SQL editor)
# paste contents of supabase/schema.sql
# 3. Initialise a project from a folder of seed PDFs
litdiscover init projects/my-review/project.toml
# 4. Run to stability
litdiscover run projects/my-review/project.toml
# 5. Extract structured fields, then synthesise
litdiscover extract my-review
litdiscover synthesize my-review
Output: projects/my-review/my-review_review_numbered.md — a thematic narrative review with sequential [N] citations and a ## References section.
Environment variables
SUPABASE_URL=https://<project>.supabase.co
SUPABASE_SERVICE_KEY=<service-role key>
SEMANTIC_SCHOLAR_API_KEY=<key> # required for S2 traversal + embeddings
GEMINI_API_KEY=<key> # screening, extraction, synthesis (default)
GROQ_API_KEY=<key> # alternative screening backend (free, fast)
CLI reference
litdiscover init <project.toml> # create DB record, ingest seeds
litdiscover run <project.toml> # main loop: traverse → screen → repeat
litdiscover status <slug> # corpus stats
litdiscover reset <slug> # reset paper queue, keep criteria history
litdiscover extract <slug> # structured extraction (post-stability)
litdiscover synthesize <slug> # thematic narrative review
Architecture
LitDiscover is a queue-driven state machine (litdiscover/core/loop.py). All state is persisted in Supabase, making runs fully restartable.
SEED papers
│
▼
SEARCH (S2 keyword query)
│
▼
SCREEN (LLM batch, up to 20 papers)
│
included?
│── yes → TRAVERSE (forward + backward citation graph)
│ PDF worker (background reference extraction)
│ SEARCH (escape-hatch keyword queries when yield is low)
│ → new candidates added to queue
│
└── cycle yield < threshold for 2 rounds → STOP
│
▼
EXTRACT (structured fields per included paper, Gemini)
│
▼
SYNTHESIZE (k-means cluster → per-theme narrative → numbered bibliography)
Key design choices:
- Backward traversal is never hub-filtered (survey papers with many references are the most valuable traversal targets).
- Forward traversal applies a Pareto-80 hub filter by default to avoid flooding the queue with citing papers of landmark works.
- An escape-hatch keyword search fires when cycle yield drops below threshold, recovering papers not citation-connected to the seed cluster.
- Background PDF workers run concurrently with screening, extracting reference lists to feed the next traversal cycle.
Relationship to robust-literature-discovery
| Repository | Role |
|---|---|
automated-lit-reviews-v2 (this repo) |
Deployed engine: queue loop, DB integrations, LLM screening, extraction, synthesis |
robust-literature-discovery |
Empirical paper: APS benchmark, publication figures, manuscript (Robust Literature Discovery from Minimal Seeds) |
The paper repository is self-contained — you can reproduce all benchmark results without the full application.
Tests
python -m pytest tests/ -v
All tests are mocked (no live DB or API connections required).
Requirements
- Python ≥ 3.11
- A Supabase project (free tier works)
- Gemini API key (default backend) or Groq API key (free screening alternative)
- Semantic Scholar API key (for traversal and embeddings)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file litdiscover-2.0.0.tar.gz.
File metadata
- Download URL: litdiscover-2.0.0.tar.gz
- Upload date:
- Size: 62.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a7fb908867fdcd2fa69d36de7282ae1a1d41ead1c87738c8ebbd22ac661111c
|
|
| MD5 |
c31f6716ae0fdb3337efe17e44c363aa
|
|
| BLAKE2b-256 |
f0c494505fad82e038ea81fbb58f5e22c149c8787820d7af25fa5d2c02e7c212
|
File details
Details for the file litdiscover-2.0.0-py3-none-any.whl.
File metadata
- Download URL: litdiscover-2.0.0-py3-none-any.whl
- Upload date:
- Size: 52.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91381625f33c51f78289922bb6d8db664377647d808687ebe688107ef581ff17
|
|
| MD5 |
e8b6e40c80a86b6f34cd07f5a6d38d4c
|
|
| BLAKE2b-256 |
484d92a4483f29fab9597294f227ecaf3683796ba7c005f8e6c964b7de45c063
|