PaperMemory
Local, verbatim-first academic memory on the Academic Harness preset. Database:
~/.local/share/papermemory/papermemory.db (override PAPERMEMORY_DB); the
plugin auto-installs the CLI and mounts 15 MCP tools. Do not pip install a
second copy. Prefer mcp__papermemory__* when present; CLI fallback:
papermemory <cmd> --json.
The unit of trust is a claim anchored to a byte span of a stored markdown
paper. Raw papers are content-addressed; every chunk is a contiguous byte
slice, so quotes re-slice exactly. Memory never paraphrases source text.
First action
Call papermemory_recap with the manuscript/project slug on any paper task.
If it returns empty_reason: project-not-found, pick a known_projects entry;
never present another project's papers as this project's evidence.
Tools
| Goal |
Tool |
| Project briefing (stable + volatile, budgeted) |
papermemory_recap |
| Search chunks/claims/papers/notes (typed empty reasons) |
papermemory_search |
| Enumerate papers, claims, lessons, coverage |
papermemory_list |
| Paper outline (roles, spans, DOI, filename) |
papermemory_outline |
| Ingest markdown / PDF / bib / manuscript tree |
papermemory_ingest |
| Show a paper with full claims and chunk slices |
papermemory_get |
| Find a citable paper (claims, support flag, degradation) |
papermemory_cite |
| Check manuscript citations and claim gaps |
papermemory_cite_check |
| Store a verbatim-anchored claim / lifecycle action |
papermemory_claim |
| Exact-substring quote check |
papermemory_quote_check |
| Claim provenance walk or paper reverse-hop |
papermemory_trace |
| Save a project decision |
papermemory_remember |
| Save a durable rule (supersede supported) |
papermemory_lesson |
| Register markdown into an Academic Harness project |
papermemory_register_to_ah |
Claim rules
papermemory_quote_check the exact wording against the paper (or rely on
papermemory_claim, which locates it and refuses a miss with
quote-not-verbatim).
- Store with
evidence. The tool records the located span, quote_sha256,
origin channel and overlapping chunks. Whitespace-only differences are
stored unverified-quote / asserted-quote-differs; never claim them as
verified.
papermemory_trace walks sources → chunk hashes → quote materialization →
current doc → file sha. It promotes to verified only after a passing byte
re-slice. OCR-converted papers stay capped at extracted.
- Corrections are events, not edits:
action: supersede | contradict | rebind, with target_claim_id. Contradicted claims leave cite/recap/list.
- Near-duplicate claims (>0.9 token Jaccard on the same paper) supersede the
older one; 0.4–0.9 returns
similar_to without mutation.
Absence and citation integrity
papermemory_search returns empty_reason, suppressed, legs, and
coverage. Assert "memory has no source" only for no-match. For
no-match-in-project, all-suppressed:*, absence-not-licensable, or
leg-error:*, report the reason and enumerate with papermemory_list.
- Cite only what
papermemory_cite/papermemory_get return. Check
supports_statement (a verified claim) and degradation (OCR pages).
- Run
papermemory_cite_check before finishing a section; resolve
claim_gaps, missing_from_memory, and unverified_cited.
- Never recopy
notebook, session notes, or your own paraphrase as evidence.
Reading and ingest
When paper_fold is available, use it for a first orientation map. It is not
a source of evidence: do not quote or cite its lines. Ingest and read the paper
through the steps below.
- Prefer markdown per paper.
pdf_to_markdown with write_to ingests
automatically (unless a page subset was converted); scanned/OCR output is
marked ocr-recovered and claims from it are capped below verified.
papermemory_outline then papermemory_get for structure and full slices;
don't reason from 400-char previews (v2 returns bounded but complete text).
papermemory_register_to_ah for Academic Harness projects (AH id is the
paper id; citation keys are registered as aliases).
CLI fallback
papermemory recap|search|list|outline|paper|cite|cite-check|claims|trace|verify|quote-check|ingest|register-ah|evidence-export|import-verdicts|sweep|dream|catalog|health|log --json.
papermemory verify CLAIM walks provenance; papermemory lookup KEY is DOI
metadata lookup (not the same command).
Papers with no text
cite_state: chunkless means a bibliographic row: no text, nothing to search,
quote or cite, and supports_statement stays false. Run paper_backfill (dry run
first: it only reports how many have an open-access copy) and then again with
dry_run: false. It never scrapes a paywalled paper; report those to the user as
unavailable rather than inventing content.
Keeping notes honest
papermemory_remember and papermemory_lesson are not checked when written, so
treat a recalled note as a lead. Recap marks each note why: salient|recent and
reports stale_notes_hidden when notes were retired. When that number is above
zero, or after a long writing session, run the CLI papermemory dream --project SLUG (it only reports), read what it would change, then add --apply. It marks
copies superseded, notes whose source files changed stale, and re-checks
quarantined legacy claims against the paper text. It never deletes anything,
--restore NOTE_ID undoes one note, and the plugin also runs it at session end
(PAPERMEMORY_DREAM=apply|report|off).
Do not
- Do not mark a claim verified by assertion; only the byte re-slice promotes it.
- Do not invent titles, years, DOIs, or keys; missing keys are gaps to report.
- Do not treat chunkless (metadata-only) papers as evidence; they are
bibliographic rows (
cite_state='chunkless').
Reference library
reference_library (one tool, an action argument) is the reference manager over the same database. It is the plugin's native tool, so it already knows the session's workspace: paths are relative to it and cannot leave it. (Standalone, or in another host, the same actions are the MCP tool papermemory_library and the papermemory library CLI, where cwd names the workspace.)
- Add:
import BibTeX/BibLaTeX/RIS/CSL-JSON (dry_run first for a big file; the report lists parse problems, key collisions and duplicates). paper_download and papermemory_ingest add papers automatically.
- Find:
list with filters (tag:ml year:2020..2024 has:pdf !tag:skip words), get/resolve by key, DOI or id. resolve with project_keys: true also reports the keys that project would use; each result's key is the library key.
- Organise:
tag, collection (one level of nesting, can be bound to a project and a .bib; its project scopes exports), note (edits keep the old text).
- Export:
export to BibTeX/BibLaTeX/RIS/CSL-JSON/JSON/CSV. For a project bibliography use cited_only: <manuscript> with out; a collection bound to a project also exports that project's own versions and keys, even when out is given (pass project to override; a collection with no project uses canonical keys). The file is managed (a header, markers, a hash). Re-export rewrites only the managed block and keeps text after the hand-added marker. check: true reports in_sync, out_of_date, hand_edited, not_managed or missing without writing. Never force or adopt unless the user asks.
- Keys: stable once exported.
keys check reports problems; rekey is a dry run unless apply with a reason, and lists the manuscripts that cite the old key (it stays as an alias).
- Clean up:
dedupe lists candidates; merge previews field by field and applies only with a reason. doctor reports missing fields, unsafe keys, unverified DOIs, duplicates, retracted papers still cited, and .bib files out of sync; never-checked papers are unknown.
- Integrity:
integrity_check with library checks the DOIs of library papers and records the result (set_integrity).
The existing rule still holds: an empty papermemory_cite result means do not invent a citation.
1---2name: papermemory3description: >4 Academic paper memory for understanding papers and writing papers. Use for5 literature, citations, verbatim claims, manuscripts, related work, bibtex,6 DOI/arXiv ingest, cite-check, outlines, and recap of a writing project.7 Triggers: paper memory, remember this paper, cite this, citation check,8 literature review, manuscript status, /papermemory. Not for coding-session9 memory or the lab notebook.10license: MIT11metadata:12 version: "0.2.0"13 source: https://skillmd.com/skills/raktim-mondol/papermemory14 upstream: https://github.com/raktim-mondol/papermemory15---1617# PaperMemory1819Local, verbatim-first academic memory on the Academic Harness preset. Database:20`~/.local/share/papermemory/papermemory.db` (override `PAPERMEMORY_DB`); the21plugin auto-installs the CLI and mounts 15 MCP tools. Do not `pip install` a22second copy. Prefer `mcp__papermemory__*` when present; CLI fallback:23`papermemory <cmd> --json`.2425The unit of trust is a claim anchored to a byte span of a stored markdown26paper. Raw papers are content-addressed; every chunk is a contiguous byte27slice, so quotes re-slice exactly. Memory never paraphrases source text.2829## First action3031Call `papermemory_recap` with the manuscript/project slug on any paper task.32If it returns `empty_reason: project-not-found`, pick a `known_projects` entry;33never present another project's papers as this project's evidence.3435## Tools3637| Goal | Tool |38| --- | --- |39| Project briefing (stable + volatile, budgeted) | `papermemory_recap` |40| Search chunks/claims/papers/notes (typed empty reasons) | `papermemory_search` |41| Enumerate papers, claims, lessons, coverage | `papermemory_list` |42| Paper outline (roles, spans, DOI, filename) | `papermemory_outline` |43| Ingest markdown / PDF / bib / manuscript tree | `papermemory_ingest` |44| Show a paper with full claims and chunk slices | `papermemory_get` |45| Find a citable paper (claims, support flag, degradation) | `papermemory_cite` |46| Check manuscript citations and claim gaps | `papermemory_cite_check` |47| Store a verbatim-anchored claim / lifecycle action | `papermemory_claim` |48| Exact-substring quote check | `papermemory_quote_check` |49| Claim provenance walk or paper reverse-hop | `papermemory_trace` |50| Save a project decision | `papermemory_remember` |51| Save a durable rule (supersede supported) | `papermemory_lesson` |52| Register markdown into an Academic Harness project | `papermemory_register_to_ah` |5354## Claim rules55561. `papermemory_quote_check` the exact wording against the paper (or rely on57 `papermemory_claim`, which locates it and refuses a miss with58 `quote-not-verbatim`).592. Store with `evidence`. The tool records the located span, `quote_sha256`,60 origin channel and overlapping chunks. Whitespace-only differences are61 stored `unverified-quote` / `asserted-quote-differs`; never claim them as62 verified.633. `papermemory_trace` walks sources → chunk hashes → quote materialization →64 current doc → file sha. It promotes to `verified` only after a passing byte65 re-slice. OCR-converted papers stay capped at `extracted`.664. Corrections are events, not edits: `action: supersede | contradict |67 rebind`, with `target_claim_id`. Contradicted claims leave cite/recap/list.685. Near-duplicate claims (>0.9 token Jaccard on the same paper) supersede the69 older one; 0.4–0.9 returns `similar_to` without mutation.7071## Absence and citation integrity7273- `papermemory_search` returns `empty_reason`, `suppressed`, `legs`, and74 `coverage`. Assert "memory has no source" only for `no-match`. For75 `no-match-in-project`, `all-suppressed:*`, `absence-not-licensable`, or76 `leg-error:*`, report the reason and enumerate with `papermemory_list`.77- Cite only what `papermemory_cite`/`papermemory_get` return. Check78 `supports_statement` (a verified claim) and `degradation` (OCR pages).79- Run `papermemory_cite_check` before finishing a section; resolve80 `claim_gaps`, `missing_from_memory`, and `unverified_cited`.81- Never recopy `notebook`, session notes, or your own paraphrase as evidence.8283## Reading and ingest8485When `paper_fold` is available, use it for a first orientation map. It is not86a source of evidence: do not quote or cite its lines. Ingest and read the paper87through the steps below.88891. Prefer markdown per paper. `pdf_to_markdown` with `write_to` ingests90 automatically (unless a page subset was converted); scanned/OCR output is91 marked `ocr-recovered` and claims from it are capped below `verified`.922. `papermemory_outline` then `papermemory_get` for structure and full slices;93 don't reason from 400-char previews (v2 returns bounded but complete text).943. `papermemory_register_to_ah` for Academic Harness projects (AH id is the95 paper id; citation keys are registered as aliases).9697## CLI fallback9899`papermemory recap|search|list|outline|paper|cite|cite-check|claims|trace|verify|quote-check|ingest|register-ah|evidence-export|import-verdicts|sweep|dream|catalog|health|log --json`.100`papermemory verify CLAIM` walks provenance; `papermemory lookup KEY` is DOI101metadata lookup (not the same command).102103## Papers with no text104105`cite_state: chunkless` means a bibliographic row: no text, nothing to search,106quote or cite, and `supports_statement` stays false. Run `paper_backfill` (dry run107first: it only reports how many have an open-access copy) and then again with108`dry_run: false`. It never scrapes a paywalled paper; report those to the user as109unavailable rather than inventing content.110111## Keeping notes honest112113`papermemory_remember` and `papermemory_lesson` are not checked when written, so114treat a recalled note as a lead. Recap marks each note `why: salient|recent` and115reports `stale_notes_hidden` when notes were retired. When that number is above116zero, or after a long writing session, run the CLI `papermemory dream --project117SLUG` (it only reports), read what it would change, then add `--apply`. It marks118copies `superseded`, notes whose source files changed `stale`, and re-checks119quarantined legacy claims against the paper text. It never deletes anything,120`--restore NOTE_ID` undoes one note, and the plugin also runs it at session end121(`PAPERMEMORY_DREAM=apply|report|off`).122123## Do not124125- Do not mark a claim verified by assertion; only the byte re-slice promotes it.126- Do not invent titles, years, DOIs, or keys; missing keys are gaps to report.127- Do not treat chunkless (metadata-only) papers as evidence; they are128 bibliographic rows (`cite_state='chunkless'`).129130## Reference library131132`reference_library` (one tool, an `action` argument) is the reference manager over the same database. It is the plugin's native tool, so it already knows the session's workspace: paths are relative to it and cannot leave it. (Standalone, or in another host, the same actions are the MCP tool `papermemory_library` and the `papermemory library` CLI, where `cwd` names the workspace.)133134- **Add:** `import` BibTeX/BibLaTeX/RIS/CSL-JSON (`dry_run` first for a big file; the report lists parse problems, key collisions and duplicates). `paper_download` and `papermemory_ingest` add papers automatically.135- **Find:** `list` with filters (`tag:ml year:2020..2024 has:pdf !tag:skip words`), `get`/`resolve` by key, DOI or id. `resolve` with `project_keys: true` also reports the keys that project would use; each result's `key` is the library key.136- **Organise:** `tag`, `collection` (one level of nesting, can be bound to a project and a `.bib`; its project scopes exports), `note` (edits keep the old text).137- **Export:** `export` to BibTeX/BibLaTeX/RIS/CSL-JSON/JSON/CSV. For a project bibliography use `cited_only: <manuscript>` with `out`; a collection bound to a project also exports that project's own versions and keys, even when `out` is given (pass `project` to override; a collection with no project uses canonical keys). The file is managed (a header, markers, a hash). Re-export rewrites only the managed block and keeps text after the `hand-added` marker. `check: true` reports `in_sync`, `out_of_date`, `hand_edited`, `not_managed` or `missing` without writing. Never `force` or `adopt` unless the user asks.138- **Keys:** stable once exported. `keys` `check` reports problems; `rekey` is a dry run unless `apply` with a reason, and lists the manuscripts that cite the old key (it stays as an alias).139- **Clean up:** `dedupe` lists candidates; `merge` previews field by field and applies only with a reason. `doctor` reports missing fields, unsafe keys, unverified DOIs, duplicates, retracted papers still cited, and `.bib` files out of sync; never-checked papers are *unknown*.140- **Integrity:** `integrity_check` with `library` checks the DOIs of library papers and records the result (`set_integrity`).141142The existing rule still holds: an empty `papermemory_cite` result means do not invent a citation.