[GH-ISSUE #1833] [CHORE]: XDG Base Directory Specification Violation: Incorrect Data Storage #1194

Closed
opened 2026-02-22 18:23:38 -05:00 by yindo · 3 comments
Owner

Originally created by @chymian on GitHub (Jul 9, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1833

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

Description:

The Anything LLM Desktop application stores various types of data, including cache, dictionaries, and storage, solely in the $XDG_CONFIG_HOME directory (e.g., ~/.config/anythingllm-desktop. This is a violation of the XDG Base Directory Specification, which recommends separating data into distinct categories and storing them in their respective base directories.

Expected Behavior:

According to the XDG Base Directory Specification, data should be stored in the following directories:

$XDG_DATA_HOME (e.g., ~/.local/share/anythingllm-desktop): For user-specific data files (e.g., blob storage, dictionaries, storage)
$XDG_CACHE_HOME (e.g., ~/.cache/anythingllm-desktop): For non-essential data files that can be easily regenerated (e.g., cache, GPUCache)
$XDG_STATE_HOME (e.g., ~/.local/state/anythingllm-desktop): For user-specific state data (e.g., Crashpad, Session Storage)
$XDG_CONFIG_HOME (e.g, ~/.config/anythingllm-desktop): Only for user-specific configuration files (e.g., config.json, Preferences)
Actual Behavior:

The application currently stores all data in the $XDG_CONFIG_HOME directory, which is not in compliance with the XDG Base Directory Specification. This can lead to confusion, difficulties in debugging, and potential issues with data integrity.

Proposal:

Update the application to separate data into distinct categories and store them in their respective base directories according to the XDG Base Directory Specification.
Migrate existing data to the correct directories.
Ensure that the application correctly handles and looks up data in the new directories.

Steps to Reproduce:

Run the Anything LLM Desktop application.
Verify that all data is stored in the $XDG_CONFIG_HOME directory.

System Information:

Operating System: linux
Anything LLM Desktop version: up tp latest

Additional Context:

This issue is important for maintaining a clean and organized file system, adhering to established standards, and ensuring a better user experience.
i.e. think: It's best practice to keep the ~/.config in a git-repo, which would then have to digest models, cache, etc…

Are there known steps to reproduce?

No response

Originally created by @chymian on GitHub (Jul 9, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1833 ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? ## Description: The Anything LLM Desktop application stores various types of data, including cache, dictionaries, and storage, solely in the $XDG_CONFIG_HOME directory (e.g., `~/.config/anythingllm-desktop`. This is a violation of the XDG Base Directory Specification, which recommends separating data into distinct categories and storing them in their respective base directories. ## Expected Behavior: According to the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), data should be stored in the following directories: $XDG_DATA_HOME (e.g., ~/.local/share/anythingllm-desktop): For user-specific data files (e.g., blob storage, dictionaries, storage) $XDG_CACHE_HOME (e.g., ~/.cache/anythingllm-desktop): For non-essential data files that can be easily regenerated (e.g., cache, GPUCache) $XDG_STATE_HOME (e.g., ~/.local/state/anythingllm-desktop): For user-specific state data (e.g., Crashpad, Session Storage) $XDG_CONFIG_HOME (e.g, ~/.config/anythingllm-desktop): Only for user-specific configuration files (e.g., config.json, Preferences) Actual Behavior: The application currently stores all data in the $XDG_CONFIG_HOME directory, which is not in compliance with the XDG Base Directory Specification. This can lead to confusion, difficulties in debugging, and potential issues with data integrity. ## Proposal: Update the application to separate data into distinct categories and store them in their respective base directories according to the XDG Base Directory Specification. Migrate existing data to the correct directories. Ensure that the application correctly handles and looks up data in the new directories. ## Steps to Reproduce: Run the Anything LLM Desktop application. Verify that all data is stored in the $XDG_CONFIG_HOME directory. ## System Information: Operating System: linux Anything LLM Desktop version: up tp latest ## Additional Context: This issue is important for maintaining a clean and organized file system, adhering to established standards, and ensuring a better user experience. i.e. think: It's best practice to keep the `~/.config ` in a git-repo, which would then have to digest models, cache, etc… ### Are there known steps to reproduce? _No response_
yindo added the enhancementwontfixDesktopOS: Linux labels 2026-02-22 18:23:38 -05:00
yindo closed this issue 2026-02-22 18:23:38 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jul 10, 2024):

Given the complexity of implementing this as the desktop app is cross-platform we are not going to undertake the effort of splitting storage into various directories that only would apply to Linux builds since we use getPath('AppData') and since the information stored here is specific to the user using AnythingLLM I don't see this as a negligent use of the XDG home directory.

If anything, the trouble, debugging, and headaches of having users only on Linux specify their directory to store data to is more likely to amount to even more Github issues that would instead be permission related 😓.

It additionally helps that should someone have issues we can consistently refer to a singular place all user app data can be located without having to follow up with "well maybe, unless you changed it, in which case it could be anywhere"

@timothycarambat commented on GitHub (Jul 10, 2024): Given the complexity of implementing this as the desktop app is cross-platform we are not going to undertake the effort of splitting storage into various directories that only would apply to Linux builds since we use [getPath('AppData')](https://www.electronjs.org/docs/latest/api/app#appgetpathname) and since the information stored here _is specific to the user using AnythingLLM_ I don't see this as a negligent use of the XDG home directory. If anything, the trouble, debugging, and headaches of having users only on Linux specify their directory to store data to is more likely to amount to even more Github issues that would instead be permission related 😓. It additionally helps that should someone have issues we can consistently refer to a singular place all user app data can be located without having to follow up with "_well maybe, unless you changed it, in which case it could be anywhere_"
Author
Owner

@timothycarambat commented on GitHub (Jul 10, 2024):

I do appreciate the comprehensive, well written, and thorough commentary on such an issue. Hopefully, you can understand our position on the matter as well

@timothycarambat commented on GitHub (Jul 10, 2024): I do appreciate the comprehensive, well written, and thorough commentary on such an issue. Hopefully, you can understand our position on the matter as well
Author
Owner

@chymian commented on GitHub (Jul 13, 2024):

@timothycarambat
out of 40 years of sysadmin experience, no I can't understand, why an very young and opinionated app thinks it needs to rape a system and breaks all rules, which make such a sytem stable and consistent over very long time (many decades!).
just my 2 cents.
as a follow up of this violation, it will not go into any portfolio I would suggest to my clients - even so, I like your work and see a good future for this… what a pitty.
Hopefully, you can understand my position on the matter as well but as a Sysadmin one has a responsibility.

@chymian commented on GitHub (Jul 13, 2024): @timothycarambat out of 40 years of sysadmin experience, no I can't understand, why an very young and opinionated app thinks it needs to rape a system and breaks all rules, which make such a sytem stable and consistent over very long time (many decades!). just my 2 cents. as a follow up of this violation, it will not go into any portfolio I would suggest to my clients - even so, I like your work and see a good future for this… what a pitty. Hopefully, you can understand my position on the matter as well but as a Sysadmin one has a responsibility.
yindo changed title from [CHORE]: XDG Base Directory Specification Violation: Incorrect Data Storage to [GH-ISSUE #1833] [CHORE]: XDG Base Directory Specification Violation: Incorrect Data Storage 2026-06-05 14:39:27 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1194