brucepro / Memoir

Memoir+ a persona extension for Text Gen Web UI. That includes memory, emotions, command handling and more.
MIT License
143 stars 15 forks source link

Multi-User/Multi-Persona Support #36

Open ike709 opened 1 month ago

ike709 commented 1 month ago

Description

I have a use-case in which multiple end users share a single Text Generation Web UI setup. With the addition of proper support for multiple users in SillyTavern's version 1.12 pre-release, I intend to migrate everyone to their own unique SillyTavern user accounts.

I would like the ability to tie a separate Memoir Persona to each SillyTavern user so that each user individually builds up their own distinct collection of goals and memories. I think adding support for this functionality could also tie in nicely with per-character personas requested in https://github.com/brucepro/Memoir/issues/28

Example End-User Workflow

Bob and Alice have two separate SillyTavern user accounts. Both have access to a character card we'll name HAL 9000. Alice has access to an additional character card we'll call GLaDOS. This setup also integrates Memoir.

When Bob interacts with HAL9000, this should develop a distinct Memoir persona that only Bob experiences. When Alice interacts with HAL9000, this should develop an entirely separate persona from Bob's.

If Alice creates a SillyTavern group chat with both HAL9000 and GLaDOS, then HAL9000 should use the Alice-HAL9000 persona and GLaDOS should develop its own distinct Alice-GLaDOS persona.

Implementation Idea

Obviously you know more about your own project than I do, but I skimmed around the code for interacting with the SQLite database and it seems like this could be done by just creating a new persona_id column on most of the tables, and then having a new personas table which relates some SillyTavern character identifier to a specific persona_id. Similarly, there needs to be some form of validation that a particular SillyTavern user can access a specific character persona. Leaking Alice's personas to Bob is undesirable.

On the SillyTavern side of things, I presume some minimal SillyTavern extension will be needed for it to actually supply the user/character IDs for Memoir.

brucepro commented 1 month ago

might be easier to just rename the database and vector stores with unique id's that are tied to those user accounts. That way you could have shared bots or individual. I have been considering the best ways to silo the memories for multiple users.

ACarloGitHub commented 1 month ago

HI. This feature is also very interesting to me. It would dramatically increase the usefulness of Memoir, which as it stands is still one of the most useful and also most effective tools for using long and short term memory with local models. Please implement it. Thanks