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, andevidence_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.yaml → papers_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:
LITGRAPH_PROJECT_ROOT(MCP / IDE)- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac9c2e6dc219f2ebec0ac7c61d82ab5bbfb2ce177fa8091998aeba51f8d01f22
|
|
| MD5 |
d2682a856f90c70122988df148380c7a
|
|
| BLAKE2b-256 |
5fe863fa1ba23fce4752dd487d24e6e4ef02d19131d8761db93de5945ae8f6da
|
Provenance
The following attestation bundles were made for literature_graph-1.0.1.tar.gz:
Publisher:
publish.yml on takapi-s/LiteratureGraphContext
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
literature_graph-1.0.1.tar.gz -
Subject digest:
ac9c2e6dc219f2ebec0ac7c61d82ab5bbfb2ce177fa8091998aeba51f8d01f22 - Sigstore transparency entry: 2142523016
- Sigstore integration time:
-
Permalink:
takapi-s/LiteratureGraphContext@8135a422a3e483ea48c249d54b2d6d0284b46353 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/takapi-s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8135a422a3e483ea48c249d54b2d6d0284b46353 -
Trigger Event:
release
-
Statement type:
File details
Details for the file literature_graph-1.0.1-py3-none-any.whl.
File metadata
- Download URL: literature_graph-1.0.1-py3-none-any.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51685e2994800109f9c423d15256d277aa9afa8c81e839721bbe629dc594237a
|
|
| MD5 |
f553be2a429d4ade3554c7e27072548e
|
|
| BLAKE2b-256 |
f71c2ef2d1179c7f26ed0843ba82f76eb15f563acf611116147822645e685381
|
Provenance
The following attestation bundles were made for literature_graph-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on takapi-s/LiteratureGraphContext
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
literature_graph-1.0.1-py3-none-any.whl -
Subject digest:
51685e2994800109f9c423d15256d277aa9afa8c81e839721bbe629dc594237a - Sigstore transparency entry: 2142523205
- Sigstore integration time:
-
Permalink:
takapi-s/LiteratureGraphContext@8135a422a3e483ea48c249d54b2d6d0284b46353 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/takapi-s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8135a422a3e483ea48c249d54b2d6d0284b46353 -
Trigger Event:
release
-
Statement type: