Favicon of PaperQA2

PaperQA2

A Python research assistant that answers questions with citations from local documents. Supports self-hosted models through LiteLLM; licensed under Apache 2.0.

PaperQA2 is an open source Python research assistant for people who need answers grounded in a collection of scientific papers. It searches documents on your machine and writes answers with in-text citations, including page references. Researchers can use it to summarize findings or check for contradictions across papers, while developers can build it into their own research tools.

Its AI agent can revise searches and gather more evidence before answering. It ranks passages for relevance and summarizes them in the context of your question, so the answer draws on selected evidence rather than whole documents alone. Paper metadata also informs retrieval. Automatic lookups through services such as Semantic Scholar and Crossref supply citation and journal information, with retraction checks available during indexing.

PDFs aren't the only input. PaperQA2 also reads text, Microsoft Office documents, HTML and source code. Its document readers handle figures, tables, mathematical equations and non-English text. A local full-text index supports searches across your collection, and it stores past answers for later retrieval.

The package runs locally, but its default OpenAI models and embeddings use cloud APIs. It also supports self-hosted LLMs, including servers using llamafile, through LiteLLM, plus local Sentence Transformers embeddings. Local model support doesn't remove the external metadata lookups. PaperQA2 is licensed under Apache 2.0 and provides both a command-line interface and a Python library.

Similar to PaperQA2