Papers
Topics
Authors
Recent
Search
2000 character limit reached

Temporal Memory Tree (TMT)

Updated 13 January 2026
  • Temporal Memory Tree (TMT) is a hierarchical structure that organizes raw conversation data into progressively abstract representations for efficient memory retrieval.
  • It employs semantic-guided consolidation with LLM-generated summaries and strict temporal containment to maintain coherent dialogue context.
  • Empirical evaluations demonstrate TMT's improved recall accuracy and significant reduction in token usage compared to baseline memory frameworks.

A Temporal Memory Tree (TMT) is a formal structure introduced within the TiMem memory framework to support hierarchical, temporally coherent memory consolidation for long-horizon conversational agents whose interaction histories exceed the finite context window limitations of LLMs. TMTs enable systematic transformation of raw conversational observations into progressively abstracted representations—such as distilled persona-level summaries—while supporting efficient, complexity-aware memory retrieval. The TMT design is characterized by strict formal constraints, semantic-guided consolidation of memories via LLMs without fine-tuning, and algorithmic recall procedures balancing precision and efficiency (Li et al., 6 Jan 2026).

1. Formal Architecture of the Temporal Memory Tree

A TMT is defined as a rooted, level-indexed tree

T=(M,E,τ,σ)\mathcal{T} = (M, E, \tau, \sigma)

with the following components:

  • M=i=1LMiM = \bigcup_{i=1}^{L} M_i: a collection of memory nodes partitioned into LL abstraction levels.
  • EM×ME \subseteq M \times M: directed edges (mu,mv)(m_u, m_v), where mum_u is parent to mvm_v and (mu)=(mv)+1\ell(m_u) = \ell(m_v)+1.
  • τ:MR2\tau: M \rightarrow \mathbb{R}^2: assigns a closed time interval τ(m)=[tstart(m),tend(m)]\tau(m) = [t_{\text{start}}(m), t_{\text{end}}(m)] to each node, with τ(mu)τ(mv)\tau(m_u) \supseteq \tau(m_v) for every (mu,mv)E(m_u, m_v) \in E.
  • σ:M(text,embedding)\sigma: M \rightarrow (\text{text}, \text{embedding}): assigns each node a semantic summary (LLM-generated text string) and a fixed-dimensional embedding vector.

The tree satisfies the following constraints:

  1. Temporal Containment: Each parent’s interval contains that of its children.
  2. Progressive Consolidation: The number of nodes per level is non-increasing, i.e., MiMi1|M_i| \leq |M_{i-1}| for i=2,,Li=2,\dots,L.
  3. Hierarchy Level Marking: (m)=i\ell(m) = i for mMim \in M_i.

Raw dialogue turns oto_t with timestamp tt are grouped into base-level segments gG1g \in \mathcal{G}_1 (e.g., each user–assistant exchange). Corresponding leaf nodes mM1m \in M_1 have τ(m)=[t,t]\tau(m) = [t, t] and σ(m)\sigma(m) produced by segment-level consolidation.

2. Semantic-Guided Memory Consolidation

At the core of TMT's memory abstraction is the semantic-guided consolidation operator at each level ii: Φi:(Ci,Hi,Ii){m(i)}\Phi_i: (\mathcal{C}_i, \mathcal{H}_i, \mathcal{I}_i) \longrightarrow \{m^{(i)}\} where:

  • Ci(g)\mathcal{C}_i(g): child memories from level (i1)(i-1) with intervals within grouping window gGig \in \mathcal{G}_i.
  • Hi\mathcal{H}_i: wiw_i most recent nodes at level ii for contextualization.
  • Ii\mathcal{I}_i: human-designed instruction describing the abstraction goal at level ii (e.g., factual summary, pattern extraction, persona distillation).

The consolidation process for each gGig \in \mathcal{G}_i proceeds as:

  1. Gather Ci(g)\mathcal{C}_i(g) and history Hi\mathcal{H}_i.
  2. Format an LLM prompt using Ii\mathcal{I}_i, passing texts of Ci(g)\mathcal{C}_i(g) and Hi\mathcal{H}_i.
  3. The LLM returns a summary σ~\tilde{\sigma} and its encoding femb(σ~)f_{\mathrm{emb}}(\tilde{\sigma}) (using a fixed encoder such as Qwen3-Embedding).
  4. Create new node m(i)m^{(i)} at level ii with τ(m(i))=g\tau(m^{(i)}) = g, σ(m(i))=(σ~,femb(σ~))\sigma(m^{(i)}) = (\tilde{\sigma}, f_{\mathrm{emb}}(\tilde{\sigma})), and edges linking m(i)m^{(i)} to all cCi(g)c \in \mathcal{C}_i(g).

No further fine-tuning is required beyond the initial LLM and embedding model setups.

3. Complexity-Aware Memory Recall

Memory recall from a TMT is dynamically tailored to query complexity:

  • Query Classification: A recall planner pp classifies input query qq with labels (c,K)(c, K), where c{simple,hybrid,complex}c \in \{\text{simple}, \text{hybrid}, \text{complex}\} and KK is a keyword set extracted for retrieval.
  • Leaf Activation: Each leaf node mM1m \in M_1 is scored:

