Skip to main content

LiteratureGraphContext: structure paper PDFs into a knowledge graph for AI assistants.

Project description

LiteratureGraphContext

Structure paper PDFs into a knowledge graph (Paper, Method, Dataset, Claim, Limitation, Evidence) and expose it via MCP for literature review workflows.

Licensed under the MIT License.

Design philosophy

LiteratureGraphContext is a structured evidence layer for literature review—not an AI that writes your related work or discovers research gaps for you.

What LGC owns

  • Graph connections — Papers link through shared tasks, methods, datasets, citations (CITES), contrasts (CONTRASTS_WITH), and extensions (EXTENDS). Multiple studies stay connected across topics instead of living in isolated PDFs.
  • Evidence-backed facts — Claims, limitations, and contributions are stored with provenance: paper_id, page, section, and evidence_text.
  • MCP as the data plane — Tools return structured lists, comparisons, and matrices grounded in the graph.

What the connected agent owns

  • Interpreting limitations as research gaps
  • Drafting related work prose
  • Open-ended synthesis and recommendations

A typical agent flow:

User: "What are the gaps in prediction research?"

  Agent → search_papers("prediction research")
        → find_limitations("prediction")   # or paper_id= from search
        → explore_paper_graph(paper_id, hops=1|2)
        → compare_papers([...])

  Agent synthesizes the answer, citing paper_id / page / evidence_text from MCP

LGC does not pre-compute narrative conclusions. It makes the graph and evidence reliable enough for agents to reason over. See ROADMAP.md for how known limitations are prioritized under this model.

Documentation

  • Tutorial — install → setup → index → MCP → viz → Zotero (full walkthrough)
  • Roadmap — planned features and known gaps

Quick start

pip install literature-graph
litgraph setup --papers-dir ./my-papers
# or non-interactive:
# litgraph init --papers-dir ./my-papers && litgraph index -y
litgraph serve-mcp

For a clone / development install: pip install -e ".[dev]".

litgraph setup walks through project init, LLM / API keys (~/.litgraph/.env), optional Zotero, MCP client config, and a first index.
litgraph index alone runs scan → parse → extract → build.

For the full flow (including Kuzu single-writer rules and Windows daemon HTTP), see the Tutorial.

Where to put papers

Place PDF, BibTeX, and Markdown note files under your papers folder:

my-papers/
  mobility_gnn_2024.pdf
  mobility_gnn_2024.bib
  mobility_gnn_2024_notes.md

Configure the folder path

Method Command
At init litgraph init --papers-dir ./my-papers
On scan (auto-save) litgraph scan ./my-papers
Explicit set litgraph config set papers_dir ./my-papers
Manual edit .litgraph/config.yamlpapers_dir

Relative paths are resolved from the project root. Absolute paths are also supported.

After setup, litgraph index (or the individual scan / parse / extract / build commands) uses the configured papers_dir when no path argument is given.

Verify MCP tools: litgraph test-mcp

Supported file types

Type Role
.pdf Full parse → LLM extract → graph
.md Paper notes (# Abstract, ## Introduction, etc.) → extract → graph
.bib Metadata only (title, authors, venue, doi) merged into graph at build

Configuration

Each repository has its own project at <repo>/.litgraph/ (config, cache, graph DB). Run litgraph init once per repository before other commands.

Location Purpose
<repo>/.litgraph/config.yaml Project settings (papers_dir, LLM, database)
<repo>/.litgraph/cache/, db/ Per-project scan cache and graph
~/.litgraph/.env Preferred place for API keys (OPENAI_API_KEY, ZOTERO_*, …)
~/.litgraph/logs/ Global log files
<repo>/.env Optional local override (do not commit)

Important: ~/.litgraph is for API keys and logs only—it is not a project. Commands like index / scan require an initialized project under your repository. If you see unexpected paths or split graph data, run litgraph doctor.

Project resolution order:

  1. LITGRAPH_PROJECT_ROOT (MCP / IDE)
  2. Walk up from cwd to find <repo>/.litgraph/config.yaml (skips ~/.litgraph)

Setup & MCP (Cursor)

litgraph setup          # recommended onboarding
# litgraph mcp setup    # alias of the same wizard

Background daemon (optional)

For Zotero auto-sync and to avoid stdio lock conflicts on Windows, run litgraph daemon and choose daemon-http in setup. Details: Tutorial §4 and §7.

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

literature_graph-1.0.1.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

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

literature_graph-1.0.1-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file literature_graph-1.0.1.tar.gz.

File metadata

  • Download URL: literature_graph-1.0.1.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for literature_graph-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ac9c2e6dc219f2ebec0ac7c61d82ab5bbfb2ce177fa8091998aeba51f8d01f22
MD5 d2682a856f90c70122988df148380c7a
BLAKE2b-256 5fe863fa1ba23fce4752dd487d24e6e4ef02d19131d8761db93de5945ae8f6da

See more details on using hashes here.

Provenance

The following attestation bundles were made for literature_graph-1.0.1.tar.gz:

Publisher: publish.yml on takapi-s/LiteratureGraphContext

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

File details

Details for the file literature_graph-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for literature_graph-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51685e2994800109f9c423d15256d277aa9afa8c81e839721bbe629dc594237a
MD5 f553be2a429d4ade3554c7e27072548e
BLAKE2b-256 f71c2ef2d1179c7f26ed0843ba82f76eb15f563acf611116147822645e685381

See more details on using hashes here.

Provenance

The following attestation bundles were made for literature_graph-1.0.1-py3-none-any.whl:

Publisher: publish.yml on takapi-s/LiteratureGraphContext

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