Dual-memory graph builder: mapping two perspectives on one timeline
A zero-dependency graph builder keeps Child and Parent memories distinct on shared places, flags EXIF date clashes, and ranks gaps by information gain.
November 29, 2026 · Project · What is not yet established
The mechanism doing the work
When two family members revisit the same home, they rarely remember the same place. Conversational remembering actively reshapes and diverges across listeners (Hirst & Echterhoff 2012), and healthy family narratives coordinate rather than erase distinct individual perspectives (Bohanek, Marin, Fivush & Duke 2006). A conventional knowledge graph flattens both speakers into one canonical text blurb, destroying either emotional truth or chronological accuracy. This proof of concept splits the job cleanly: a background engine attaches Perspective A (Child) and Perspective B (Parent) separately onto shared time-scoped coordinates, lets hardware EXIF lock dates without deleting dissenting recall, and ranks remaining voids by Expected Information Gain over trust cost.
Try the live map and Python engine
This prototype turns the loops sketched in the artifact–story flywheel and the evolving map of meaning into runnable code inspired by the sparse pre-2015 span of Seventeen homes, checked against my photos. Open the interactive dual-perspective map to scrub across ten anonymized synthetic turns (Beijing → rural English village → two distinct North London eras → Docklands), toggle between Child Memory, Parent Memory, and Overlay & Divergences, or type a custom spoken line and watch entities wire in real time.
| Coordinate & era | Child vs. Parent ruling | What the engine preserves |
|---|---|---|
| South Beijing (1999–2002) | Salience split (Δ 1.55) | Summer cicadas (+0.67) beside midnight exit paperwork (−0.88). |
| Rural village (2002–2004) | Salience split (Δ 1.44) | Green hills and geese (+0.64) beside damp room and winter mud (−0.80). |
| N. London terrace (2004–2007) | Salience split (Δ 1.36) | Corner park school walk (+0.53) beside housing queues (−0.83). |
| N. London flat (2011–2016) | Convergent anchor (Δ 0.13) | Separate era from 2004; both share settled pride (+0.69 / +0.82). |
| Docklands flat (2021–2024) | Temporal clash (EXIF 2021) | EXIF locks March 2021 while keeping Child’s "2020" claim intact. |
The zero-dependency Python module (graph_builder.py) and reproduction guide pass nine built-in assertions (--verify) and rank the 2008–2010 void (S = 2.26) ahead of the high-sensitivity 2001 departure gap (S = 0.50).
Agent context: sources, method and working notes
System architecture and invariants
The background graph-builder (public/research/dual-memory-graph/graph_builder.py) maintains a typed state tuple $G_t = (P, A, E, U)$ updated incrementally as each spoken turn arrives from a JSONL stream:
- Time-scoped coordinate resolution ($P$): Each place node pairs lexical aliases with an explicit era interval
[era_start, era_end]and normalized map coordinates(x, y). Repeating region tokens (such as"North London"appearing in bothnorth_london_early_2004andnorth_london_later_2011) receive low shared weight while exact era alignment adds+3.5and distant eras incur a penalty (-0.45per year, capped at-3.0). A turn mentioning2005never merges into the2011–2016flat. - Dual-perspective node slots: Every place stores isolated
perspectives.childandperspectives.parentrecords containingturn_ids, exact audio spans[[t0, t1], ...],years_claimed, concretedetails, anonymized relationalpeopleroles,salience_tags, andtanh-scaled emotional valence in[-1.0, +1.0]. - Provenance tiers ($E$):
- Tier 1 (
tier1_hardware_exif): Hardware EXIF timestamps and rough region tags. Locks canonical chronology without overwriting spoken recall. - Tier 2 (
tier2_contemporaneous_scan): Undated prints, tickets, and ephemera starting as orphans until spoken cues anchor them. - Tier 3 (
tier3_spoken_recall): Retrospective turns carrying[t0, t1]audio citations and speaker attribution. - Tier 4 (
tier4_inferred_link): Computed divergence and agreement overlay markers.
- Tier 1 (
- Divergence vs. agreement classifier: On any coordinate holding both speakers (or an EXIF anchor contradicting a speaker):
temporal_clash: Fires when a claimed year falls strictly outside an EXIF-corroborated era span (e.g., Child recalling2020for a2021–2024Docklands flat anchored by2021-03-04EXIF). Crucially, a mid-era photo (2014-05-18inside2011–2016) does not trigger a false clash against a2012move-in turn.salience_split: Fires when|valence_child - valence_parent| >= 0.75on the same shared place/era.detail_divergence: Fires when motif Jaccard overlap< 0.20and|Δvalence| >= 0.45.convergent_anchor: Fires when both perspectives align chronologically and emotionally (|Δvalence| <= 0.30).
Expected Information Gain over archive gaps
Following Bayesian optimal experimental design (Lindley 1956) and dependency-tracked revision (Doyle 1979), each unresolved void $g \in U$ holds a discrete hypothesis distribution $p_g$, $m_g$ unanchored orphan artifacts, and $b_g$ unlinked chronological boundaries. With expected single-turn resolution rate $r = 0.78$, orphan value $h_{\text{art}} = 0.35$, and boundary value $h_{\text{bridge}} = 0.40$:
$$\mathrm{EIG}(g) = r \cdot H(p_g) + m_g \cdot h_{\text{art}} + b_g \cdot h_{\text{bridge}}, \qquad H(p_g) = -\sum_i p_i \log_2 p_i$$
$$C_{\text{trust}}(g) = 1.0 + 1.2 \cdot \mathrm{sensitivity}(g) + 0.8 \cdot (1 - \mathrm{reversibility}(g)), \qquad S(g) = \frac{\mathrm{EIG}(g)}{C_{\text{trust}}(g)}$$
Verified output on the 10-turn synthetic stream (memory_graph.json, 30 edges, 7/11 artifacts anchored):
| Gap ID | Entropy $H$ (bits) | Orphans / Bounds | Raw EIG (bits) | Trust Cost $C_{\text{trust}}$ | Priority $S$ |
|---|---|---|---|---|---|
gap_2008_2010_bridge | 1.581 | 3 / 2 | 3.083 | 1.364 | 2.260 (#1 cue) |
gap_2003_village_school | 0.958 | 1 / 0 | 1.097 | 1.176 | 0.933 (#2) |
gap_2001_departure_week | 0.760 | 0 / 1 | 0.993 | 1.984 | 0.501 (#3, held back) |
Reproduction & public resource bundle
All code and synthetic inputs live under public/research/dual-memory-graph/ (zero external dependencies, Python 3.10+):
- README.md — architecture overview and extension hooks
- graph_builder.py — streaming graph-builder engine + 9-assertion
--verifysuite - sample_stream.jsonl — 10 anonymized synthetic Child/Parent turns with
t0..t1audio spans - sample_artifacts.json — 11 synthetic sparse scans/EXIF photos and 3 initial voids
- memory_graph.json — deterministic output produced by running the CLI
Verify locally:
python3 public/research/dual-memory-graph/graph_builder.py --verify
python3 public/research/dual-memory-graph/graph_builder.py
The --verify suite checks all 9 invariants: (1) 10 turns ingested across 5 dual-layer places, (2) zero era collapse between 2004 and 2011 North London, (3) valid t0 < t1 audio spans per speaker, (4) three salience splits + one moss convergent anchor, (5) Docklands EXIF 2021 locking canonical chronology while preserving Child’s 2020 claim, (6) dynamic orphan scan anchoring, (7) trust-cost-adjusted EIG ordering, (8) live ingestion of a custom 2005 park-walk turn without corrupting 2011, and (9) EIG entropy shrinkage when a 2009 interim-bridge turn arrives.
Experimental rubric for live human validation
To test whether dual-perspective graphs outperform flat summaries in real family conversations:
- Condition A (Flat consensus graph): Summarize two-speaker photo interviews into a single merged place record per neighbourhood.
- Condition B (Dual-perspective graph): Keep Speaker A and Speaker B slots distinct on shared coordinates with audio-span citations and EXIF clash tagging.
- Blind scoring: Ask both original speakers one week later to audit 10 generated place cards for (a) voice fidelity (“does this still sound like my memory?”), (b) unnoticed overwrites (count of factually or emotionally distorted claims), and (c) follow-up spark (whether seeing a divergence card prompts a clarifying story without friction).
Synthetic scope & citation verification note
All place names, filenames, and spoken lines in this bundle use broad non-identifying region labels (Beijing, rural English village, North London, Docklands) inspired structurally by the pre-2015 sparsity pattern in Seventeen homes, checked against my photos, with zero real street addresses, personal names, or private photographs. External scholarly sources below were verified via bibliographic indexing records and published DOIs/abstracts rather than full-text PDF audits:
- William Hirst & Gerald Echterhoff (2012), “Remembering in Conversations: The Social Sharing and Reshaping of Memories”, Annual Review of Psychology, 63:55–79. DOI: 10.1146/annurev-psych-120710-100340
- Jennifer G. Bohanek, Kelly A. Marin, Robyn Fivush & Marshall P. Duke (2006), “Family Narrative Interaction and Children’s Sense of Self”, Family Process, 45(1):39–54. DOI: 10.1111/j.1545-5300.2006.00079.x
- Jon Doyle (1979), “A Truth Maintenance System”, Artificial Intelligence, 12(3):231–272. DOI: 10.1016/0004-3702(79)90008-0
- Dennis V. Lindley (1956), “On a Measure of the Information Provided by an Experiment”, The Annals of Mathematical Statistics, 27(4):986–1005. DOI: 10.1214/aoms/1177728069