# Repository Briefing: Future-House/paper-qa
> Source: https://repoforai.com/repo/Future-House/paper-qa (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/Future-House/paper-qa
- **Official Docs / Website**: https://futurehouse.gitbook.io/futurehouse-cookbook
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: Python
- **License**: Apache-2.0
- **Engineering Health**: A+ (92/100 · Maintenance 35/35 · Adoption 20/25 · Releases 17/20 · License 20/20)
- **Latest Release**: v2026.08.12 (2026-08-12) — https://github.com/Future-House/paper-qa/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: CLI, API, Local AI
- **Momentum**: 9,736 ★ total (+3 24h / +62 7d) · 969 forks
- **Topics**: `ai`, `rag`, `science`, `search`
- **When to Use**: Best for: 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. Skip if: 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.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Search layers: A local full-text index finds candidate papers; the default NumPy vector store ranks document chunks for evidence.
- Evidence controls: `Settings.answer.evidence_k` sets the candidate count for re-ranking; disabling `evidence_retrieval` fetches all chunks instead.
- Retrieval modes: `hybrid-` combines sparse keyword and dense embeddings, while `sparse` selects keyword embeddings alone.
- Model routing: `lmi` uses LiteLLM for provider access, with separate model settings for generation, summarization, and agent decisions.
- Bibliographic metadata: Crossref, Semantic Scholar, and Unpaywall are part of the metadata integration stack; multiple providers reduce reliance on a single lookup source.
- Index lifecycle: The CLI indexes local papers, and the library supports index reuse, embedding caching, and external storage integrations.
```

## Quick Start / Clone
```bash
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?'
```
