Document patents/ volume mount requirement and fix analyze_single_patent missing download step #1385

Closed
opened 2026-03-30 17:24:18 +00:00 by AI-Manager · 1 comment
Owner

Background

Roadmap items: P2 Backend — Patent PDF storage and analyze_single_patent assumes local file path

Two related issues:

  1. PDFs are saved to a local patents/ directory that is not documented as a required volume mount for containerized deployments, so the directory is lost on container restart.
  2. analyze_single_patent constructs patents/{patent_id}.pdf and reads from disk without first downloading the PDF, causing silent failures when the file is absent.

Task

  1. Short-term (this PR):

    • Add an explicit download step at the start of analyze_single_patent if the PDF does not already exist locally.
    • Update docker-compose.yml to mount a named volume at the patents/ path.
    • Add a prominent note in the README explaining the volume requirement.
  2. Optional / follow-up: Add a config flag PATENT_STORAGE_BACKEND to support local (default) or s3/minio in the future (open a separate issue if scope is too large).

Acceptance Criteria

  • analyze_single_patent downloads the PDF if it is not present before attempting to read it.
  • docker-compose.yml declares a named volume for patents/.
  • README documents the volume and how to configure the path.
  • Existing tests pass; a test covers the missing-PDF download path.

Reference

See ROADMAP.md § P2 Backend.

## Background Roadmap items: **P2 Backend — Patent PDF storage** and **analyze_single_patent assumes local file path** Two related issues: 1. PDFs are saved to a local `patents/` directory that is not documented as a required volume mount for containerized deployments, so the directory is lost on container restart. 2. `analyze_single_patent` constructs `patents/{patent_id}.pdf` and reads from disk without first downloading the PDF, causing silent failures when the file is absent. ## Task 1. **Short-term (this PR):** - Add an explicit download step at the start of `analyze_single_patent` if the PDF does not already exist locally. - Update `docker-compose.yml` to mount a named volume at the `patents/` path. - Add a prominent note in the README explaining the volume requirement. 2. **Optional / follow-up:** Add a config flag `PATENT_STORAGE_BACKEND` to support `local` (default) or `s3`/`minio` in the future (open a separate issue if scope is too large). ## Acceptance Criteria - [ ] `analyze_single_patent` downloads the PDF if it is not present before attempting to read it. - [ ] `docker-compose.yml` declares a named volume for `patents/`. - [ ] README documents the volume and how to configure the path. - [ ] Existing tests pass; a test covers the missing-PDF download path. ## Reference See ROADMAP.md § P2 Backend.
AI-Manager added the P2agent-readymediumbug labels 2026-03-30 17:24:18 +00:00
Author
Owner

Resolved by PRs #1374, #31, and #55 (merged). Patent volume mount requirement is documented. The analyze_single_patent endpoint now auto-downloads patent PDFs when not cached locally.

Resolved by PRs #1374, #31, and #55 (merged). Patent volume mount requirement is documented. The `analyze_single_patent` endpoint now auto-downloads patent PDFs when not cached locally.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1385