agnai icon indicating copy to clipboard operation
agnai copied to clipboard

Feat: Sync account data in Google Drive (or other)

Open acidbubbles opened this issue 2 years ago • 0 comments

TL;DR: Saving characters and chats in Google Drive or similar would make them portable, and better protected against a data dump.

So, right now there are three types of storage:

  • MongoDB
  • Local Storage
  • JSON Files

I would say, saving JSON files in Google Drive instead of the disk itself (or another shared storage) would be GREAT. The reason being that I can install Agnai on multiple machines, and share the AI backends configuration, characters, and chat.

I would like for this to work with user accounts though since I also use Agnai to play scenarios with my kids for example, and I want those to be really separated from personal chats.

So, in short here's the idea:

  1. When creating an account, you can configure a storage backend (same as AI backends, voice backends, image backends, etc.) - by default it would be MongoDB for logged in accounts and local storage for logged in accounts.
  2. When you configure a backend, all operations would load data against that backend, very similar to loading JSON files, except we need to use HTTP instead of FS and we also need the authorization, which is in MongoDB / JSON.

I guess this means there's the same choices you already have for "account data", but "characters, chats and settings data" would have additional options.

Subtelty: When specifying a new backend, there would be

  • Some kind of migration, or;
  • IT would be a destructive operation, or;
  • You could switch from one backend to another, effectively creating "profiles" with each their own characters, chats and settings (pretty much the same option as the destructive one, except you can switch by selecting one of your available backends in a drop down somewhere), or;
  • You could specify when creating a character where to store the data and the chats, which complicates things more than anything

Personally, I think it would be simpler to configure backends and only have one active in your profile

That also solves the issue of the chat data being stored in agnai.chat (see #155), and making it portable (#83) since you BYOB for storage, too.

What do you think? Does that sound like a good idea to you?

acidbubbles avatar Apr 16 '23 03:04 acidbubbles