Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Addition of memory snippets #82

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

esolithe
Copy link

A variant of the ideas of World Info and Vector based Long Term Memory. While within Lite we cannot expect vector storage to exist - at least not in its traditional form of embeddings any time soon, it is possible to implement the searching algorithms they use to extract information from the entire game text which are relevant. These are based on similarity, and after testing a few I settled on Tf-Idf - which is explained more in the links I provided in the comments within the new code.

The general basis looks for frequency of distinctive words, the snippet length and a couple of factors like that - to try and provide a better search while still remaining performant. While this is still a fairly rudimentary implementation / integration within Lite, it runs entirely browser side and seems to do alright with finding relevant matches.

With the implementation, there is the addition of a new menu under context which allows enabling the new option, modifying the minimum similarity required to find matches and how many matches to include (similar to Top N). The matches are included with the world info as an authors note formatted block with the different snippets.

While I have tried to generally match formatting / style with the existing code, as this is my first PR for Lite apologies in advance if there's anything out of place!

@LostRuins LostRuins changed the base branch from main to dev July 27, 2024 09:13
@LostRuins LostRuins added the enhancement New feature or request label Jul 27, 2024
index.html Outdated Show resolved Hide resolved
index.html Show resolved Hide resolved
@BBC-Esq
Copy link

BBC-Esq commented Aug 5, 2024

Hope I did this right...

@esolithe esolithe requested a review from BBC-Esq August 6, 2024 23:33
@BBC-Esq
Copy link

BBC-Esq commented Aug 7, 2024

Was there something to review or you mentioned that you fixed the issue?

@LostRuins
Copy link
Owner

I have yet to try the improved version, which I will review once you two are done with it

Copy link

@BBC-Esq BBC-Esq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trust your judgment unless there's a specific bug, which I can help troubleshoot.

@esolithe
Copy link
Author

esolithe commented Aug 7, 2024

Was there something to review or you mentioned that you fixed the issue?

As discussed in the chat on Discord, the requested settings should now be UI options. Henky is giving it a quick go I believe, and the library used can be found here: https://github.com/lucaong/minisearch

And the minified build in particular here: https://www.jsdelivr.com/package/npm/minisearch (https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/index.min.js)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants