Skip to main content

Local OpenAlex database with 284M+ works, abstracts, and semantic search

Project description

OpenAlex Local (openalex-local)

SciTeX

Local OpenAlex database with 284M+ scholarly works, abstracts, and semantic search

SciTeX IF vs JCR Validation
SciTeX Impact Factor (OpenAlex) validated against JCR 2024 (r = 0.96, 17,042 journals)

PyPI version Documentation Tests coverage Python License

Demo

OpenAlex Local IF Validation

# Search 284M papers locally — abstracts + semantic indices
openalex-local search "graph neural networks for protein folding"

# Resolve a DOI to full record (title, abstract, citations, IF)
openalex-local search-by-doi 10.1038/s41586-021-03819-2

# Drive from MCP / Claude Code
openalex-local mcp serve

The chart above is OpenAlex-derived impact factors validated against JCR 2024 (r = 0.96, n = 17,042 journals).

Architecture

┌──────────────────────────┐
│ OpenAlex public dump     │
│ (~300 GB compressed)     │
└──────────────┬───────────┘
               │ snapshot import
               ▼
       ┌─────────────────────┐
       │ openalex.db         │
       │ (SQLite + FTS5)     │
       │ + semantic embeds   │
       └────────┬────────────┘
                │
                ▼
   ┌──────────────────────────────────────┐
   │ openalex-local — Python / CLI / MCP  │
   │   search · search-by-doi · cache     │
   │   if-validate · stats · relay        │
   └──────────────────────────────────────┘

The DB lives entirely on disk; openalex-local is a thin facade over SQLite + FTS5 + an embedding index. No network calls during queries.

Why OpenAlex Local?

Built for the LLM era - features that matter for AI research assistants:

Feature Benefit
284M Works More coverage than CrossRef
Abstracts ~45-60% availability for semantic search
Concepts & Topics Built-in classification
Author Disambiguation Linked to institutions
Open Access Info OA status and URLs

Perfect for: RAG systems, research assistants, literature review automation.

Installation
pip install openalex-local

From source:

git clone https://github.com/ywatanabe1989/openalex-local
cd openalex-local && make install

Database setup (~300 GB, ~1-2 days to build):

# Check system status
make status

# 1. Download OpenAlex Works snapshot (~300GB)
make download-screen  # runs in background

# 2. Build SQLite database
make build-db

# 3. Build FTS5 index
make build-fts
Python API
from openalex_local import search, get, count

# Full-text search (title + abstract)
results = search("machine learning neural networks")
for work in results:
    print(f"{work.title} ({work.year})")
    print(f"  Abstract: {work.abstract[:200]}...")
    print(f"  Concepts: {[c['name'] for c in work.concepts]}")

# Get by OpenAlex ID or DOI
work = get("W2741809807")
work = get("10.1038/nature12373")

# Count matches
n = count("CRISPR")
CLI
openalex-local search "CRISPR genome editing" -n 5
openalex-local search-by-doi W2741809807
openalex-local search-by-doi 10.1038/nature12373
openalex-local status  # Configuration and database stats

With abstracts (-a flag):

$ openalex-local search "neural network" -n 1 -a

Found 1,523,847 matches in 45.2ms

1. Deep learning for neural networks (2015)
   OpenAlex ID: W2741809807
   Abstract: This paper presents a comprehensive overview of deep learning
   techniques for neural network architectures...
HTTP API

Start the FastAPI server:

openalex-local relay --host 0.0.0.0 --port 31292

Endpoints:

# Search works (FTS5)
curl "http://localhost:31292/works?q=CRISPR&limit=10"

# Get by ID or DOI
curl "http://localhost:31292/works/W2741809807"
curl "http://localhost:31292/works/10.1038/nature12373"

# Batch lookup
curl -X POST "http://localhost:31292/works/batch" \
  -H "Content-Type: application/json" \
  -d '{"ids": ["W2741809807", "10.1038/nature12373"]}'

# Database info
curl "http://localhost:31292/info"

HTTP mode (connect to running server):

# On local machine (if server is remote)
ssh -L 31292:127.0.0.1:31292 your-server

# Python client
from openalex_local import configure_http
configure_http("http://localhost:31292")

# Or via CLI
openalex-local --http search "CRISPR"
MCP Server

Run as MCP (Model Context Protocol) server:

openalex-local mcp start

Local MCP client configuration:

{
  "mcpServers": {
    "openalex-local": {
      "command": "openalex-local",
      "args": ["mcp", "start"],
      "env": {
        "OPENALEX_LOCAL_DB": "/path/to/openalex.db"
      }
    }
  }
}

Remote MCP via HTTP:

# On server: start persistent MCP server
openalex-local mcp start -t http --host 0.0.0.0 --port 8083
{
  "mcpServers": {
    "openalex-remote": {
      "url": "http://your-server:8083/mcp"
    }
  }
}

Diagnose setup:

openalex-local mcp doctor        # Check dependencies and database
openalex-local mcp list-tools    # Show available MCP tools
openalex-local mcp installation  # Show client config examples

