Date: 2026-04-21 Status: active Repos:
<workspace>\\spark-intelligence-builder<workspace>\\domain-chip-memory
Turn the current benchmark-strong Telegram memory into a governed persistent memory system that:
- remembers crucial user and project state across sessions
- preserves source truth and prior truth
- avoids overfitting to hand-written predicate lanes
- avoids storing conversational residue indiscriminately
- stays compact, explainable, and maintainable at scale
This plan does not restart the system.
It upgrades the current dual_store_event_calendar_hybrid runtime into a more general memory operating model.
What is already strong:
- live Telegram current-state memory works on covered lanes
- overwrite, delete, previous-state, and event-history behavior are real
- mixed churn regression is live and green
- runtime, benchmark contract, and docs are aligned on
dual_store_event_calendar_hybrid raw_episode,structured_evidence,current_state,event, andbeliefare all real runtime lanes- open recall now exists for current truth, evidence, raw episodes, and beliefs
- belief supersession, invalidation, revalidation, and archival are live
- structured evidence can now consolidate into active-state memory for:
current_blockercurrent_dependencycurrent_constraintcurrent_riskcurrent_statuscurrent_owner
- local Telegram memory coverage is broad and increasingly lifecycle-aware
What is still missing:
- memory capture is still too shaped by named predicates and route-specific logic
- consolidation is still too targeted and heuristic-shaped rather than policy-shaped
- long-run retention, compaction, and rebuild are not yet unified into a clean maintenance loop
- live regression reliability is not strong enough; some focused live packs still hang silently
- false-positive and false-negative promotion audits are not yet strong enough
- current-state rebuild from durable evidence is not yet proven end to end
Working estimate as of 2026-04-22:
- Telegram-first production-useful memory:
~75% - full governed memory methodology target:
~60%
This means the system has crossed out of "memory demo" territory and into "real memory subsystem" territory, but it is not yet a finished general memory architecture.
The next sequence should optimize for pride-worthy system quality, not just more covered predicates.
- Generalize promotion policy
- replace the growing pile of evidence-to-state special cases with a cleaner promotion policy for active state
- keep the existing successful lanes, but stop adding isolated one-off logic where a reusable promotion rule would do
- Make maintenance a first-class loop
- unify belief invalidation, belief decay, evidence archival, and raw-episode archival into one governed maintenance model
- make it easy to explain why a record is still active, archived, or deleted
- Prove rebuild and correction fidelity
- ensure current state can be reconstructed from evidence and lifecycle history
- make corrections, deletes, supersession, and restores survive rebuild cleanly
- Fix live validation operability
- investigate why some focused live regression packs hang silently
- make live validation trustworthy enough to use as a real gate, not just a best-effort smoke
- Expand trace auditing
- add explicit audits for:
- false-positive promotions
- false-negative promotions
- stale state that should have been downgraded
- residue that should never have become durable memory
Current production Telegram ingress remains in the standalone private repo:
spark-telegram-bot
Builder should not take over Telegram webhook ownership until it reaches full parity with the live gateway contract. The migration shape is documented in:
docs/TELEGRAM_GATEWAY_MIGRATION_PLAN_2026-04-21.md
The current system has improved from narrow profile/event memory into a broader governed lifecycle system. But the remaining risk is the same one the research warned about:
- too much route-shaped capture
- not enough generic keepability logic
- not enough retention and compaction policy
The target is not "remember everything." The target is:
- capture broadly at the episode layer
- promote selectively into typed memory roles
- route retrieval by memory intent
- decay or compact what no longer deserves durable salience
These are non-negotiable:
- Every durable memory must trace back to source evidence.
- Current truth and prior truth must both remain recoverable.
- Derived belief must never masquerade as source truth.
- The hot path must stay small.
- Per-user scope must be enforced at write and read time.
- Deletes, supersession, and restores must be first-class lifecycle operations.
- Product memory and benchmark memory must stay the same architecture.
The runtime memory system has these first-class roles:
working_memory
- small, visible, session-local
- short TTL
raw_episode
- append-only interaction ground truth
- source for reconstruction, provenance, and audits
structured_evidence
- extracted memory units with source turn, source session, timestamps, and confidence
- main retrieval unit for most durable memory
current_state
- latest stable truth for mutable or profile facts
- rebuilt from evidence plus lifecycle operators
event
- plans, deadlines, meetings, trips, commitments, chronology
- time-aware and history-preserving
belief
- derived reflections, summaries, or lessons
- always marked derived
- must be invalidatable and re-verifiable
Every stored unit must carry a retention class.
session_ephemeral
- keep in
working_memoryonly - do not persist beyond session unless promoted
- examples: momentary tactics, transient tool state, greeting context
episodic_archive
- persist as
raw_episode - cheap append-only storage
- not always retrieved
- examples: user turns, assistant turns, exact interaction history
active_state
- persist as
current_state - high retrieval priority while live
- examples: current goal, current blocker, current owner, current risk
durable_profile
- persist as
structured_evidenceplus optionalcurrent_state - long retention, low churn
- examples: identity facts, stable preferences, relationships, timezone
time_bound_event
- persist as
event - active while upcoming/relevant, demoted after staleness threshold
- examples: meeting dates, launch deadlines, trips, commitments with dates
derived_belief
- persist only if high value and source-grounded
- shorter TTL than evidence
- examples: recurring user style preference summary, project pattern summary
ops_residue
- reject or quarantine
- never promote into user memory
- examples: tool noise, hashes, runtime residue, generic operational chatter
No unit should become durable memory unless it passes all applicable gates:
relevance
- matters to future assistance, planning, personalization, or recall
specificity
- concrete enough to retrieve usefully later
attribution
- tied to a source turn or source event
scope
- belongs to the right user, agent, app, and session context
role_fit
- clearly belongs to
event,current_state,structured_evidence, orbelief
retention_fit
- has an explicit reason to survive beyond the immediate moment
safety
- not pure residue, unsafe PII handling, or irrelevant speculative clutter
If a unit fails:
- drop it
- or keep it only as
raw_episode - but do not promote it into durable salience
These rules should govern every turn.
On each meaningful user turn:
- store or reference the turn in
raw_episode - run generic candidate extraction
- classify candidates by memory role
Promote when:
- the candidate is likely useful later
- it is concrete and attributable
- it is not merely conversational filler
Promote when:
- the candidate states current truth
- it is mutable or profile-relevant
- the system can define overwrite/supersession behavior
Promote when:
- the candidate encodes chronology, scheduling, deadline, commitment, or sequence-sensitive change
Promote only offline or asynchronously when:
- multiple evidence items support a higher-order summary
- the summary is useful enough to retrieve
- derivation and invalidation remain explicit
Route memory questions by intent, not by predicate family.
The first required intents are:
current_truthprior_truthevent_historypreferenceidentity_or_profilerelationshipsummarywhy_do_you_think_thatabstain
Retrieval order should be:
current_statefor current trutheventand temporal filters for chronologystructured_evidencefor grounded factual recoveryraw_episodeonly for exact reconstruction or conflict resolutionbeliefonly when marked derived and source-supported
domain-chip-memory owns:
- memory object model
- role-clean contracts
- lifecycle operators
- temporal and supersession semantics
- retention and compaction primitives
- consolidation and maintenance logic
- provenance surfaces
- benchmark harnesses
spark-intelligence-builder owns:
- Telegram ingestion policy
- generic keepability gating
- per-user scope wiring
- query classification and routing
- reply formatting and abstention behavior
- live regression and soak validation
Main repo:
domain-chip-memory
Deliverables:
- explicit role contract for every stored and retrieved unit
- retention class contract
- lifecycle metadata contract:
created_atdocument_timeevent_timevalid_fromvalid_tosupersedesconflicts_withdeleted_at
- explanation payloads that reveal role, provenance, and derivation status
Exit:
- no retrieved unit is untyped
- current state, evidence, event, and belief are distinct at runtime
Main repo:
spark-intelligence-builder
Deliverables:
- generic turn-to-candidate extraction
- keepability scoring or rule gating
- promotion outcomes:
- drop
raw_episodeonlystructured_evidencecurrent_stateeventbelief_candidate
- first domain packs:
- people and relationships
- goals and priorities
- project state
- plans and commitments
- dates and deadlines
- preferences and identity
- corrections and reversals
Exit:
- live Telegram capture no longer depends mainly on named predicate lanes
Main repo:
- both
Deliverables:
- explicit TTL or review windows per retention class
- event staleness policy
- belief revalidation policy
- low-value evidence compaction rules
- delete and restore behavior that survives compaction
Exit:
- the system can say why something is still retained
- stale state no longer survives only because it was once written
Main repo:
domain-chip-memory
Deliverables:
- offline promotion from episode to evidence
- evidence-to-current-state rebuild
- derived belief generation with provenance
- rebuild tooling for one user or all users
Exit:
- current state can be reconstructed from the durable evidence trail
Main repo:
spark-intelligence-builder
Deliverables:
- intent classifier for memory queries
- route-specific retrieval plans
- compact grounded answer formatting
- explicit abstention when evidence is weak
Exit:
- fewer handcrafted fact-family branches
- broader phrasing still resolves to the right operator
Main repo:
- both
Deliverables:
- multi-day Telegram trace audits
- retention-behavior regression packs
- mixed event plus profile plus state churn packs
- quality gates for noise, drift, correction fidelity, and delete fidelity
Exit:
- memory quality remains coherent under longer realistic use
Every serious phase must pass:
- targeted repo tests
- benchmark checks in
domain-chip-memory - Builder regression packs
- focused Telegram smoke on the live home
- trace audit for false-positive durable writes
Core commands:
python -m pytest
python -m spark_intelligence.cli memory run-telegram-regression --home .tmp-home-live-telegram-real --json
python -m spark_intelligence.cli memory benchmark-architectures
python -m spark_intelligence.cli memory soak-architectures --runs 5Do not call the system "great persistent memory" until all are true:
- generic candidate capture is live
- retention classes are explicit
- belief is first-class and clearly derived
- current truth, prior truth, and exact source recall all work
- delete and restore semantics are reliable
- long-run trace audits show low residue promotion
- benchmark and product memory remain the same architecture
spark-intelligence-builder: investigate and fix the silent-hang behavior in focused live Telegram regression packsspark-intelligence-builder: replace targeted evidence-to-state heuristics with a reusable active-state promotion policydomain-chip-memory: add maintenance primitives for archive, decay, revalidation, and rebuild that are role-clean and inspectablespark-intelligence-builder: add trace-audit packs for false-positive promotion, false-negative promotion, and stale-state driftdomain-chip-memoryplusspark-intelligence-builder: prove current-state rebuild from durable evidence plus lifecycle history
Detailed methodology and rationale: