index_library_pdfs
Index your PDF library with PaperQA2 for fast, cited answers. Supports topic filtering and multiple scopes. Run after adding new papers or with force_reindex to rebuild.
Instructions
Build or rebuild a PaperQA2 index over the user's PDF library.
Walks knowledge/library/ (all subdirectories), collects PDFs, and indexes
them with PaperQA2 + Claude Haiku. The index is persisted so that
ask_library() can query it without re-reading every PDF.
Run once after adding new papers, or with force_reindex=True to rebuild.
Args:
force_reindex: Rebuild from scratch even if an index already exists.
topic_filter: If given, only index PDFs whose parent folder name
contains this string (e.g. "NTD", "Epidemiology", "Methods").
scope: Which library to index. "default" = knowledge/library/ (all PDFs).
"ph_library" = knowledge/library/ph-background/ (public health background).Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force_reindex | No | ||
| topic_filter | No | ||
| scope | No | default |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |