papi

hummat's avatarfrom hummat

Help with paper references using paperpipe (papi). Use when user asks about papers, wants to verify code against a paper, needs paper context for implementation, or asks about equations/methods from literature.

⭐2stars🔀0forks📁View on GitHub🕐Updated Dec 30, 2025

When & Why to Use This Skill

The papi (Paperpipe) skill is a specialized academic reference assistant designed to bridge the gap between scientific literature and practical implementation. It enables users to manage, search, and extract deep technical insights from research papers, facilitating precise code verification against mathematical equations and providing RAG-based (Retrieval-Augmented Generation) synthesis for complex scientific queries.

Use Cases

  • Code Verification: Comparing local code implementations with mathematical formulas and TeX definitions extracted directly from arXiv papers to ensure algorithmic accuracy.
  • Implementation Guidance: Retrieving high-level summaries and technical notes from specific papers to guide the architectural design of software based on state-of-the-art research.
  • Literature Synthesis: Using RAG-powered tools like PaperQA2 or LEANN to answer complex questions across a database of multiple research papers.
  • Knowledge Management: Building and querying a searchable local database of academic papers imported via arXiv IDs, URLs, or BibTeX files for instant contextual reference.
namepapi
descriptionHelp with paper references using paperpipe (papi). Use when user asks about papers, wants to verify code against a paper, needs paper context for implementation, or asks about equations/methods from literature.
allowed-toolsRead, Bash, Glob, Grep

Paper Reference Assistant

Use when user mentions papers, arXiv IDs, equations, or "does this match the paper?"

Setup

papi path   # DB location (default ~/.paperpipe/; override via PAPER_DB_PATH)
papi list   # available papers

Decision Rules (Cheapest First)

  1. papi show <paper> -l eq|tex|summary — prints to stdout
  2. MCP tools for "top passages about X":
    • leann_search(index_name, query, top_k) — fast, returns snippets
    • retrieve_chunks(query, index_name, k) — slower, formal citations
    • Check indexes: leann_list() or list_pqa_indexes()
    • Embedding priority: Voyage AI → Google/Gemini → OpenAI → Ollama
  3. papi ask — only when user explicitly requests RAG synthesis

Code Verification

  1. papi show {name} -l eq — compare symbols with implementation
  2. papi show {name} -l tex — exact definitions if ambiguous
  3. papi notes {name} — implementation gotchas

Implementation Guidance

  1. papi show {name} -l summary — high-level approach
  2. papi show {name} -l eq — formulas to implement
papi search --rg "query"              # exact text (fast, no LLM)
papi search --rg --regex "pattern"    # regex (OR, wildcards)
papi search "query"                   # ranked BM25
papi search --hybrid "query"          # ranked + exact boost
papi ask "question"                   # PaperQA2 RAG
papi ask "question" --backend leann   # LEANN RAG

Adding Papers

papi add 2303.13476                   # arXiv ID
papi add https://arxiv.org/abs/...    # URL
papi add --pdf /path/to.pdf           # local PDF
papi add --pdf "https://..."          # PDF from URL
papi add --from-file papers.bib       # bulk import

Per-Paper Files

Located at {db}/papers/{name}/:

File Best For
equations.md Code verification
summary.md Understanding approach
source.tex Exact definitions
notes.md Implementation gotchas
figures/ Architecture diagrams, plots

If agent can't read ~/.paperpipe/, export to repo: papi export <papers...> --level equations --to ./paper-context/ Use --figures to include extracted figures in export.

See commands.md for full reference.