Paper Library Kit
Paper Library Kit (plk)
Stop letting AI coding agents hallucinate DOIs and burn tokens reading raw PDFs.

paper-library-kit is a Git-native, verbatim-verified literature knowledge graph, PDF-to-Markdown pipeline, and proactive debugging hook designed for Claude Code, Codex, Cursor, and Perplexity/Gemini research workflows.
English | 繁體中文版說明 (Traditional Chinese) | Live Interactive Evolution Graph Demo (16 Real AI-Agent/RAG Papers)
Why This Exists
Standard reference managers (Zotero, Mendeley) are built for humans, while naive vector RAG stores often fail in rigorous engineering and academic workflows:
Common AI Failure Mode | How |
Fabricated DOIs during deep-research surveys |
|
Token bloat & garbled columns when agents read raw PDFs |
|
Hallucinated numbers & unit swaps in summaries |
|
Isolated paper lists with no technical lineage |
|
Forgetting relevant papers while debugging |
|
Related MCP server: surveyHelper
5-Stage Pipeline
flowchart LR
S1["1. Survey & Gaps\nplk lit / verify / chain / gap"] --> S2["2. PDF to AI-Readable\nplk ingest / ocr / audit-pdfs"]
S2 --> S3["3. Verbatim Cards & Tags\nplk cards / check / meta-health"]
S3 --> S4["4. Relation Graph & Timeline\nplk backfill / cites / graph build"]
S4 --> S5["5. Retrieval & Proactive Hooks\nplk search / neighbors / paper_hint.py"]Real Anti-Hallucination Catch Examples
Catching misquoted metrics before they enter your notes (
plk check):✗ [數字查無] M05: 5 datasets @ plug-and-play retrieval correction evaluation ✗ [引句無此數值] M05: 5 «Experiments on five datasets demonstrate that CRAG»If the paper text says
"five datasets"and an LLM rewrites"5", or attaches a model number likeSM15T30Aas30 A,check_core_tags.pyrejects it immediately.Catching LLM-hallucinated DOIs (
plk verify survey_notes.md):| Verdict | Sim | DOI | Crossref Actual Title | In Lib | |----------------------|------|----------------------------|-------------------------------------------|--------| | OK | 1.00 | 10.48550/arxiv.2210.03629 | ReAct: Synergizing Reasoning and Acting | M01 | | DOI 錯(指到別篇) | 0.14 | 10.1109/jssc.2020.9999999 | Unrelated Journal Article | — |
Quick Start (5 Minutes)
1. Install the plk CLI
git clone https://github.com/Debiddo0506/paper-library-kit.git
cd paper-library-kit
pip install -e ".[all]" # or `pip install -e .` without optional extrasOptional system packages for scanned PDFs:
poppler-utils(pdftoppm/pdftotext) andtesseract-ocr.
Optional environment variable for high-rate OpenAlex queries:export OPENALEX_API_KEY=...
2. Initialize a Project
plk init ./my-research
cd my-researchEdit config/paper_config.yaml for your domain (topics, themes swimlanes, controlled vocab, aliases, and local pdf_archive_dir).
3. Try the 16-Paper Real Demo Immediately
python examples/demo_build.py
# Open examples/demo_evo_graph.html in your browserCLI & Prompt Reference
Unified plk Commands (also runnable via python papers/tools/*.py)
Stage | Commands | Purpose |
1. Survey |
| Crossref/OpenAlex search, DOI anti-hallucination verification, citation chains, problem-gap scan |
2. Convert |
| PDF -> |
3. Verify |
| Build |
4. Graph |
| Batch relation backfill, 4-source citation audit ( |
5. Retrieve |
| Multi-signal search (problem ID, vocab, alias, |
Ready-to-Use Prompt Templates
English:
prompts/en/(00_AGENT_LITERATURE_RULES.mdthrough05_PROMPT_RELATION_NETWORK.md)繁體中文:
prompts/(00_AGENT_LITERATURE_RULES.mdthrough05_PROMPT_RELATION_NETWORK.md)
Local MCP Server
Install the optional MCP extra from this checkout.
pip install '.[mcp]'Start the stdio server with plk mcp --project-dir /absolute/path/to/my-research.
Without --project-dir, plk looks for the library from the current working
directory. Point it at a trusted, initialized local library. The server runs
that library's existing query scripts and reads its local index.
Clients that use mcpServers can launch it with this configuration.
{
"mcpServers": {
"paper-library": {
"command": "/absolute/path/to/plk",
"args": ["mcp", "--project-dir", "/absolute/path/to/my-research"]
}
}
}The client can discover and call four read-only tools.
Tool | Example arguments |
|
|
|
|
|
|
|
|
Each tool returns the corresponding CLI --json value in a result field.
For full-text queries, pass "fulltext": true with terms. For indexed
queries, search also accepts block and text. Graph tools include citation
edges by default. A disconnected path returns {"result": null}.
Development, Tests & Contributing
python -m unittest discover -s tests -vSee ROADMAP.md for good first issue ideas (Marker/Docling backend, BibTeX/Zotero importer, MCP server wrapper, Obsidian exporter, domain presets) and CONTRIBUTING.md for guidelines.
License
MIT License — see LICENSE. Never commit copyrighted PDFs or private API keys to a public repository.
Available Tools
4 toolsneighborsCRead-only
Traverse the paper graph from a paper ID up to the given depth.
Inputs: paper_id (required), depth, include_cites. Returns: object
pathBRead-only
Find the shortest graph path between two paper IDs, or return null.
Inputs: end_id (required), start_id (required), include_cites. Returns: object
searchCRead-only
Search by terms, problem ID, block, or text. Full-text mode searches paper Markdown.
Inputs: text, block, limit, terms, +1 more. Returns: object
showCRead-only
Read the indexed card for a paper ID.
Inputs: paper_id (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a distinct role: show retrieves a card, search queries, neighbors expands a subgraph, and path computes a pairwise route. The only mild overlap is between neighbors and path, since both traverse the graph, but the descriptions make the boundary clear enough.
All names are short lowercase single words, which is internally consistent. However, show and search are verbs while neighbors and path are nouns, a minor deviation from a strict verb_noun pattern.
Four tools is lean but well-matched to a focused paper-graph query kit; each tool earns its place. It sits at the low end of the ideal range, so slightly thin but not a mismatch.
The surface covers lookup, search, and graph traversal, but lacks any listing or enumeration operation to discover paper IDs, and has no write/index operation to add papers. An agent can work around the discovery gap only if it already knows a paper ID.
Maintenance
Related MCP Connectors
Repository knowledge graph MCP server for codebase understanding and debugging.
Personal knowledge base MCP server with semantic search, auto-categorization, metadata extraction
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Zotero MCP server for Claude and ChatGPT: search, citations, safe writes, PDF passages and pages.
Related MCP Servers
- FlicenseAqualityAmaintenanceScholar MCP connects your agent to academic search, citations, primary text and figures, and an optional local research library. Source keys are optional.6297 PyPI11-
- AlicenseNot gradedqualityCmaintenanceA local-first MCP server that analyzes research papers, maps citation graphs, and surfaces insights with verbatim-verified contradictions, all while keeping data private on your machine.1MIT
- FlicenseNot gradedqualityDmaintenanceAn in-memory knowledge graph MCP server that gives coding agents structural and semantic recall over codebases by indexing Python source, ADR documents, and project configuration, exposing 7 tools for search, traversal, context retrieval, and natural-language Q&A.-
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server for indexing and searching research materials (papers, notes, logs, READMEs) using SQLite FTS, with tools for memory management and evidence retrieval.MIT