s(m,q)=λcos(femb(σ(m)),femb(q))+(1λ)BM25(text(σ(m)),K)s(m, q) = \lambda\,\cos(f_{\mathrm{emb}}(\sigma(m)), f_{\mathrm{emb}}(q)) + (1-\lambda)\,\mathrm{BM25}(\mathrm{text}(\sigma(m)), K)

with λ=0.9\lambda = 0.9 in TiMem. Top-k1k_1 nodes are selected as Ω1(q)\Omega_1(q).

  • Hierarchical Propagation: For each leaf mΩ1(q)m \in \Omega_1(q), ancestors at levels in S(c)\mathcal{S}(c) (as determined by planner-defined retrieval strategy) are gathered into A(m,c)\mathcal{A}(m, c). The candidate pool is:

Ωc(q)=Ω1(q)mΩ1(q)A(m,c)\Omega_c(q) = \Omega_1(q) \cup \bigcup_{m \in \Omega_1(q)} \mathcal{A}(m, c)

  • Recall Gating: A filtering function ϕ\phi (implemented as a single LLM call with candidate texts) selects relevant candidates:

Ωϕ(q,c)={mΩc(q)ϕ(m,q,c)=1}\Omega_\phi(q, c) = \{ m \in \Omega_c(q) \mid \phi(m, q, c) = 1 \}

  • Final Ordering: Retained memories are sorted by hierarchy level and recency:

((m),tqtend(m))(\ell(m),\,|t_q - t_{\mathrm{end}}(m)|)

yielding the final recall set Ωfinal(q)\Omega_{\mathrm{final}}(q).

4. Core Algorithms and Pseudocode

Key routines are expressed as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
def INSERT_SEGMENT(o_t):
    # o_t = raw turn at time t
    create leaf m with τ(m) = [t, t]
    σ(m) = LLM_consolidate_level_1(o_t, history_1, I_1)
    add m to M_1

def SCHEDULE_CONSOLIDATION(level_i, window_g):
    C_i = {m in M_{i-1} | τ(m)  g}
    H_i = most recent w_i memories in M_i
    m_new = Φ_i(C_i, H_i, I_i)  # LLM call
    τ(m_new) = g
    σ(m_new) = text + embedding
    link m_new as parent to each c in C_i

def RECALL(q):
    (c, K) = planner(q)      # LLM call
    Ω_1 = TopK1_{m in M1} s(m, q; K)
    Ω_c = Ω_1  {ancestors of Ω_1 at levels in S(c)}
    Ω_p = gating_LLM(Ω_c, q, c)   # LLM filter
    return sort(Ω_p by (ℓ(m), |t_q - t_end(m)|))

This operational structure performs segment insertion, scheduled hierarchical consolidation, and complexity-aware recall with rigorous temporal alignment.

5. Quantitative Results and Evaluation Methodology

TMT is primarily evaluated within the TiMem framework using datasets and metrics as summarized below.

Dataset Questions Task Categories/Types
LoCoMo 1,540 4
LongMemEval-S 500 6

Evaluation uses:

  • Accuracy (LLJ):

Acc=1Nj=1N1[judge says “CORRECT”]\text{Acc} = \frac{1}{N}\sum_{j=1}^N \mathbf{1}[\text{judge says “CORRECT”}]

  • F1/ROUGE-L: Compared at token level between generated and gold answers (on LoCoMo).
  • Recalled Context Length: Average number of tokens recalled per query.
  • Latency: 50th/95th percentiles for end-to-end recall time.

Reported results for TiMem using TMT:

  • LoCoMo: 75.30% ± 0.16 (vs. best baseline 69.24%)
  • LongMemEval-S: 76.88% ± 0.30 (vs. best baseline 68.68%)
  • Context reduction on LoCoMo: 52.2% fewer tokens than baseline on recalled context.

6. Manifold Analysis and Emergent Persona Structure

TMT's progressive memory abstraction yields distinct effects in manifold space, assessed via UMAP and clustering diagnostics. For LoCoMo (10-user, real-data):

  • Silhouette Score: 0.093 (level 1) to 0.574 (level 5), 6.2×6.2\times improvement
  • Intrinsic Dimensionality: 7313\sim73\to13 across levels
  • Separation Ratio: 0.302.140.30\to2.14

For LongMemEval-S (single persona, synthetic):

  • Spread (variance): Shrinks by 50% from L1 to L5
  • Intrinsic Dimension: 10068100\to68
  • Radius95: Contracts by 44%

These observations indicate that, on genuine multi-user data, hierarchical consolidation amplifies user-specific features, resulting in well-separated persona clusters; on synthetic/homogeneous data, the primary effect is noise reduction and template convergence.

7. Significance and Implications

The TMT constitutes a foundational mechanism for temporally contiguous, hierarchically abstracted memory structures in long-horizon conversational agents. The combination of temporal containment, multi-level semantic consolidation, and complexity-aware recall produces improved accuracy and substantial reductions in recalled memory size relative to prior frameworks. This approach treats temporal continuity as an organizing principle, enabling stable personalization and robust scaling beyond the single-context window regime of present-day LLMs (Li et al., 6 Jan 2026). A plausible implication is applicability to broader domains requiring temporally structured, multi-level summary representations, suggesting cross-disciplinary utility in sequence modeling and lifelong learning.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Temporal Memory Tree (TMT).