# Settings

> Every key of the engine's settings file and its default.

The headless engine reads `settings.json` in its store, outside the vault (`datanotes store path` shows where), or the file given with `--settings`. Missing keys take their default.

| Key                          | Default                   | Applies            | Meaning                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------- | ------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `journalRetentionDays`       | `90`                      | At once            | Journal entries older than this many days are dropped (undo is no longer possible for them).                                                                                                                                                                                                                                                                                                                                                                             |
| `fileLogEnabled`             | `true`                    | At once            | Write log records to `logs/<day>.<source>.jsonl` in the engine’s store.                                                                                                                                                                                                                                                                                                                                                                                                  |
| `logRetentionDays`           | `30`                      | At once            | Log files older than this many days are deleted.                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `tableKey`                   | `"table"`                 | Settings file only | Row property naming the catalog table a note belongs to (`table: personal.metrics.mood`).                                                                                                                                                                                                                                                                                                                                                                                |
| `telemetryEnabled`           | `false`                   | At once            | Send the engine’s logs and traces to an OpenTelemetry collector or OTLP backend (OTLP/HTTP).                                                                                                                                                                                                                                                                                                                                                                             |
| `telemetryEndpoint`          | `"http://127.0.0.1:4318"` | At once            | OTLP/HTTP base URL; logs are POSTed to `<endpoint>/v1/logs`, traces to `<endpoint>/v1/traces`.                                                                                                                                                                                                                                                                                                                                                                           |
| `telemetryServiceName`       | `"datanotes"`             | At once            | `service.name` resource attribute.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `telemetryHeaders`           | `{}`                      | At once            | HTTP headers sent with every export: the API key or `Authorization` the backend asks for. Kept in the settings file; `OTEL_EXPORTER_OTLP_HEADERS` adds to them.                                                                                                                                                                                                                                                                                                          |
| `telemetryProtocol`          | `"http/protobuf"`         | At once            | OTLP encoding: `http/protobuf` (the OpenTelemetry default) or `http/json`.                                                                                                                                                                                                                                                                                                                                                                                               |
| `telemetryTraces`            | `true`                    | At once            | Send traces too while telemetry is on: a span for every HTTP request, operation and phase of an operation (lock, query, checks, journal, vault calls), with its duration and parent. `OTEL_TRACES_EXPORTER=none` turns them off.                                                                                                                                                                                                                                         |
| `telemetryTraceSampleRatio`  | `1`                       | At once            | Share of new traces kept, from 0 to 1 (1: every one). A trace continued from a caller (`traceparent`) follows the caller’s choice. `OTEL_TRACES_SAMPLER` overrides it.                                                                                                                                                                                                                                                                                                   |
| `telemetryMaxSpansPerTrace`  | `1000`                    | At once            | Most spans one trace may hold (1 to 100000); the others are dropped and counted in `datanotes.spans_dropped`.                                                                                                                                                                                                                                                                                                                                                            |
| `telemetrySlowSpanMs`        | `0`                       | At once            | A request, operation or background job lasting at least this many milliseconds is also logged as a WARN (0: never).                                                                                                                                                                                                                                                                                                                                                      |
| `telemetryEnvironment`       | `""`                      | At once            | `deployment.environment.name` of the logs and traces, such as `dev` or `home` (empty: none).                                                                                                                                                                                                                                                                                                                                                                             |
| `autoRecompute`              | `true`                    | At once            | After a row is edited by hand, recompute its generated / identity columns (a few seconds after the last change, as a journaled `recompute_columns` operation).                                                                                                                                                                                                                                                                                                           |
| `autoPack`                   | `true`                    | At once            | Once a day, after 10 minutes without writes, put the rows of closed periods into packs (`pack_rows` on every table with a `pack` option; the engine service only). Off: tables are packed only by `pack_rows`.                                                                                                                                                                                                                                                           |
| `repairLinksOnHandMove`      | `true`                    | At once            | Rewrite the links to a note renamed or moved by hand (in a file manager, with git or a sync tool), across the vault, once the vault has been quiet for 4 s and not while git pulls, rebases or merges. The repair is one journaled `repair_links` operation that undo takes back. Links an editor already rewrote stay as they are.                                                                                                                                      |
| `semanticEnabled`            | `false`                   | At once            | Semantic search: embed notes with `semanticProvider` (off by default: content is sent to it).                                                                                                                                                                                                                                                                                                                                                                            |
| `semanticProvider`           | `"ollama"`                | At once            | Embedding provider: `ollama`, `lmstudio`, `openrouter`, `openai` or `custom` (any OpenAI-compatible API).                                                                                                                                                                                                                                                                                                                                                                |
| `semanticBaseUrl`            | `""`                      | At once            | Empty: the provider’s default URL.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `semanticModel`              | `""`                      | At once            | Embedding model, e.g. `nomic-embed-text` (Ollama) or `openai/text-embedding-3-small` (OpenRouter).                                                                                                                                                                                                                                                                                                                                                                       |
| `semanticScope`              | `"vault"`                 | At once            | “vault”: every note; “tables”: only table rows.                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `semanticExclude`            | `[]`                      | At once            | Folders left out of the index.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `semanticBatchSize`          | `32`                      | At once            | Passages per embedding request.                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `writePriority`              | `true`                    | At once            | Write priority: while a write runs or waits, new reads wait for it (reads under way finish), so a stream of reads does not slow a write down. Writes start one at a time, in order.                                                                                                                                                                                                                                                                                      |
| `writePriorityMaxWaitMs`     | `100`                     | At once            | The longest a read waits for writes under `writePriority`, in milliseconds (0 to 60000).                                                                                                                                                                                                                                                                                                                                                                                 |
| `readCacheMaxBytes`          | `33554432`                | At once            | Memory for the answers of repeated reads, in bytes (0: no cache). A read asked again with the same arguments is answered from it while nothing it depends on has changed.                                                                                                                                                                                                                                                                                                |
| `vaultIndexEnabled`          | `true`                    | After a restart    | Keep an index of the vault’s notes in the engine’s store (`index/vault.sqlite`), so that a start reads only the notes changed since the last one, and `search_notes` only the notes that can match (headless engine, Node 22.13 or later). The index is a cache: deleting it is safe, the next start builds it again. Off: every start and every search reads every note, and the index is deleted.                                                                      |
| `httpServerPort`             | `27150`                   | After a restart    | Port of the HTTP API (on 127.0.0.1 unless the service is told otherwise): 1024 to 65535, or 0 for any free port. Any other value stops the engine from starting.                                                                                                                                                                                                                                                                                                         |
| `httpServerToken`            | `""`                      | After a restart    | The owner’s bearer token (generated at the first start).                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `httpCompression`            | `"remote"`                | At once            | Which clients of the HTTP API get answers of 16 KB or more compressed with gzip, when their request says `Accept-Encoding: gzip`: `remote` (default) those on other machines, `always` this machine’s too, `off` none. Compressing costs the engine time that a client on the same machine does not win back.                                                                                                                                                            |
| `storeBackupEnabled`         | `false`                   | After a restart    | Back up the engine’s store to a git repository: commits as `storeBackupIntervalSeconds` says, each pushed to `storeBackupRemote` (headless engine; `datanotes store backup` sets it).                                                                                                                                                                                                                                                                                    |
| `storeBackupRemote`          | `""`                      | After a restart    | The git remote the store backup pushes to, such as a private GitHub repository. Empty: commits in the store only, nothing pushed.                                                                                                                                                                                                                                                                                                                                        |
| `storeBackupIntervalSeconds` | `60`                      | After a restart    | How often the store backup looks for changes, in seconds (at least 10): when something changed, it commits between two operations (a consistent snapshot), then pushes.                                                                                                                                                                                                                                                                                                  |
| `storeSync`                  | `"operation"`             | At once            | How the engine makes its store files durable: `operation` syncs (fsync) every store file an operation wrote once, when the operation ends (the journal line, the transaction log, the blobs; the change feed after each of its appends); `off` leaves it to the operating system, which is faster but lets a power loss take the last operations’ undo data and history. Notes are never synced (they are written atomically, as Obsidian writes them). Headless engine. |
| `transactionLogFormat`       | `"segments"`              | Settings file only | How the transaction log writes new versions: `segments` (default since 3.1) appends them to a few large files (far fewer files for the antivirus, git and the store backup), which Datanotes 3.0 cannot read: run `datanotes store convert-log --to files` before you go back to it; `files` writes one file per version, which every Datanotes 3 reads. The engine reads both, also mixed in one folder: a log of 3.0 keeps its files and grows in segments.            |

The engine’s settings screen and `POST /datanotes/settings/update/` change them while the engine runs: see [Configuration](https://datanotes.dev/administration/configuration/#change-the-settings-over-http).
