Skip to content

Conversation

@linuztx
Copy link
Contributor

@linuztx linuztx commented Nov 22, 2025

  • Migrated user data to /usr directory: Moved all persistent user data (chats, uploads, downloads, tasks, secrets, settings) from /tmp to /usr to centralize storage and simplify backups.
  • Restructured Memory, Knowledge, and Instruments:
    • Moved custom knowledge and instruments to /usr/knowledge/custom and /usr/instruments/custom.
    • Consolidated memory storage into /usr/memory.
    • Flattened default knowledge and instrument directories (removed default subfolder).
    • Relocated memory embeddings cache to /tmp/memory/embeddings (transient data).
  • Added migration script: Implemented python/helpers/migration.py to automatically move existing data from /tmp to /usr on startup.
  • Updated system paths: Modified memory.py, persist_chat.py, task_scheduler.py, settings.py, and other helpers to reflect the new directory structure.
  • Updated Frontend: Adjusted hardcoded paths in attachmentsStore.js and API documentation to point to /usr/uploads instead of /tmp/uploads.
  • Cleanup: Removed individual ignores in .gitignore in favor of a single /usr exclusion rule

Copy link
Collaborator

@frdel frdel left a comment

Choose a reason for hiding this comment

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

Thanks, adding some notes.
Some of these are my mistakes from the original ticket, sorry for that, but they are easy to fix.
Please test the migration on some of your dev environments and mapped docker folders to be sure.
Thank you.

# load custom instruments descriptions
index = knowledge_import.load_knowledge(
log_item,
files.get_abs_path("usr/instruments/custom"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be just usr/instruments


# Get subdirectories from memory folder
subdirs = files.get_subdirectories("memory", exclude="embeddings")
subdirs = files.get_subdirectories("usr/memory", exclude="embeddings")
Copy link
Collaborator

Choose a reason for hiding this comment

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

no more need to exclude embeddings as they are now in tmp/

_move_dir("tmp/upload", "usr/upload")
_move_dir("tmp/downloads", "usr/downloads")
_move_dir("tmp/email", "usr/email")
_move_dir("knowledge/custom", "usr/knowledge/custom")
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be just usr/knowledge (my bad, I wrote it in the ticket)

_move_dir("tmp/downloads", "usr/downloads")
_move_dir("tmp/email", "usr/email")
_move_dir("knowledge/custom", "usr/knowledge/custom")
_move_dir("instruments/custom", "usr/instruments/custom")
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be just usr/instruments (my bad, I wrote it in the ticket)


_move_file("tmp/settings.json", "usr/settings.json")
_move_file("tmp/secrets.env", "usr/secrets.env")
_move_file("tmp/default.env", "usr/default.env")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't use default.env, just .env (i forgot to add space between default and .env in the original ticket).
The .env is loaded in dotenv.py in helpers using get_abs_path(.env), this has to be adjusted for the new path.


# Handle memory directory
memory/**
!memory/**/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's keep all of these original folders here for safety, we don't want our devs to accidentaly upload their memory or files...


# Handle knowledge directory
knowledge/**
!knowledge/**/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's ignore knowledge/custom for safety.
Knowledge itself should not be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants