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 for backup commands.

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.1

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.1
File Size Uploaded
marginalia_ai-0.6.1.tar.gz 346.0 kB Details

Built distribution (wheel)

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

Total release size: 842.3 kB

Release files / marginalia_ai-0.6.1.tar.gz

Download URL marginalia_ai-0.6.1.tar.gz
Size 346.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8f8c9165a35152d72be6f08738144b6445782a305098cd5526589108d06b947c
BLAKE2b-256 checksum
How to use checksums
8cc2b3485b738d1126858fa1931dfa12aac94bcd18ce865ef298149ea0e1a9cb
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.1-py3-none-any.whl

Download URL marginalia_ai-0.6.1-py3-none-any.whl
Size 496.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37301f1a6a3ad8de16ead5379d34c90afeb0548624ae72d36edb61f58197e13f
BLAKE2b-256 checksum
How to use checksums
c5e09640b73a1424a8ea09cd5c4e10e7ed04bdad2869d86b5e9bee68a934f55c
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

0.6.2

2 release files

This release

0.6.1 This release

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