Skip to content

[Feat] Cross-notebook source reuse (library-level sources) #99

Description

@mrsibe

Context

Sources belong to exactly one notebook. Reading the same paper in two contexts means importing it twice, storing it twice and embedding it twice — and the two copies drift as soon as only one is re-indexed.

Open Notebook is moving toward cross-notebook sources; for KnowNote it is the natural consequence of having made the source a first-class persisted entity (#82).

Why this is not v1.4 or v1.5

Each notebook currently owns its vector space — one vector table per notebook, each with its own width, which is the mechanism that keeps different embedding spaces from being compared. Letting notebooks share sources therefore has to answer, before any UI exists:

  • Is a source embedded once per notebook, or once globally?
  • If globally, what happens when notebook A uses e5-small and notebook B uses something else?
  • Does deleting a source from a notebook delete the file, or only the membership?
  • Does a citation point at the source, or at the membership?

Those are indexing and storage decisions, not a UI feature. Doing this early would destabilise the provenance work v1.4 is built on.

Proposal (sketch — needs its own design pass)

Global library
├── attention.pdf
├── gpt2.pdf
└── llama.pdf

Notebook A ← attention.pdf + gpt2.pdf
Notebook B ← attention.pdf + llama.pdf
  • A source is a library-level entity; a notebook holds memberships.
  • Embeddings stay per-notebook (per embedding space) unless the embedding configuration is identical; the citation → source mapping must remain valid either way.
  • Removing a source from a notebook removes the membership and its chunks, not the library file, unless it is the last membership and the user confirms deletion.

Acceptance

  • Design recorded before implementation (schema + embedding-space rule + delete semantics)
  • One source can be a member of two notebooks
  • Removing it from one notebook leaves the other fully functional
  • Citations in both notebooks still resolve to the correct page and span
  • No silent re-embedding of an already-indexed source

Depends on

#66–#70 (source provenance), and the storage / embedding-space questions above answered in writing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:foundationModule boundaries, architecture, tech debtarea:provenanceSource location, citations, document structureenhancementNew feature or requestpriority:P1High value, current or next milestone

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions