Future-House/paper-qa
Agentic RAG for scientific papers with contextual evidence ranking and inline citations
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
PaperQA2 is a Python RAG library and CLI, not primarily a database server. In the default workflow, an LLM formulates a keyword query to find candidate papers. The pipeline chunks and embeds those documents, retrieves the top k chunks against the embedded question, then has an LLM score and summarize each chunk in context. A re-ranking step selects the summaries used to generate an answer with inline citations.
The agent can repeat or reorder search and evidence gathering; a manual path lets the application control that sequence. The stack includes Tantivy for full-text search, a default NumPy vector store for evidence retrieval, and lmi over LiteLLM for model access. The packages/ workspace lists integrations for Docling, PyMuPDF, and pypdf, while external vector storage is an option rather than a prerequisite.
Key Capabilities & Differentiators
The ingestion scope covers PDFs, text, Microsoft Office documents, and source files, with scientific papers as the main use case. Metadata enrichment can incorporate citation counts and retraction checks, and embeddings can account for document metadata. Answers contain inline references that readers can check against the underlying evidence; the references do not guarantee that the answer interpreted the source correctly.
The default embedding model is OpenAI text-embedding-3-small. Settings.embedding can select a LiteLLM-compatible embedding model, local Sentence Transformers, or sparse and hybrid modes. Settings.answer.evidence_k sets the number of chunks retrieved for re-ranking and contextual summarization. Disabling evidence_retrieval fetches all chunks instead, an option to assess carefully as the corpus grows.
Trade-offs & Limitations
Compared with assembling a pipeline in LlamaIndex or LangChain, PaperQA2 provides a ready-made scientific literature workflow: bibliographic metadata, document search, evidence scoring, and cited answers. The trade-off is that agent search iterations and LLM-based summarization and re-ranking can add variable call counts, latency, and cost. Evaluate citation support and retrieval coverage on your own corpus; citations alone are not a measure of answer quality.
The NumPy backend avoids operating a separate vector service, but vector memory grows with the indexed chunks and embedding dimensions. Index reuse and embedding caching can reduce repeated work. When choosing an external store, benchmark retrieval and concurrency on the intended workload. Self-hosting generation removes that hosted model dependency only; hosted embeddings or bibliographic lookups may still send data outside your environment.
Hardware & Deployment Guide
Use Python 3.11 or newer for PaperQA2. Install paper-qa from PyPI and run pqa ask 'What is PaperQA2?' from a directory containing papers, or embed Settings and ask in a Python application. The default OpenAI path requires OPENAI_API_KEY; for self-hosted inference, configure a LiteLLM-compatible endpoint and select an embedding backend separately. The paper-qa[local] extra supports local embeddings.
For indexing on the order of 100 papers or more, consider CROSSREF_API_KEY and SEMANTIC_SCHOLAR_API_KEY to reduce exposure to public rate limits. Model rate limits can be set separately, for example with the tier1_limits CLI preset. The project moved to calendar versioning in December 2025 without implying backward compatibility across releases. The March 18, 2026 release loosened action typing to Message, and the August 12, 2026 release included a PyMuPDF typing fix. Pin deployments and regression-test integrations before upgrading.
Settings.answer.evidence_k sets the candidate count for re-ranking; disabling evidence_retrieval fetches all chunks instead.hybrid- combines sparse keyword and dense embeddings, while sparse selects keyword embeddings alone.lmi uses LiteLLM for provider access, with separate model settings for generation, summarization, and agent decisions.Research teams and internal knowledge tools that need to question a curated paper collection and trace answers back to cited passages through a CLI or Python API.
You mainly need a standalone vector database, a turnkey multi-tenant HTTP service, or a strictly offline deployment without separately configuring model, embedding, and metadata dependencies.
Quick Start & Installation
pip install paper-qa mkdir my_papers curl -o my_papers/PaperQA2.pdf https://arxiv.org/pdf/2409.13740 cd my_papers pqa ask 'What is PaperQA2?'
Comparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| paper-qa ★ | 9.7k | +62 | Python | Apache-2.0 | Agentic RAG for scientific papers with contextual evidence ranking and inline ci |
| crawl4ai | 88.5k | +408 | Python | Apache-2.0 | Async browser crawler that turns web pages into Markdown and JSON for RAG |
| graphrag | 36.8k | +68 | Python | MIT | A graph-based RAG pipeline for answering questions across documents |
| graphiti | 33.3k | +143 | Python | Apache-2.0 | Temporal graph framework for agent memory with traceable, evolving facts |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/Future-House/paper-qa.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about paper-qa
How do I integrate PaperQA2 without handing search control to an agent?
from paperqa import Settings, ask to embed the question-answering workflow in a Python application. Use the manual, non-agent path if your application should control document selection and query sequencing. The Python API is an integration surface, not evidence of a bundled HTTP service.What hardware and VRAM should I budget for?
Can we use PaperQA2 commercially and run it on our own infrastructure?
When would I choose PaperQA2 over LlamaIndex or LangChain?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy