Bruket/Lavett
RESEARCH · RUNNABLE TODAY
A BRUKET RESEARCH PROJECT

Lavett

Memory with aim.
A semantic compiler for language-model memory.

Lavett turns a messy pile of notes, chats, and logs into a typed, evidence-anchored memory — then compiles the minimal proof path an answer needs, instead of dumping raw history into the prompt.

BUILT FOR
People who think better AI needs better memory, not just bigger models.
FIG.01 — MEMORY ROUTE65 tokens
query
“What should the learner practice next?”
ROLElearner → omitted → article
CONCEPTEnglish article usage · gravity ↑
EVIDENCEsession_03.md:L42 ✓ current
ANSWER
Practice English article usage — inserting “the” before specific singular nouns like “store”.
cites its sources · 0.0 cross-scope leakage
THE PROBLEM

Against flat context.

A bigger context window does not create structured memory. It postpones the same problem at a higher token cost. Most AI memory still behaves like a pile — previous messages, summaries, or retrieved chunks.

A recurring mistake, a corrected belief, a changing goal, and a stable preference should not all live as equal pieces of text. They need structure, scope, evidence, and a lifecycle.

Raw context is expensive and grows without bound.
Summaries save space but quietly lose detail.
Vector search finds similar chunks but misses relationships.
Old facts and new facts are left to silently conflict.
Models struggle to track what changed over time.
WHAT “LAVETT” MEANS

A support structure for reasoning.

A lavett is the carriage beneath the cannon: the structure that carries, stabilizes, and aims it. The barrel does the firing; the carriage decides where it points. The base model stays the engine of language — Lavett builds the support layer around it, so the same model reasons from better-aimed input.

WITHOUT LAVETT
questionraw contextmodel
WITH LAVETT
questionrole graphmemory routescompiled proof pathmodel
WHAT IT IS TODAY

An engine, and three surfaces on top of it.

A local-first, evidence-anchored memory engine — Python, Apache-2.0, offline by default. Every stored fact points back to an exact source_file:Lline, and a context compiler selects only the evidence a question needs and renders it, cited. Three surfaces sit on the engine.

Current

An offline, read-only view of project memory: current state, what changed, open questions, ruled-out / superseded — each cited to its line. Deliberately not a chatbot.

Structure Atoms

A grep-safe ID over an exact raw span that decodes to triples, lifecycle status, and an integrity hash — and back to the exact source. Raw text is never mutated.

Appeals

The first product vertical: a UK PIP benefit-refusal plus the claimant’s evidence, compiled into a cited, adviser-review packet — which descriptors the evidence supports, where the decision contradicts it, and the honest gaps. Decision-support, not legal advice; the bundled case is synthetic.

MODEL PROPOSES, LEGIBLE VERIFIER DISPOSES

A deterministic verifier owns grounding and rejection. An opaque LLM is optional, gated, default-off, and its proposals are accepted only when the verifier can ratify them against a verbatim source quote. In the Appeals vertical the verifier rejected 393/393 systematic and 4,800/4,800 randomized-fuzz adversarial proposals with zero ungrounded acceptances; where the legible layer recovered nothing on everyday paraphrase (0.0), one capped model run (~$0.017) lifted it to 1.0 through that same verifier.

These are adversarial-set and synthetic-corpus results — attack coverage and integration recall, not a real-world accuracy claim. Promising, not proof yet.
THE EVIDENCE

Decision-grade, and reproducible by one command.

A deterministic string scorer is the source of truth — no LLM grades itself. Headline 33-case suite, temperature-0, fully offline. Every figure below maps to a row in the repository’s evidence ledger with an exact reproduce command.

MODEANSWER RECALLREQ-EVIDENCEEVIDENCE PREC.CONTEXT TOKENS
raw context0.4701.0000.274137
BM25 · token-matched0.2930.4770.52859
Lavett · lavett_tight1.0001.0000.88765
Also verified: adversarial current-vs-stale (14) raw 0.071 → Lavett 1.000 at precision 0.905; mixed-workspace (9) raw 0.333 in 691 tokens → Lavett 0.963 in 78.
0.000
Cross-project evidence leakage
every benchmark + blind paraphrase
2.1×
Smaller context vs raw
up to 8.85× on noisy mixed corpora
1.0 / 0.48
Required-evidence recall vs BM25
token-matched fair baseline

And on real, fixed models.

