Skip to content

About

Auditable multi-source academic literature discovery

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Scholattice

Python 3.9+ Six academic sources Three-stage filtering Markdown, JSON, and BibTeX export Research prototype

An auditable, multi-source pipeline for high-quality academic literature discovery
面向研究问题的自动化学术文献检索、分层筛选、质量评估、引文扩展与报告生成系统


What It Does

Scholattice turns a natural-language research question into a ranked and traceable set of academic papers. Instead of relying on a single search API or a single relevance score, it combines query decomposition, six academic sources, semantic screening, LLM-assisted review, metadata quality signals, and citation expansion in one reproducible CLI workflow.

cd literature_agent
python main.py \
  --rq "How can retrieval-augmented generation reduce hallucinations?" \
  --config config/config.yaml \
  --output-dir output/rag_hallucination \
  --verbose

The run produces a readable literature report, structured paper records, a BibTeX bibliography, diagnostics, logs, and resumable checkpoints. PDF download is available when explicitly enabled.


System Architecture

End-to-end literature search pipeline

View the text-rendered architecture
flowchart LR
    RQ[Research Question] --> KP[Knowledge Primer]
    KP --> QU[Query Understanding]
    QU --> SR[Multi-source Retrieval]

    SR --> S2[Semantic Scholar]
    SR --> OA[OpenAlex]
    SR --> AX[arXiv]
    SR --> CR[Crossref]
    SR --> DB[DBLP]
    SR --> CO[CORE]

    S2 --> PRE[Seed Injection<br/>Deduplication<br/>Language Filter]
    OA --> PRE
    AX --> PRE
    CR --> PRE
    DB --> PRE
    CO --> PRE

    PRE --> L1[L1 Semantic Filter]
    L1 --> L2[L2 Relevance Review]
    L2 --> L3[L3 Calibrated Scoring]
    L3 --> MQ[Metadata Enrichment<br/>Quality Scoring]
    MQ --> CE[Citation Expansion]
    CE --> OUT[Ranking<br/>Clustering<br/>Exports]
Loading

The pipeline stores intermediate checkpoints and diagnostics so decisions can be inspected and long searches can recover from partial failures.


Key Features

Feature Implementation Why It Matters
Research-question decomposition LLM-assisted query understanding and query generation Searches multiple formulations instead of one literal query
Knowledge priming Domain context, terminology, and candidate seed discovery Improves query coverage before retrieval begins
Multi-source retrieval Semantic Scholar, OpenAlex, arXiv, Crossref, DBLP, optional CORE Reduces dependence on one index and one ranking policy
Seed injection Curated seeds and automatically discovered seeds Preserves known landmark papers when configured
Layered deduplication Identifier, normalized-title, author-overlap, and title-similarity checks Consolidates duplicate records across providers
L1 semantic screening SPECTER2 embeddings with cache support and TF-IDF fallback Removes obvious mismatches before expensive LLM review
L2 relevance review Batched LLM classification, cache support, and rescue rules Adds contextual relevance judgments with failure recovery
L3 calibrated scoring Multi-dimensional scoring, soft thresholds, and borderline rescoring Distinguishes strong, borderline, and weak candidates
Quality scoring Venue, citation, author, institution, recency, and peer-review signals Separates topical relevance from research quality
Citation expansion Reference and citation traversal with relevance gates and OpenAlex fallback Finds important papers missed by keyword retrieval
Auditable outputs Exclusion records, diagnostics, checkpoints, and run metadata Makes filtering and ranking decisions inspectable
Resilience controls Retry policies, circuit breakers, budget tracking, and graceful degradation Keeps partial provider failures from invalidating the run

Academic Data Sources

Source Primary Role Credentials
Semantic Scholar Semantic paper search, paper lookup, references, citations Optional API key
OpenAlex Broad scholarly search, metadata enrichment, citation fallback Optional API key
arXiv Preprint discovery No key required
Crossref DOI and publication metadata Contact email recommended
DBLP Computer-science publication metadata No key required
CORE Open-access discovery and optional PDF fallback API key required when enabled

Providers can be enabled or disabled in config/config.yaml. Only configure services you intend to use.


Retrieval and Ranking Pipeline

1. Understand the research question

The agent extracts the research scope, decomposes the question, generates search queries, and can prime the run with domain concepts and candidate seed papers.

2. Retrieve and normalize candidates

Search requests run across the enabled academic sources. Provider-specific responses are mapped to a shared paper model before seed injection, cross-source deduplication, and language filtering.

3. Apply three relevance stages

Raw candidates
  -> L1: embedding similarity and adaptive semantic threshold
  -> L2: contextual relevance classification and rescue rules
  -> L3: calibrated topic, method, and survey-fitness scoring

Early stages reduce cost; later stages spend more computation on the papers that remain plausible.

4. Add quality and citation evidence

The pipeline enriches paper metadata, computes independent quality signals, and expands references and citations under strict relevance and convergence limits.

5. Rank, cluster, and export

Final ranking combines relevance and quality evidence. The output stage groups related papers and writes both human-readable and machine-readable artifacts.


Quick Start

1. Create an environment

git clone https://github.com/Zhouyang66639/Scholattice.git
cd Scholattice/literature_agent

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
cp config/config.yaml.example config/config.yaml

