Skip to content

feat(research-library): library-acquisition skill + consolidated PDF extractor - #2

Open
Fede654 wants to merge 1 commit into
Mar-IA-no:mainfrom
Fede654:feat/research-library
Open

feat(research-library): library-acquisition skill + consolidated PDF extractor#2
Fede654 wants to merge 1 commit into
Mar-IA-no:mainfrom
Fede654:feat/research-library

Conversation

@Fede654

@Fede654 Fede654 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Research Library — citable primary-source corpus

Adds a Research Library capability to HMK: a filesystem corpus of full primary
sources (books, papers), citable as (Author, Year, ch. X, p. Y), kept distinct
from the memory store
(agent-memory/library.db). The two were being conflated
under the word "library"; this PR separates the concepts and bridges them.

What's included

  • scripts/library_extract.py — a single PyMuPDF extractor with two modes:
    • corpus: structured ingestion (copies the PDF to raw/, extracts + cleans the
      full text, writes meta.json, updates topic + master indexes).
    • dump: flat full-text extraction (every page) to stdout/file with a
      pages=N chars=M report — for one-off translation/TTS of a PDF not in the corpus.
    • Replaces two per-agent scripts (structured vs flat) that had drifted. Paths are
      workspace-relative ($LIBRARY_ROOT / $HMK_WORKSPACE_ROOT/library).
  • templates/skills/research/library-acquisition/ — the acquisition procedure,
    generalized from a per-agent local skill. Its closing step registers a catalog
    pointer in library.db
    (shelf evidence) pointing at each book's meta.json, so
    corpus books are discoverable via librarian/hybrid-pack and expand jumps to the
    on-disk chapter. This is the memory↔corpus bridge.
  • librarian skill — cross-links library-acquisition and documents the corpus as
    a third retrieval tier, disambiguating the two "libraries".

Model

library.db holds the index (pointers/summaries); the Research Library holds the
full text. Acquisition feeds discoverability; the wiki map remains the orientation layer.

Origin: generalized from an agent-local Research Library + acquisition procedure.

🤖 Generated with Claude Code

…extractor

Adds a Research Library capability: a citable primary-source *corpus* (full
documents on disk), kept distinct from the memory store (library.db).

- scripts/library_extract.py: one PyMuPDF extractor with two modes — 'corpus'
  (structured ingestion: raw/ + cleaned chapters + meta.json + topic/master
  indexes) and 'dump' (flat full-text for one-off translation/TTS). Replaces
  the two per-agent scripts that had drifted (structured vs flat). Paths are
  workspace-relative ($LIBRARY_ROOT / $HMK_WORKSPACE_ROOT/library).
- templates/skills/research/library-acquisition: the acquisition procedure,
  generalized from a per-agent local skill. Closing step registers a catalog
  pointer in library.db (shelf evidence) so corpus books are discoverable via
  librarian/hybrid-pack and expand jumps to the on-disk chapter — the bridge
  that was missing.
- librarian skill: cross-links library-acquisition and documents the corpus as
  a third retrieval tier, disambiguating the two 'libraries'.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fede654 pushed a commit to Fede654/hermes-memory-kit that referenced this pull request Aug 18, 2026
Define authoritative memory ownership boundaries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant