Skip to content

docs: ADR 0007 — invert L1/L2 (L1 = coarse doc, L2 = item slices)#465

Merged
sairin1202 merged 1 commit into
mainfrom
docs/adr-0007-invert-layers
Jul 1, 2026
Merged

docs: ADR 0007 — invert L1/L2 (L1 = coarse doc, L2 = item slices)#465
sairin1202 merged 1 commit into
mainfrom
docs/adr-0007-invert-layers

Conversation

@sairin1202

Copy link
Copy Markdown
Contributor

Summary

Redefines ADR 0007's layers with uniform roles but line-specific content, each derived from the one below (L0 → L1 → L2), consistently across all three lines:

Layer Role chat workspace skill
L0 raw source raw chat corpus raw multimodal data raw agent-run logs
L1 coarse doc (from L0) classified memory category preprocessed caption paragraph skill markdown
L2 (item) fine slices/extracts of L1 — the embed/search unit slices of the category's paragraphs slices of the caption paragraph per-skill descriptions

What changed

  • Inverts the earlier wording ("L1 = atomic item, L2 = category"): now L1 is the coarse document and L2 is the fine item.
  • Every line now has L0 + L1 + L2 (previously workspace had no L2, skill had no L1).
  • L1 ⊇ L2: an item is a slice/extract of its L1 document.
  • Retrieval: embed the L2 items → one hybrid pass (cosine + BM25) → roll up to the L1 document (and its L0 resource). Still no graph / entity / multi-hop.
  • Markdown: MEMORY.md/SKILL.md render L1 documents; INDEX.md indexes L0 resources; L2 items live only in the store.
  • Because meanings are now per-line and inverted, they no longer map 1:1 onto Resource/RecallEntry/RecallFile.

Updated the three-lines table, layer table, retrieval table, and ingest treatment. Added a divergence note: the model is now ahead of the memu.lines code, to be re-aligned next. Docs-only.

🤖 Generated with Claude Code

…l lines have L0+L1+L2

Redefine the layers with uniform roles but line-specific content, each derived
from the one below (L0 → L1 → L2), consistently across all three lines:

- L0 = raw source (resource): chat corpus / multimodal data / agent-run logs
- L1 = coarse document derived from L0: memory category / caption paragraph / skill md
- L2 = item = fine slices/extracts of L1 (the embed/search unit): paragraph slices /
  caption slices / per-skill descriptions

This inverts the earlier "L1 = atomic item, L2 = category" wording (now L1 is the
coarse doc, L2 the fine item) and gives every line all three layers (previously
workspace had no L2, skill no L1). Retrieval embeds L2 items, runs one hybrid pass
(cosine + BM25), and rolls up to the L1 document. Updated the three-lines table,
layer table, retrieval table, and ingest treatment; added a divergence note that
the model is now ahead of the memu.lines code (to be re-aligned).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Copilot AI review requested due to automatic review settings July 1, 2026 03:24
@sairin1202 sairin1202 merged commit 0afbcc5 into main Jul 1, 2026
4 checks passed
@sairin1202 sairin1202 deleted the docs/adr-0007-invert-layers branch July 1, 2026 03:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates ADR 0007’s documentation model for the “three independent memory lines” by redefining the L0/L1/L2 layer meanings consistently across chat/workspace/skill, aligning retrieval and output semantics with the new definition (docs-only change).

Changes:

  • Inverts prior terminology so L1 = coarse document and L2 = item slices (embed/search unit) across all three lines.
  • Establishes a uniform L0 → L1 → L2 derivation model for chat/workspace/skill, with an explicit divergence note vs current memu.lines implementation.
  • Updates retrieval/output descriptions to reflect embedding/search over L2 and roll-up to L1 documents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

| **skill** | execution / tool traces | `SKILL.md` | raw logs → skill md → per-skill descriptions | hybrid: embedding + BM25 |

Each line keeps the established output-file name as its index/map, over its own record stores.
Each line keeps the established output-file name as its L1 index/map, over its own L0/L1/L2 stores.
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.

2 participants