-
Notifications
You must be signed in to change notification settings - Fork 44
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
base: dev
Are you sure you want to change the base?
Conversation
…nisearch and modifying search to use multiple differently prioritised segments
Hope I did this right... |
…f fixes for search results
Was there something to review or you mentioned that you fixed the issue? |
I have yet to try the improved version, which I will review once you two are done with it |
There was a problem hiding this 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.
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) |
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!