There is a limit to how much history the AI can pay attention to, right? What if whenever the total amount of text sent to the AI gets too close to the limit, you have a summary creation AI create the summary of the first half of the last generated history.
So for example, suppose the limit is 10, you start writing:
1
2
3
4
5
6
7
8
9
10
Then as you get to 10, the app will ask the summary AI to create a summary from 1 to 5, and now the history the AI sees is:
1
3
5
6
7
8
9
10
Then, you play a little more and you hit the limit again:
1
3
5
6
7
8
9
10
11
12
And the summary AI does it's thing again:
1
5
7
8
9
10
11
12
And you play a little more:
1
5
7
8
9
10
11
12
13
14
And the summary AI goes at it:
1
7
9
10
11
12
13
14
And so on.
Of course I don't mean it would just blindly cut lines/words. But instead, it would actually run the contents thru an AI trained to create summaries, shorter descriptions of a given text that still tend to retain the gist of it. The idea is to sorta mimic human memory in the sense that for older stuff you just remember the most important details, but for more recent stuff you remember most of the details.
I don't mean rewrite the history the player sees though, just manipulate the text that gets sent to the AI (and if the player rewrites the history further back than the untouched section of the summary, then I guess depending on how slow the summary creation process is, you gotta ask the player whether they wanna reprocess the whole history or just stick with the last summary as it was before the edit).