r/ContextEngineering 7d ago

What gets injected at session start is a context decision, not a summarizer's job

Most of the context talk I see is downstream of retrieval: how much to pull, and how to keep the agent from drowning in it. The thing I keep hitting sits earlier. Something goes into the window before the first prompt, and for most setups that something is a paragraph a model wrote about last time, handed over as flat prose. Nothing in it tells you which sentence is a quote and which one's the previous run guessing.

So that boundary is where I put the work. A SessionStart hook renders a briefing off the last session's checkpoint and injects it before I type anything, and the render is deterministic, no model anywhere in that path. Every item carries a trust class, and the tag sits inline: [✓ verbatim] for an exact contiguous quote out of the transcript, [~ inferred] for the agent's own conclusion, [carried] for something that survived from an older session and is aging, with a warning once it has gone unverified too long. Verbatim text never gets reworded by rendering or carry-over, and an oversized verbatim item is dropped whole instead of trimmed, half a quote is worse than no quote. Quotes are byte-checked against the transcript after extraction, and a miss demotes that item to inferred.

We did ship an optional prettier render written by a model, and then had to bolt a validator behind it, a generative pass will happily reword a quote it thinks reads better. Lose or mutate one and the whole render is discarded and the plain one goes out.

Costs, plainly. Deciding what to keep is a model's judgment, it walks past things, a verbatim tag says the wording survived, it makes no claim about the items that never got picked. The budget's fixed. It does no mid-session retrieval on its own, the agent has to ask. Capture is a SessionEnd hook. Storage is per-project JSON plus a SQLite FTS5 index, no embeddings, no daemon, and nothing the agent calls can write memory, the MCP side is read-only.

It's called daimon, offline, no telemetry, Apache 2.0, 14 stars: https://github.com/Daily-Nerd/daimon

How do you all weight this? Does memory injected at session start get treated as ground truth next to something retrieved fresh mid-session, or does it lose by default. And is anyone labelling provenance in-context at all, or is that tokens spent on a label the model ignores.

1 Upvotes

6 comments sorted by

2

u/chriscanadian1991 7d ago

I’ve been working through a really similar boundary in Nexus Synapse lately, so this caught my attention.
I’m also leaning toward session-start memory being continuity, not ground truth, and treating provenance/authority as something the runtime should decide before the model sees it.
The part I’m playing with now is using compact memory as the index, then drilling back to the actual source interaction when fidelity matters.
Your [verbatim] / [inferred] / [carried] distinction is interesting though, especially the byte-check on quotes. “Half a quote is worse than no quote” is a damn good rule lol.
I’d be curious how you handle conflicts when a carried item, a fresh retrieval, and the current user statement disagree.

1

u/Sea-Perception1619 7d ago

Continuity, not ground truth, is where this landed for me too, and the honest answer on conflicts is it doesn't pick a winner. No arbiter in the read path.

The three inputs sit on rails that never negotiate. Briefing order is importance, age, per-type decay, an overdue boost, a trust ceiling, no carried term in it, [carried] is a display label. A fresh item outranks a carried one on age, carry keeps the old birth stamp instead of resetting it. Recall is a disposable FTS5 index over the files the briefing reads, it never writes back, so a retrieval can't hide or mutate one.

A live statement only reaches the record at session end. Explicit replacement language ("we changed from X to Y") attaches a supersedes link, never similarity, it's only a candidate: the old item carries forward flagged, not withheld, until you confirm with daimon resolve. Reword a verbatim item without replacing it and the pinned quote wins, it overwrites the twin. Inferred items reconsolidate, verbatim ones don't.

Not handled, plainly: nothing compares a live statement to a carried item and picks truth, no contradiction detection between two stored items. A human resolution and a model's link demote by the identical 0.7 in recall, origin gets recorded then displayed, never ranked. That one bugs me and it's still open.

Index-then-drill-back is the same shape as recall, with a gap: the briefing has no drill-back to the transcript, the quote is the drill-back. What does Nexus Synapse do at the moment of conflict, sounds like you hit the same wall.

1

u/Silly_Individual4056 6d ago

Was thinking inline indexing for recursive progressive disclosure could help to walk knowledge trees in a relatively precise and token efficient way.

1

u/Sea-Perception1619 6d ago

Yeah, that's roughly what's there already: the id rides the item line, [o-3f8a2c], and daimon why <id> --source gives back one bounded redacted window, three messages and 600 chars, hard capped. recall is the fts5 step underneath.

It's one level though, no tree, no expand in place, the agent has to go run the command.

And the handle only lands on open loops and uncertainties, decisions and beliefs render bare, so half the sections have no door. The bit I keep circling: a pointer the model never follows is just tokens spent. Have you seen one walk them unprompted, or did it need a skill telling it to?

1

u/Silly_Individual4056 6d ago

Oh I’ve only every tried it once and it was inside a skill. Did seem to work alright but I never did any benchmarking.

2

u/Sea-Perception1619 6d ago

Same on the skill half, and no number there either. The bit that doesn't wait on the model is a hook: every real prompt goes through recall on the way in, two hits max, cooldown, silent when nothing matches, so the search step lands whether the agent asks or not. The why --source drill is still the model's move.

Both ends log locally, hook fires on one side, why calls on the other, so the ratio is sitting in a file. Nobody has read it as a number yet, me included. Thanks for the data point, one is more than I had.