Tideline
Maintenance: extract, consolidate, dream
Memory tends itself. Three passes run off the turn's critical path — distilling new facts from conversation, merging semantic duplicates, and a nightly reflection that confirms, consolidates, and evicts. All three are origin-isolated and reversible.
Extraction#
After a turn settles, Tideline distills durable facts from the conversation — off the hot path, so it adds no per-turn latency. The gateway debounces new messages (~45s) into a single batch, then runs an isolated, tool-less, throwaway-transcript sub-agent that returns strict JSON facts. A cursor tracks how far each session has been distilled and only advances on a well-formed reply, so a malformed response never skips turns.
- Extracted facts are tagged
extraction(untrusted) — so the write-gate confines anything authoritative down toknowledge. - A pre-compaction hook distills turns that are about to be dropped from context, closing the window where a fact lives only in history.
- Re-seeing a known fact reinforces it rather than writing a duplicate.
- Relationship edges are captured in the same call — no extra model round-trip.
Consolidation#
Write-time dedup is lexical; consolidation catches the semantic duplicates and contradictions it can't. It is throttled to at most once every 30 minutes, runs one LLM call per origin, and only acts on buckets with enough facts to be worth it.
- A conservative prompt only archives genuinely contradicted or duplicated facts — never "too old" or "too specific".
- A richness guard ensures the metadata-richer record always survives a merge (so a subject-keyed original is never archived in favor of a poorer twin).
- It can never archive every fact in an origin — a runaway model is rejected.
- Archival goes through the event log, so it is auditable and reversible.
The nightly dream#
Once a day, a deterministic reflection pass runs per origin — no LLM, same input gives the same result. It does three things:
| Stage | What it does |
|---|---|
| Confirm | Promote a belief asserted or corrected enough times (default 3) to confirmed status — raising confidence and making it eviction-immune. |
| Consolidate | Merge embedding-near-identical facts (cosine ≥ 0.95), keeping the richer/trusted/confirmed survivor, and persist relates edges for pairs that are close but not duplicates (≥ 0.80). |
| Evict | Archive facts that are old enough (default 30 days) and have decayed below the floor (effective score < 0.05). confirmed beliefs are skipped. |
It is reversible by design: confirms log their prior state, and consolidations and evictions archive rather than delete.
Schedule & isolation#
- Decay GC runs on every maintenance sweep; the dream and contradiction detection run on the maintenance cron (default every 24h, tunable via
BRIGADE_MAINTENANCE_INTERVAL_MS). - Every pass buckets by origin — owner facts and each channel peer's facts are processed separately, so one principal's memory never drives another's.
- The whole subsystem can be frozen with
BRIGADE_DISABLE_MEMORY_EXTRACT=1.
Honest about v1
In the code
Extraction is src/agents/memory/extract.ts, consolidation is consolidate.ts, the dream is dream.ts, and decay GC is decay.ts; the cron lives in the gateway (core/server.ts).