Memory is the formation of: M=[MS,ML,MA]\mathcal{M}=[M_{S},M_{L},M_{A}] MSM_{S} - Shot term memory, verbose and full context MLM_{L} - Long term memory, summaries of conversation topics MAM_{A} - Attentive/Archivist memory, information fed to the model by archivist

Short term memory

MSM_{S} - Shot term memory, verbose and full context

For kk being the current numeration of the conversation and nn being the length of short term memory-

MS,k=i=kkn{ri,oi}M_{S,k}= \sum_{i=k}^{k-n} \{\mathcal{r}_{i},\mathcal{o}_{i} \}

MS,ki=ki=kn{ri,oi}M_{S,k} \subset_{i=k}^{i=k-n} \{\mathcal{r}_{i},\mathcal{o}_{i} \}

This may be modified such that only ri\mathcal{r}_{i} or oi\mathcal{o}_{i} is included in the output, in order to prevent redundant information. This is as oiri+1\mathcal{o}_{i} \mapsto \mathcal{r}_{i+1} quite neatly and it is expected that Ii,jIi=1Ii,jIi=1\mathbb{I}_{i,j} \cup \mathbb{I}_{i=1} \approx \mathbb{I}_{i,j} \cap \mathbb{I}_{i=1} when performing a language model chain.

Long term memory

MLM_{L} - Long term memory, Conciseand Relevant summary of a conversation. Note: ϕsummarize\phi_{summarize} may be any arbitrary function to summarize, not just a language model call.

This is derived from some arbitrary summarization function upon the prior conversation. The exact algorithm and function for implementing this may vary.

ML,k=ϕsummarize({[r1,o1],,[rk,ok] })\mathcal{M}_{L,k}= \phi_{summarize}(\{[\mathcal{r}_{1},\mathcal{o}_{1}],\dots,[\mathcal{r}_{k}, \mathcal{o}_{k} ] \ \})

For cases where the summarization function produces a larger corpus than it’s input than this is considered an expansion and the summarization function is defined as ϕexpand\phi_{expand}. This is a meta-cognitive effect that should be considered similar to a person’s ability to narrativize some basic facts into a larger story that contains far more information. Which is a function that expands upon ItargetI1kI_{target} \in \mathbb{I}_{1\to k}.

ϕexpand(I1k)=o(Iexpand)\phi_{expand}(\mathbb{I}_{1\to k})=\mathcal{o}(\mathbb{I}_{expand})

Where

IexpandI1k=Itarget\mathbb{I}_{expand} \hspace{0.1 cm} \cap \mathbb{I}_{1\to k} = I_{target}

Attentive Memory

MAM_{A} - Attentive/Archivist memory, information fed to the model by Archivist

This is the set of information not present in S,MS,ML\mathcal{S,M_{S},M_{L}} or P\mathcal{P} that is considered relevant to ItargetI_{target}.

In order to perform these operations a variety of options are available.