paper-qa
Use PaperQA/PaperQA2 for scientific literature RAG, document parsing, metadata hydration, CLI indexing, Settings configuration, and external paper/trial source workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- paper-qa
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use PaperQA/PaperQA2 for scientific literature RAG, document parsing, metadata hydration, CLI indexing, Settings configuration, and external paper/trial source workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/repo-provenance.md5.1 KB
- 参考文档references/repo-routing-metadata.json504 B
- 参考文档references/troubleshooting.md4.4 KB
- 脚本scripts/check_paperqa_env.py5.5 KB
03 SKILL.md 正文
PaperQA Repo Skill
Use this repo skill when a task involves PaperQA/PaperQA2: high-accuracy retrieval-augmented question answering over scientific papers and local documents, the pqa CLI, document parsing/chunking, metadata providers, named Settings, model/embedding configuration, and literature-source helpers.
Install and readiness
PaperQA requires Python 3.11+. For normal use install the public package:
python -m pip install "paper-qa>=5"
Use optional extras only for the workflows you need:
python -m pip install "paper-qa[local]" # sentence-transformers local embeddings
python -m pip install "paper-qa[qdrant]" # Qdrant vector store
python -m pip install "paper-qa[office]" # docx/xlsx/pptx parsing
python -m pip install "paper-qa[pymupdf]" # PyMuPDF PDF reader
python -m pip install "paper-qa[docling]" # Docling PDF reader
python -m pip install "paper-qa[nemotron]" # NVIDIA nemotron-parse reader API
python -m pip install "paper-qa[zotero]" # Zotero helper
python -m pip install "paper-qa[openreview]" # OpenReview helper
Minimal import check:
python - <<'PY'
import paperqa
from paperqa import Docs, Settings
print(paperqa.__version__)
print(Settings().answer.evidence_k)
PY
For a broader no-network readiness check, run scripts/check_paperqa_env.py.
Choose a sub-skill
| Task intent | Read |
|---|---|
Use Python APIs such as Docs, ask, agent_query, Docs.aadd_texts, Docs.aget_evidence, Docs.aquery, callbacks, contexts, answers, or sessions |
agentic-rag |
| Parse and chunk PDFs, text, Markdown/code, HTML, Office docs, images, multimodal media, or choose a PDF reader extra | docs-and-parsing |
Operate the pqa CLI, build/search/reuse indexes, validate manifest CSVs, manage PQA_HOME, or inspect CLI flags |
cli-and-indexing |
Configure Settings, named configs, LiteLLM providers, local model servers, embeddings, prompts, vector stores, or optional dependency choices |
settings-and-configuration |
| Use metadata clients, DOI/title hydration, Crossref/Semantic Scholar/OpenAlex/Unpaywall, ClinicalTrials.gov, OpenReview, or Zotero helpers | metadata-and-sources |
Common operating routes
- For a local folder of PDFs and a natural-language question, use
pqa askorpaperqa.askafter configuring provider credentials and index paths. - For a controlled Python pipeline, build a
Docs()object, addDoc/Textobjects or local files, then callawait docs.aget_evidence(...)orawait docs.aquery(...). - For no-network tests, use pre-chunked
Textobjects withSettings(parsing={"defer_embedding": True})and the bundled smoke scripts; do not treat these as answer-quality validation. - For custom providers, update every active model role:
llm,summary_llm,agent.agent_llm,embedding, and any parser enrichment LLM. - For reproducible indexes, set
PQA_HOMEoragent.index.index_directory, decide whether the paper directory should remain relative, and validate manifest CSVs before long indexing runs.
Cross-cutting cautions
- Default answering workflows call LLM, embedding, and sometimes metadata-provider services. Confirm credentials, network policy, rate limits, and cost before running
pqa ask,Docs.aquery,ask, oragent_query. - Passing citation/title/DOI metadata and disabling metadata hydration can prevent unintended metadata-provider calls during controlled local ingestion.
- Optional parser extras vary by dependency weight, service credentials, output quality, and license; choose them deliberately rather than installing all extras.
- If a task names PaperQA source staleness or repository edits, first read references/repo-provenance.md and compare the current package/repo version to this skill's baseline.
- For install/import/provider/index failures that cut across sub-skills, use references/troubleshooting.md before drilling into workflow-specific troubleshooting.
Provenance and routing metadata
- references/repo-provenance.md records the source version, branch/tag, package version, and evidence paths used to build this skill.
- references/repo-routing-metadata.json contains structured scenario metadata for managed
repo-skills-routerimport.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).