Live answer-recall on two model families, deterministic substring scorer, ~65 vs ~137 tokens. Lavett beats a fair BM25 retriever in every run; against full raw context it wins for one family and honestly loses for the other. Total live cost across both runs: ~$0.24.

MODEL (33 cases)RAWBM25LAVETTvs RAWvs BM25
google/gemini-2.5-flash-lite0.6770.4750.732+0.055+0.257
z-ai/glm-5.20.7470.5000.687−0.064+0.187
$ make proof — replays every offline number above, no API key, no network.
THE ARCHITECTURE

NodeWeb: language as connected meaning.

Not a nearest-neighbour blob. Typed meaning events, correction trajectories, lifecycle state, scopes, and an evidence-anchored RoleGraph — routed through explicit memory paths. Each subsystem is independently ablated in the benchmark, so its weight is measured, not asserted.

Meaning Event Graph

Language is decomposed into structured events: subject, action, object, time, attributes, and evidence.

learner → omitted → article ("the")

Concept Gravity

Recurring or important concepts gain weight over time, so retrieval surfaces what actually matters.

concept recurs → gravity ↑

Truth Lifecycle

Facts can be current, uncertain, contradicted, corrected, or superseded — and the transition stays inspectable.

belief → corrected → superseded

Multi-Route Retrieval

Routes search memory differently — entities, timelines, corrections, evidence — run in parallel and competed.

route(roles) ∥ route(evidence)

Correction Trajectories

Tracks the arc of a mistake instead of a single snapshot: mistake → correction → recurrence → improvement.

mistake → corrected → recurs

Context Compiler

Compiles a task-specific briefing split into proof context, background, and what it dropped — not raw chunks.

chunks ✗ → proof path ✓

Scope-Bound Memory

Memory is scoped by workspace, so a coding answer is never contaminated by unrelated tutoring notes.

answer ⊂ dominant workspace

Explainable Memory Paths

Every answer can show the memory route behind it — the roles, events, and evidence it actually used (lavett ask --explain).

answer ⟵ route ⟵ evidence
THE HONEST HALF

I publish the anti-results.

The headline 1.0 / 0.887 is in-sample and partly tuned to the query wording. Under blind paraphrase the structural synthesizer still generalizes — answer recall 0.833 on unseen wordings, isolation and compression intact — but a retrieval-side paraphrase tax remains (req-evidence ~0.88–0.91, precision ~0.47–0.55) and is not claimed. Every case where raw context or BM25 beats Lavett (7 and up to 5 cases respectively) is preserved in the evidence ledger. The full test suite runs 590 passed, 2 xfailed. That is what makes the rest trustworthy.

Confidence-tiered: decision-grade / directional / exploratoryAnti-results preserved in the ledgerByte-deterministic, offline replayNo LLM grades itselfParaphrase tax: open, unclaimed
A CONSTRAINT, NOT A FEATURE

Legibility is not optional.

Nothing Lavett stores, routes, or emits is allowed to exist without a deterministic decoder back to faithful human-readable text. A representation without a registered decoder is rejected at write time.

NO REPRESENTATION WITHOUT TRANSLATION
Efficiency never buys hidden cognition.
A STAGED PLAN · EVIDENCE BEFORE HYPE

The road from here.

NOW✔ NOW
Evidence-anchored engine

typed memory, cited proof paths, offline benchmark suite

NOW✔ NOW
First vertical: Appeals

benefit-refusal → cited, adviser-review evidence packet

NEXTAHEAD
Adviser validation

packets in front of 5–10 advisers / caseworkers

THENAHEAD
Jurisdiction expansion

UK PIP vs Swedish Försäkringskassan — a corpus swap, not a rewrite

LATERAHEAD
Memory-native model

the moonshot — explicitly not being trained now

CURRENT STATUS

Early, with a real, growing edge.

NodeWeb runs today as a Python research prototype — a CLI-first engine with SQLite storage, heuristic extraction, multi-route retrieval, evidence-aware context compilation, ablation-backed evaluation, and 31 registered frontier diagnostics. Apache-2.0, offline by default.

lavett ingestlavett asklavett ask --explainlavett compile-contextlavett evalmake proof
NOT YET
×not a foundation model
×not a public chatbot
×not a universal benchmark winner — raw still wins some cases
×not a finished product
×not a claim about model-internal architecture

Memory should have shape.

Language models need more than longer context. They need memory with structure, evidence, and aim — and a representation a human can still read. NodeWeb is the first attempt to build it.

← ALL WORKS · BRUKETPRIVACYTERMSBRUKET · ILLA TILL MODS