paper-qa

Future-House/paper-qa

High accuracy RAG for answering questions from scientific documents with citations

8.8k
Stars
887
Forks
140
Open issues
61
Watchers
Python Apache-2.0Last pushed Jun 29, 2026

Overview

PaperQA2 is a Python package designed to enhance retrieval augmented generation (RAG) on various document types, particularly focusing on scientific literature. It aims to achieve superhuman performance in tasks such as question answering and summarization.

Categories

Tags

Similar tools

Install

pip install paper-qa

README

PaperQA2

PaperQA2 is a package for doing high-accuracy retrieval augmented generation (RAG) on PDFs, text files, Microsoft Office documents, and source code files, with a focus on the scientific literature. See our recent 2024 paper to see examples of PaperQA2's superhuman performance in scientific tasks like question answering, summarization, and contradiction detection.


Table of Contents

  • Quickstart
    • Example Output
  • What is PaperQA2
    • PaperQA2 vs PaperQA
    • PaperQA2 Goes CalVer in December 2025
    • What's New in Version 5 (aka PaperQA2)?
    • What's New in December 2025?
    • PaperQA2 Algorithm
  • Installation
  • CLI Usage
    • Bundled Settings
    • Rate Limits
  • Library Usage
    • Agentic Adding/Querying Documents
    • Manual (No Agent) Adding/Querying Documents
    • Async
    • Choosing Model
      • Locally Hosted
    • Embedding Model
      • Specifying the Embedding Model
      • Local Embedding Models (Sentence Transformers)
    • Adjusting number of sources
    • Using Code or HTML
    • Multimodal Support
    • Using External DB/Vector DB and Caching
    • Creating Index
      • Manifest Files
    • Reusing Index
    • Using Clients Directly
  • Settings Cheatsheet
  • Where do I get papers?
  • Callbacks
    • Caching Embeddings
  • Customizing Prompts
    • Pre and Post Prompts
  • FAQ
    • How come I get different results than your papers?
    • How is this different from LlamaIndex or LangChain?
    • Can I save or load?
  • Reproduction
  • Citation

Quickstart

In this example we take a folder of research paper PDFs, magically get their metadata - including citation counts with a retraction check, then parse and cache PDFs into a full-text search index, and finally answer the user question with an LLM agent.

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?'

Example Output

Question: Has anyone designed neural networks that compute with proteins or DNA?

The claim that neural networks have been designed to compute with DNA is supported by multiple sources. The work by Qian, Winfree, and Bruck demonstrates the use of DNA strand displacement cascades to construct neural network components, such as artificial neurons and associative memories, using a DNA-based system (Qian2011Neural pages 1-2, Qian2011Neural pages 15-16, Qian2011Neural pages 54-56). This research includes the implementation of a 3-bit XOR gate and a four-neuron Hopfield associative memory, showcasing the potential of DNA for neural network computation. Additionally, the application of deep learning techniques to genomics, which involves computing with DNA sequences, is well-documented. Studies have applied convolutional neural networks (CNNs) to predict genomic features such as transcription factor binding and DNA accessibility (Eraslan2019Deep pages 4-5, Eraslan2019Deep pages 5-6).