Skip to main content

MarginaliaAI

Give AI agents access to the books and papers you trust—not just what they remember.

Much of the information researchers rely on lives outside the open web: in books, journals, archives, scans, research collections, and licensed databases. MarginaliaAI turns sources you are authorized to use into a searchable, citable corpus exposed through the Model Context Protocol (MCP). Agents can search the actual sources, inspect relevant passages, and cite exact locations in the canonical document.

The marginalia-ai distribution includes the CLI, PostgreSQL schema and migrations, MCP server, remote inference clients, lightweight text ingestion, extraction, entity and event services, and plugin host.

Developer preview: MarginaliaAI requires PostgreSQL 15 or newer. Plugins are installed separately and must be explicitly audited and enabled. Integrations use accounts you are authorized to access; MarginaliaAI does not redistribute licensed source content.

The base distribution does not install PostgreSQL, database extensions, local ML models, Docling, GPU drivers, or third-party plugins.

Install

python -m pip install marginalia-ai
# Everything, including local inference and document AI:
python -m pip install "marginalia-ai[full]"

Optional features are independently installable:

  • marginalia-ai[openai] — OpenAI-compatible LLM adapter;
  • marginalia-ai[local-inference] — sentence-transformers embedding and reranking;
  • marginalia-ai[documents] — PDF text, EPUB, HTML, and TEI parsers;
  • marginalia-ai[document-ai] — Docling layout/OCR and office/image conversion;
  • marginalia-ai[embed-server] — FastAPI/Uvicorn plus its local inference runtime.

Local inference and Docling may download multi-gigabyte models and can require substantial disk, RAM, and GPU capacity. A standard PyPI install does not select PyTorch's alternate CPU wheel index; follow PyTorch's CPU installation instructions first when required.

Published plugins

Plugins are separate distributions installed into the same environment as marginalia-ai. The currently published 0.6.x plugin family is:

Distribution Plugin ID Purpose
marginalia-ai-plugin-history 0.2.0 history Correspondence schemas and analysis tools
marginalia-ai-plugin-logos 0.2.0 logos Logos search, reference tools, and licensed-book ingestion
marginalia-ai-plugin-academic-journal 0.2.0 academic-journal Scholarly discovery, acquisition, search, and citation graphs
marginalia-ai-plugin-yourcloudlibrary 0.3.0 yourcloudlibrary Library catalog search and borrowed-book ingestion

Kindle is not published on PyPI. Install any subset, or all published plugins:

python -m pip install \
  marginalia-ai-plugin-history \
  "marginalia-ai-plugin-logos[auth]" \
  marginalia-ai-plugin-academic-journal \
  marginalia-ai-plugin-yourcloudlibrary
# Needed only for Logos sign-in and YourCloudLibrary:
python -m playwright install chromium

Provider authentication is a separate, explicit step:

logos-login
research-engine-ycl-login

Installation makes static manifests discoverable but imports no plugin code. Audit and enable the exact installed artifacts, migrate the two plugins that own database tables, then restart the MCP server:

research-engine plugin list
research-engine plugin audit history
research-engine plugin audit logos
research-engine plugin audit academic-journal
research-engine plugin audit yourcloudlibrary
research-engine plugin enable history
research-engine plugin enable logos
research-engine plugin enable academic-journal
research-engine plugin enable yourcloudlibrary
research-engine plugin migrate logos
research-engine plugin migrate academic-journal
research-engine plugin doctor

Enabled tools are advertised to MCP clients from each static manifest. Agents should follow those tool descriptions instead of guessing parameters. See the complete plugin lifecycle and pipx instructions.

Database

Use PostgreSQL 15 or newer with vector, pg_trgm, and ltree available. Creating extensions may require an elevated database role. Set the async URL explicitly:

export RE_DB_URL='postgresql+asyncpg://user:password@localhost:5432/research_engine'
research-engine db upgrade
research-engine doctor

Runtime commands refuse an outdated schema and report the exact upgrade command; they never migrate the database implicitly.

pg_dump and pg_restore are external requirements. Backups include every database schema:

research-engine backup create corpus.dump
research-engine backup restore corpus.dump

Run over MCP

{
  "mcpServers": {
    "research-engine": {
      "type": "stdio",
      "command": "research-engine",
      "args": ["serve"]
    }
  }
}

No checkout or repository working directory is required. research-engine --help and research-engine config --help describe the installed command surface.

Data and trust

Remote LLM providers receive prompts and selected corpus text and may charge per token. Review provider settings and budgets before ingestion or extraction.

Plugins are ordinary Python distributions. Installation makes their static manifests available; research-engine plugin enable ID displays and records the exact version, hash, contributions, and permissions before code is imported. Enabled plugins execute in-process. Scoped clients are the supported API boundary, not a security sandbox; enable only trusted artifacts.

See the documentation, changelog, issues, and Apache-2.0 license.

Release files for marginalia-ai 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for marginalia-ai 0.6.2
File Size Uploaded
marginalia_ai-0.6.2.tar.gz 346.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for marginalia-ai 0.6.2
File Interpreter ABI Platform
marginalia_ai-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 843.8 kB

Release files / marginalia_ai-0.6.2.tar.gz

Download URL marginalia_ai-0.6.2.tar.gz
Size 346.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2902127286ab3713511a3e64c3292908fa9abc3d78f359bdf46c256e76a931db
BLAKE2b-256 checksum
How to use checksums
5c1bf6e7edd040dfa77f61e0edcb430822a146285f98a6347608267b6a124725
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release files / marginalia_ai-0.6.2-py3-none-any.whl

Download URL marginalia_ai-0.6.2-py3-none-any.whl
Size 497.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4db113c4dbecf3fc69ffa394af3b623a9742aab51d5ab5f4a507d0f3af420293
BLAKE2b-256 checksum
How to use checksums
8ce4292efa2d634dc4c843e5fa1d111122e4fc7ba9ab83d7b716fd24ef15fb64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page