You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RFC for an offline memory consolidation capability ("auto-dream"): an opt-in background / idle-time process that clusters related ContextRecords, abstracts them into higher-level memories, links the result to its sources, and retires the redundant raw records — producing more compact, higher-signal online memory over time. Inspired by Generative-Agents "reflection" and the 2025 "sleep-time compute" line.
Storage-native machinery only. The abstraction step is a user-supplied hook; lance-context bundles no models.
Motivation
Long-running agents accumulate large volumes of low-level episodic memory. As the store grows with redundant / near-duplicate entries, recall quality and cost degrade. Consolidation — summarize many raw turns into a few semantic memories, drop redundancy — keeps memory compact and high-signal. lance-context already holds the raw memory and has the primitives to do this in place, versioned and auditable.
embeddings → cluster related / near-duplicate memories
relationships → link a derived memory back to the source records it summarizes
lifecycle (supersede / retire) → replace consolidated-away raw records non-destructively (auditable, reversible)
versioning → each consolidation pass is a new version you can inspect or roll back
background compaction infra (should_compact, store.rs:1209; start_background_compaction, store.rs:1284) → an existing pattern for scheduling bounded background work
Proposed shape (to discuss)
Candidate selection — cluster by embedding similarity, or group by session / run / time window, to find redundant or related sets.
Abstraction hook (user-supplied) — given a cluster of records, the user's callback returns a consolidated record (summary / abstraction). lance-context invokes the hook and persists the result; it bundles no models.
Write-back — insert derived records (source="consolidated"), link via relationships, supersede / retire the originals, bump a version.
Scheduling — opt-in background pass (idle / cadence / threshold-triggered), reusing the compaction scheduler pattern; bounded and cancellable.
Safety / reproducibility — never hard-delete (lifecycle only); record consolidation params + source ids; version-pinned and reversible.
Auto-dream and #96 curation are the same core loop — read records → derive new records → supersede originals → version. They differ only in:
trigger — background / idle (auto-dream) vs. on-demand (curation)
output — better online memory (auto-dream) vs. trainable export (curation)
This RFC should decide whether to build one shared "derive-and-supersede" engine with two front-ends (consolidation + curation/export) rather than two parallel implementations.
Non-goals
Not an agent framework: bundles no LLM / prompting; abstraction is a hook.
No hard deletion — consolidation is lifecycle-based and reversible.
Summary
RFC for an offline memory consolidation capability ("auto-dream"): an opt-in background / idle-time process that clusters related
ContextRecords, abstracts them into higher-level memories, links the result to its sources, and retires the redundant raw records — producing more compact, higher-signal online memory over time. Inspired by Generative-Agents "reflection" and the 2025 "sleep-time compute" line.Storage-native machinery only. The abstraction step is a user-supplied hook; lance-context bundles no models.
Motivation
Long-running agents accumulate large volumes of low-level episodic memory. As the store grows with redundant / near-duplicate entries, recall quality and cost degrade. Consolidation — summarize many raw turns into a few semantic memories, drop redundancy — keeps memory compact and high-signal. lance-context already holds the raw memory and has the primitives to do this in place, versioned and auditable.
Why here (the bet)
Consolidation maps onto primitives lance-context already has:
should_compact,store.rs:1209;start_background_compaction,store.rs:1284) → an existing pattern for scheduling bounded background workProposed shape (to discuss)
source="consolidated"), link viarelationships, supersede / retire the originals, bump a version.Relationship to #96 (important)
Auto-dream and #96 curation are the same core loop — read records → derive new records → supersede originals → version. They differ only in:
This RFC should decide whether to build one shared "derive-and-supersede" engine with two front-ends (consolidation + curation/export) rather than two parallel implementations.
Non-goals
Open questions
search— do consolidated memories rank over raw? do raw records stay searchable, or only the abstraction?Acceptance (RFC stage)
docs/design/(mirrors how Explore partitioned namespace layout for scoped agent context #90 was handled). Implementation tracked in follow-ups.