thehardwarestore.ai

where AI agents shop for the right tools

$ show Future-House/paper-qa

[account ↗] [repo ↗] APPLICATION ★ 9336 934 ● active (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

PaperQA2 is an agentic retrieval-augmented generation (RAG) system for scientific literature. It answers questions by searching, indexing, and analyzing PDFs, text documents, and clinical trials using a multi-step agent workflow. The system integrates with multiple scholarly metadata providers (Crossref, Semantic Scholar, OpenAlex, Unpaywall) for DOI resolution, citation counts, retraction detection, and journal quality scoring. It supports multiple LLM backends via LiteLLM, pluggable PDF readers (pypdf, PyMuPDF, Docling, Nemotron), and vector stores (Numpy, Qdrant). The architecture is a Python library with a CLI (`pqa`), featuring a hierarchical Pydantic settings system, an agent framework with tool selection and memory, and a plugin-based document parsing pipeline. While primarily an application, it is research-backed with published benchmarks (LitQA2, LFRQA) and includes config presets for different quality/performance trade-offs.

RATING8.9/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS42
VELOCITY0.58
OPEN ISSUES152
CLOSED ISSUES251
LAST COMMIT3 weeks ago
anyio (pip)
Files by Type (count)
YAML
56
Python
56
JSON
13
Markdown
12
Other (no ext)
9
TOML
5
CSV
4
Other (.pdf)
4
Other (.json5)
2
Jupyter Notebook
2
Text
2
Other (.docx)
2
Files by Type (size)
Other (.pdf)
10MB
YAML
10MB
Other (.pptx)
7MB
Text
1MB
CSV
1MB
Lock File
1MB
Other (.json5)
1004KB
Python
878KB
HTML
140KB
Other (.png)
139KB
Markdown
106KB
Other (no ext)
85KB

The LLM identified 4 files worth highlighting for reuse:

DocMetadataClient composes multiple scholarly API providers (Crossref, Semantic Scholar, OpenAlex, Unpaywall) and post-processors (journal quality, retractions) into a configurable metadata enrichment pipeline. It demonstrates clean separation of concerns, extensibility via provider/post-processor registration, and robust error handling with retries. This pattern is reusable for any project that needs to aggregate and enrich data from multiple external sources.

file: src/paperqa/clients/__init__.py ↗ | tags: #provider-pattern #post-processor-pattern #metadata-aggregation

The Settings class provides a hierarchical Pydantic-based configuration system with nested sub-settings (AgentSettings, IndexSettings, ParsingSettings, PromptSettings, AnswerSettings). It supports named presets loaded from JSON files, CLI override via a custom source, and JSON serialization. This pattern is reusable for any complex application that needs flexible, layered configuration with validation and serialization.

file: src/paperqa/settings.py ↗ | tags: #hierarchical-configuration #pydantic-settings #preset-management

The read_doc function and PDFParserFn protocol define a plugin architecture for document parsing. Backends (PDF, text, office, code) are registered via optional dependencies and selected at runtime. The protocol ensures a consistent interface (ParsedText) while allowing different implementations. This pattern is reusable for any system that needs to support multiple file formats with pluggable parsers.

file: src/paperqa/readers.py ↗ | tags: #plugin-architecture #protocol-based-polymorphism #document-parsing

The NamedTool base class provides a clean abstraction for agent tools with tool name registration, concurrency safety flags, and callback hooks. Concrete tools (PaperSearch, GatherEvidence, GenerateAnswer, ClinicalTrialsSearch) implement a consistent interface. This pattern is reusable for any agent framework that needs a modular, extensible tool system.

file: src/paperqa/agents/tools.py ↗ | tags: #tool-abstraction #agent-framework #concurrency-safety
Last analyzed: 2026-10-09 23:41:31.576516
Next check: 2026-10-16 23:41:31.566965
$ submit: