Class DataDirectories
Centralized data directory resolution for JD.AI.
When running as a Windows Service (LocalSystem) or systemd unit (root),
Environment.SpecialFolder.UserProfile resolves to the service account's
profile rather than any real user folder. This class scans all user profiles
and falls back to ProgramData / /var/lib when no user-level .jdai directory
exists.
public static class DataDirectories
- Inheritance
-
DataDirectories
- Inherited Members
Properties
MemoryRoot
Root memory directory for all projects (~/.jdai/memory/).
public static string MemoryRoot { get; }
Property Value
OrgConfigPath
Path to organization config repository. Set via JDAI_ORG_CONFIG environment variable or by writing the path to ~/.jdai/org-config-path.
public static string? OrgConfigPath { get; }
Property Value
Root
Root data directory (e.g. C:\Users\jd.jdai or /home/jd/.jdai).
Resolution order:
- Environment variable
JDAI_DATA_DIR(explicit override) - Current user's profile
~/.jdai(if it exists or is writable) - Scan all user profiles for an existing
.jdaidirectory - Machine-level fallback:
%ProgramData%\JD.AIor/var/lib/jdai
public static string Root { get; }
Property Value
SessionsDb
Path to the SQLite session database.
public static string SessionsDb { get; }
Property Value
UpdateCacheDir
Path to the update-check cache file.
public static string UpdateCacheDir { get; }
Property Value
UsageDb
Path to the SQLite usage/metering database.
public static string UsageDb { get; }
Property Value
VectorsDb
Path to the SQLite vector store database.
public static string VectorsDb { get; }
Property Value
Methods
MemoryPath(string)
Memory directory for a specific project.
public static string MemoryPath(string projectId)
Parameters
projectIdstring
Returns
OpenClawWorkspace(string)
Path to the OpenClaw workspace directory for a given agent.
public static string OpenClawWorkspace(string agentId)
Parameters
agentIdstring
Returns
SetRoot(string)
Allow runtime override (e.g. from appsettings.json or tests). Must be called before first access of Root.
public static void SetRoot(string path)
Parameters
pathstring