Available tools:

  • search - Full-text search across 284M+ papers
  • search_by_id - Get paper by OpenAlex ID or DOI
  • enrich_ids - Batch lookup with metadata
  • status - Database statistics
SciTeX Impact Factor (OpenAlex)

We provide precomputed SciTeX Impact Factors calculated from OpenAlex citation data. These follow the JCR formula but use OpenAlex as the data source.

Validation against JCR 2024 (17,042 matched journals):

Metric Value
Pearson r 0.96
Spearman ρ 0.93
p-value < 1e-100

Export SciTeX IF:

# Export all SciTeX IF values
openalex-local export-if -o scitex_if.csv
openalex-local export-if -o scitex_if.json

# Top 1000
openalex-local export-if -o top1000.csv --limit 1000

Use in search results:

openalex-local search "machine learning" --with-if

Formula:

SciTeX IF(Year) = Citations in Year to articles from (Year-1, Year-2)
                  ─────────────────────────────────────────────────────
                  Citable articles published in (Year-1, Year-2)

Note: "SciTeX IF" is our calculation using OpenAlex data. It is not the trademarked "Journal Impact Factor" from Clarivate/JCR.

Related Projects

crossref-local - Sister project with CrossRef data:

Feature crossref-local openalex-local
Works 167M 284M
Abstracts ~21% ~45-60%
Update frequency Real-time Monthly
DOI authority Yes (source) Uses CrossRef
Citations Raw references Linked works
Concepts/Topics No Yes
Author IDs No Yes
Best for DOI lookup, raw refs Semantic search

When to use CrossRef: Real-time DOI updates, raw reference parsing, authoritative metadata. When to use OpenAlex: Semantic search, citation analysis, topic discovery.

Documentation

Full documentation available at openalex-local.readthedocs.io

Data Source

Data from OpenAlex, an open catalog of scholarly works. Updated monthly from their snapshot.

Installation

Recommended: uv pip install openalex-local[all] — uv's Rust resolver handles the SciTeX dep set in 1-3 min where pip's serial backtracker can take 30+ min on the full extras. Plain pip install still works; the install block below shows both.

pip install openalex-local              # core
pip install openalex-local[mcp]         # + MCP server

4 Interfaces

Python API
from openalex_local import search, get, enrich_ids

results = search("neural oscillations", limit=10)
work = get("W2741809807")
enriched = enrich_ids(["W2741809807", "W3000000000"])
CLI
openalex-local search "query"
openalex-local search-by-doi 10.1038/nature12373
MCP Server
openalex-local mcp start
Skills

Agent skill pages live under src/openalex_local/_skills/openalex-local/.

Problem and Solution

# Problem Solution
1 OpenAlex API is the largest open bibliographic database but large-scale use needs caching -- rate limits trip at hundreds of requests/second Local SQLite + FTS5 (284M works) -- offline queries including abstracts, author affiliations, citation counts

Part of SciTeX

openalex-local is part of SciTeX. Install via the umbrella with pip install scitex[scholar] to use as scitex.scholar (Python) or scitex scholar ... (CLI) — openalex-local provides the local OpenAlex backing for scholar's metadata enrichment.

import scitex

results = scitex.scholar.search("neural oscillations gamma band")
scitex.scholar.enrich_bibtex("references.bib")

The SciTeX system follows the Four Freedoms for Research below, inspired by the Free Software Definition:

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.


SciTeX

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openalex_local-0.7.9.tar.gz (80.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openalex_local-0.7.9-py3-none-any.whl (86.0 kB view details)

Uploaded Python 3

File details

Details for the file openalex_local-0.7.9.tar.gz.

File metadata

  • Download URL: openalex_local-0.7.9.tar.gz
  • Upload date:
  • Size: 80.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openalex_local-0.7.9.tar.gz
Algorithm Hash digest
SHA256 47a292bc834d363c93f78b4cb37cefa7e80123da971174f07652b440ec58a5a3
MD5 a7724795ea1c8ae37a55d82aa4e38b17
BLAKE2b-256 047bdae2cb8573364382dee11b1dc655a4fe47c14ab957d73e9bb3154f97b060

See more details on using hashes here.

Provenance

The following attestation bundles were made for openalex_local-0.7.9.tar.gz:

Publisher: pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/openalex-local

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openalex_local-0.7.9-py3-none-any.whl.

File metadata

  • Download URL: openalex_local-0.7.9-py3-none-any.whl
  • Upload date:
  • Size: 86.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openalex_local-0.7.9-py3-none-any.whl
Algorithm Hash digest
SHA256 0396b814a391062a420f5d0230238bbee84ca0d55c2f929b102f5ea407217614
MD5 398a8c3ff8b43856d695b034d15224fe
BLAKE2b-256 3739933977e39104ebfb1a34ba304ba80578aebead5829f94cc0ed148fc28304

See more details on using hashes here.

Provenance

The following attestation bundles were made for openalex_local-0.7.9-py3-none-any.whl:

Publisher: pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/openalex-local

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page