Metis · Librarian — Index Library Pdfs
index_library_pdfsBuild or rebuild a PaperQA2 index over your PDF library so queries can retrieve cited answers without re-reading every file. Run after adding papers or force a 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 |
|---|---|---|---|
| scope | No | default | |
| topic_filter | No | ||
| force_reindex | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |