Skip to main content

Module paths

Module paths 

Source
Expand description

Filesystem paths for the project-local database and app support directories. XDG path resolution and traversal-safe overrides.

Resolves data directories via directories::ProjectDirs and validates that user-supplied paths cannot escape the project root.

Precedence (G-T-XDG-04): CLI flag --db / db_override → XDG setting db.path → XDG data dir default graphrag.sqlite → cwd fallback. Product SQLITE_GRAPHRAG_* env vars are not read.

Structs§

AppPaths
Resolved filesystem paths used by the CLI at runtime.
WritePolicy
Whether this process is allowed to inherit its target from the environment.

Enums§

TargetSource
Which layer of configuration supplied the target database.

Functions§

cache_dir
Returns the cache root for lock files, model files and other artifacts.
config_dir
Returns the config directory for the application.
install_write_policy
Installs the target policy for this process. Idempotent, first call wins.
sidecar_path
Derives a sidecar file path next to the database (e.g. the enrich/ingest queue), so worklist files follow --db instead of the process CWD. Falls back to the bare filename (CWD) when db_path has no parent — preserving the legacy default-DB layout.