All you need to do is simply turning these static chatHistory in dynamic one.
Instead of static;
0 / Intro
1st message
2nd message
3rd message
4th message
...
26th message
...
an so on and so forth (t. Slavoj Žižek)
It should be:
0 / intro (can be excluded)
some relevant msg pulled by vector similiarity
other msg, still similiar
another one more similiar
msg but the order preserved
another one, the orded still preserved
lastMsg
This way, the context and the cost are narrowed down,
---
Yeah, there's already ChatVector. But it sucks. So, o' cohee, extensionmakie, stdevs, stscriptmakie, javascriptbaron, and so on and so forth, please do the needful to enchance this feature, okay???
---
>summary
more bloat if chatHistory is still static.
>lorebook + stScript
meme, more big bloated context if chatHistory is still static