Windows PowerShell:

git clone https://github.com/Zhouyang66639/Scholattice.git
Set-Location Scholattice\literature_agent

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
Copy-Item config\config.yaml.example config\config.yaml

The embedding stack includes PyTorch and Transformers. Installation size and first-run model download time depend on the selected platform and model cache.

2. Configure services

Keep real credentials in environment variables or the ignored local config/config.yaml.

export LLM_API_KEY="your-llm-key"
export SEMANTIC_SCHOLAR_API_KEY="your-s2-key"
export OPENALEX_API_KEY="your-openalex-key"
export CROSSREF_MAILTO="your-email@example.com"
export CORE_API_KEY="your-core-key"

The LLM layer supports OpenAI-compatible endpoints through the provider and base-URL settings in the configuration file.

3. Run a search

python main.py \
  --rq "What methods improve factuality in retrieval-augmented generation?" \
  --config config/config.yaml \
  --output-dir output/factuality_review

Seven-stage command-line execution timeline


CLI Reference

Option Required Description
--rq, --research-question Yes Natural-language research question
--output-dir No Output directory; defaults to output/
--config No Configuration path; defaults to config/config.yaml
--verbose, -v No Enable detailed terminal and file logs
python main.py --help

Outputs

A run can create the following artifacts beneath the selected output directory:

output/<run>/
|-- report.md                 # grouped literature report
|-- papers.json               # normalized papers, scores, and metadata
|-- references.bib            # BibTeX bibliography
|-- checkpoints/              # resumable intermediate results and run metadata
|-- logs/                     # terminal logs and diagnostic artifacts
|-- excluded/                 # auditable exclusion records
`-- pdfs/                     # optional downloaded papers

Ranked literature, evidence profile, and decision audit trail

Exact diagnostic filenames depend on the enabled stages and providers.

Generated output can contain the research question, bibliographic metadata, model responses, and provider error details. Review run artifacts before sharing them outside your environment.


Configuration

The example configuration groups controls for:

  • source enablement, per-query limits, and circuit breakers;
  • semantic, L2, and L3 filtering thresholds;
  • seed injection and citation-expansion budgets;
  • embedding and LLM caches;
  • LLM provider, model, endpoint, timeout, and concurrency settings;
  • venue, citation, author, institution, recency, and peer-review weights;
  • retry and degradation behavior;
  • optional PDF download.

Start from literature_agent/config/config.yaml.example; never commit the populated config/config.yaml.


Project Structure

Scholattice/
|-- README.md
|-- .gitignore
`-- literature_agent/
    |-- main.py
    |-- requirements.txt
    |-- config/
    |   |-- config.yaml.example
    |   |-- calibration_examples.json
    |   |-- seed_papers.yaml
    |   |-- top_institutions.json
    |   `-- venue_tiers.json
    |-- src/
    |   |-- api_clients/          # academic provider clients
    |   |-- filters/              # L1, L2, and L3 relevance stages
    |   |-- quality/              # metadata enrichment and quality scoring
    |   |-- resilience/           # retry, circuit breaker, and budget controls
    |   |-- pipeline.py           # end-to-end orchestration
    |   `-- output_generator.py   # reports and structured exports
    `-- tests/                    # offline unit and integration tests

Private development notes, generated runs, caches, local configuration, and downloaded documents are intentionally excluded from the public tree.


Tests

The offline suite covers data models, configuration, API clients, query understanding, parsing, deduplication, L1/L2/L3 filtering, citation expansion, quality scoring, output generation, resilience, and pipeline integration.

cd literature_agent
python -m unittest discover -s tests -v

Live API and LLM behavior still depends on provider availability, credentials, rate limits, and the configured models.


Privacy and Public-Release Safety

The tracked configuration file is a template and must contain placeholders only. The repository's ignore rules exclude local configuration, environment files, generated output, caches, logs, virtual environments, and private development documents.

Before publishing a fork or changing repository visibility:

  1. inspect the complete Git history, not only the current working tree;
  2. scan tracked files and staged changes for secrets and machine-local paths;
  3. remove generated reports, checkpoints, logs, PDFs, databases, and model caches;
  4. rotate any credential that has ever been committed;
  5. verify the README against the exact code revision being released.

Current Scope

This repository is a research prototype and command-line application. Search quality and runtime vary with the research question, enabled sources, metadata coverage, LLM behavior, model loading, network conditions, and available compute. Rankings support literature review; they do not replace expert screening or systematic-review methodology.

Roadmap

  • Multi-source academic retrieval
  • Knowledge priming and query decomposition
  • Layered deduplication and language filtering
  • L1/L2/L3 relevance pipeline
  • Metadata quality scoring and citation expansion
  • Markdown, JSON, and BibTeX export
  • Checkpoints, diagnostics, and resilience controls
  • Public benchmark and reproducible evaluation report
  • Continuous integration across supported Python versions
  • Installable package and versioned releases
  • Optional web interface

Acknowledgements

This project builds on the public APIs and metadata provided by Semantic Scholar, OpenAlex, arXiv, Crossref, DBLP, and CORE, together with the open-source Python, PyTorch, and Hugging Face ecosystems.

About

Auditable multi-source academic literature discovery

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages