Table of Contents

Class DataDirectories

Namespace
JD.AI.Core.Config
Assembly
JD.AI.Core.dll

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

string

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

string

Root

Root data directory (e.g. C:\Users\jd.jdai or /home/jd/.jdai). Resolution order:

  1. Environment variable JDAI_DATA_DIR (explicit override)
  2. Current user's profile ~/.jdai (if it exists or is writable)
  3. Scan all user profiles for an existing .jdai directory
  4. Machine-level fallback: %ProgramData%\JD.AI or /var/lib/jdai
public static string Root { get; }

Property Value

string

SessionsDb

Path to the SQLite session database.

public static string SessionsDb { get; }

Property Value

string

UpdateCacheDir

Path to the update-check cache file.

public static string UpdateCacheDir { get; }

Property Value

string

UsageDb

Path to the SQLite usage/metering database.

public static string UsageDb { get; }

Property Value

string

VectorsDb

Path to the SQLite vector store database.

public static string VectorsDb { get; }

Property Value

string

Methods

MemoryPath(string)

Memory directory for a specific project.

public static string MemoryPath(string projectId)

Parameters

projectId string

Returns

string

OpenClawWorkspace(string)

Path to the OpenClaw workspace directory for a given agent.

public static string OpenClawWorkspace(string agentId)

Parameters

agentId string

Returns

string

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

path string