Skip to content

Configuration reference

Lore’s configuration has three layers, in order of precedence (highest first):

  1. Environment variables (the LORE_* family — see the env-vars reference page) — process-level overrides, used by the gateway CLI and runtime.
  2. The .lore.json file in the project root — per-project, JSONC-parseable, the primary config surface for memory behavior, budget, distillation, search, knowledge, and cross-project settings. This page documents it.
  3. Built-in defaults — every field is optional; the Zod schema supplies safe defaults for anything you omit.

The gateway looks for the .lore.json file in a single location:

  • The project root — the directory the gateway was launched from, identified by the .lore.json file at its top level.

If no .lore.json is found, the gateway uses all defaults (every field is optional). In hosted mode (env var LORE_HOSTED_MODE=1), .lore.json is not read at all — a crafted file on a client-controlled path could alter gateway behavior, so the gateway uses the defaults to prevent tampering. Hosted-mode deployments should configure Lore through other means (admin-controlled env vars, fixed configuration baked into the deployment).

The file is JSONC (JSON with // line comments and slash-star block comments, plus trailing commas). Example:

{
// Use a cheaper worker model for distillation
"workerModel": { "providerID": "anthropic", "modelID": "claude-3-5-haiku-latest" },
"curator": { "enabled": true, "maxEntries": 30 },
}

The cleanest way to override a single field is via env var if Lore reads it, or by adding the field to .lore.json in the project root. See the env-vars reference page for the env-var override path; everything else is here in the .lore.json reference below.

  • model — Default session model. When omitted, Lore uses the model from the first client request.
  • workerModel — Background-worker model for distillation, curation, and query expansion. Same-provider invariant: workers MUST use the same provider as the session.
  • budget — Context-window budget fractions. Sum plus LTM ≈ 1.0.
  • idleResumeMinutes — Minutes of inactivity after which Lore refreshes the byte-identity caches on resume (upstream prompt cache is cold). 5 = matches Anthropic’s default-tier TTL. Set to 60 for extended (1h) cache tier. 0 to disable. Default: 5.
  • distillation — Distillation pipeline tuning (segment size, thresholds, tool-output truncation).
  • knowledge — Long-term knowledge (curator, entity injection) controls.
  • curator — Curator scheduling and consolidation thresholds.
  • pruning — Storage retention and emergency-pruning thresholds.
  • search — Recall and search pipeline tuning: FTS weights, query expansion, vector boost, embeddings, and output formatting.
  • cache — Anthropic prompt cache TTL and speculative warming.
  • workspaces — Workspace sub-project paths or globs (relative to .lore.json). Imported into the root knowledge base on startup. Supports literal paths and single-level globs (e.g. “packages/*”).
  • crossProject — Include cross-project knowledge in compaction summaries and auto-promote knowledge that recurs across 3+ projects. Default: true.
  • agentsFile — AGENTS.md export/import configuration.
  • loreFile.lore.md export/import configuration.
  • user — User identity for the self-entity. Falls back to git config user.name / user.email if omitted.

Default session model. When omitted, Lore uses the model from the first client request.

FieldTypeDefaultConstraintsDescription
providerIDstringProvider ID (e.g. ‘anthropic’, ‘openai’).
modelIDstringModel identifier within the provider.

Background-worker model for distillation, curation, and query expansion. Same-provider invariant: workers MUST use the same provider as the session.

FieldTypeDefaultConstraintsDescription
providerIDstringProvider ID for the worker model.
modelIDstringModel identifier within the provider.

Context-window budget fractions. Sum plus LTM ≈ 1.0.

FieldTypeDefaultConstraintsDescription
distillednumber0.25min 0.05, max 0.5Fraction of usable context for distilled prefix. Default: 0.25.
rawnumber0.4min 0.1, max 0.7Fraction of usable context for the recent raw window (un-distilled). Default: 0.4.
outputnumber0.25min 0.1, max 0.5Fraction of usable context reserved for model output. Default: 0.25.
ltmnumber0.05min 0.02, max 0.3Max fraction of usable context reserved for context-bound LTM system-prompt injection. Default: 0.05 (5%).
preferenceLtmnumber0.02min 0.01, max 0.1Fraction of usable context for stable LTM (preferences). Independent of ltm. Default: 0.02 (2%).
targetCacheReadCostPerTurnnumber0.1min 0Per-turn cache-read cost target in dollars. Controls when layer 0 escalates to layer 1. Default: 0.10. Set to 0 to disable cost-aware capping.
maxLayer0Tokensnumbermin 0Direct override for the layer-0 token cap. 0 = disabled (use full context). Default: undefined (use cost-aware auto).
targetBustCostnumber1min 0@deprecated Ignored. Tier-based bust-vs-continue replaces static cap.
maxContextTokensnumbermin 0@deprecated Ignored. Tier-based bust-vs-continue replaces static cap.

Minutes of inactivity after which Lore refreshes the byte-identity caches on resume (upstream prompt cache is cold). 5 = matches Anthropic’s default-tier TTL. Set to 60 for extended (1h) cache tier. 0 to disable. Default: 5.

Distillation pipeline tuning (segment size, thresholds, tool-output truncation).

FieldTypeDefaultConstraintsDescription
minMessagesnumber5min 3Minimum number of messages before a segment is eligible for distillation. Default: 5.
minSegmentTokensnumber64min 16Minimum tokens for a segment to be worth distilling. Default: 64.
maxSegmentTokensnumber16384min 256Maximum tokens per distillation segment before splitting. Default: 16384.
metaThresholdnumber20min 3Number of gen-0 segments that triggers meta-distillation. Default: 20.
toolOutputMaxCharsnumber4000min 0Max chars per tool output for distillation input. Set to 0 to disable truncation. Default: 4000.
recentSegmentsToKeepnumber5min 0Number of most-recent gen-0 segments to keep un-archived when meta-distillation fires. Default: 5.

Long-term knowledge (curator, entity injection) controls.

FieldTypeDefaultConstraintsDescription
enabledbooleantrueEnable long-term knowledge storage and system-prompt injection. When false, the curator is disabled but recall and context management remain active. Default: true.
maxEntityInjectnumber30min 0Max entities to inject into the agent system prompt. Set to 0 to disable. Default: 30.

Curator scheduling and consolidation thresholds.

FieldTypeDefaultConstraintsDescription
enabledbooleantrueEnable the curator (knowledge extraction from conversation). Default: true.
onIdlebooleantrueRun the curator on session idle (in addition to turn-based). Default: true.
afterTurnsnumber3min 1Minimum turns between curator runs. Default: 3.
maxEntriesnumber25min 10Max knowledge entries per project before consolidation. Default: 25.

Storage retention and emergency-pruning thresholds.

FieldTypeDefaultConstraintsDescription
retentionnumber120min 1Days to keep distilled temporal messages before pruning. Default: 120.
maxStoragenumber1024min 50Max total temporal_messages storage in MB before emergency pruning. Default: 1024 (1 GB).

Recall and search pipeline tuning: FTS weights, query expansion, vector boost, embeddings, and output formatting.

FieldTypeDefaultConstraintsDescription
ftsWeightsobject{"title":6,"content":2,"category":3}BM25 column weights for knowledge FTS5 [title, content, category].
recallLimitnumber10min 1, max 50Max results per source in recall tool before fusion. Default: 10.
queryExpansionbooleantrueEnable LLM-based query expansion (2-3 alternative phrasings) for the recall tool. Guarded by a 3s timeout. Default: true.
queryExpansionMaxTermsnumber8min 2, max 20Max query terms (after stopword removal) for LLM expansion. Longer queries skip expansion. Default: 8.
vectorBoostWeightnumber1.5min 1, max 5RRF weight multiplier for vector search lists (when query has enough terms). Set to 1.0 to disable. Default: 1.5.
vectorBoostMinTermsnumber2min 1, max 10Minimum meaningful query terms (after stopword removal) to activate vector boost. Default: 2.
embeddingsobject{"enabled":true,"provider":"local","model":"nomic-ai/nomic-embed-text-v1.5","dimensions":768}Vector embedding search provider, model, and dimensions.
recallobject{"charBudget":12000,"relevanceFloor":0.15,"maxResults":15}Recall output formatting and result-count limits.

BM25 column weights for knowledge FTS5 [title, content, category].

FieldTypeDefaultConstraintsDescription
titlenumber6min 0BM25 weight for the entry title column. Default: 6.0.
contentnumber2min 0BM25 weight for the entry content column. Default: 2.0.
categorynumber3min 0BM25 weight for the entry category column. Default: 3.0.

Vector embedding search provider, model, and dimensions.

FieldTypeDefaultConstraintsDescription
enabledbooleantrueEnable vector embedding search. Set to false to explicitly disable. Default: true.
providerenum"local"Embedding provider. “local” (no API key, on-device), “voyage” (VOYAGE_API_KEY), “openai” (OPENAI_API_KEY). Default: “local”.
modelstring"nomic-ai/nomic-embed-text-v1.5"Model ID for the embedding provider. Default depends on provider.
dimensionsnumber768min 64, max 2048Embedding dimensions. Default: 768 (local) / 1024 (voyage) / 1536 (openai). Local Nomic v1.5 supports Matryoshka: 64, 128, 256, 512, 768.

Recall output formatting and result-count limits.

FieldTypeDefaultConstraintsDescription
charBudgetnumber12000min 2000, max 20000Total character budget for recall output (~3K tokens at 12000 chars). Default: 12000.
relevanceFloornumber0.15min 0, max 1Minimum RRF score (relative to top) to keep. Set to 0 to disable. Default: 0.15.
maxResultsnumber15min 3, max 30Max results to show in recall output. Default: 15.

Anthropic prompt cache TTL and speculative warming.

FieldTypeDefaultConstraintsDescription
conversationTTLenum"auto"Conversation cache breakpoint TTL. “5m” (Anthropic standard), “1h” (extended tier, 2× write cost), “auto” (auto-upgrade based on cold-cache rate). Default: “auto”.
warmingobject{"enabled":true}Speculative cache warming (keepalive requests before TTL expiry).

Speculative cache warming (keepalive requests before TTL expiry).

FieldTypeDefaultConstraintsDescription
enabledbooleantrueEnable cache warming. Default: true.
minReturnProbabilitynumbermin 0, max 1Override return probability threshold below which warming is skipped. Default: auto-derived from cost ratio.

Workspace sub-project paths or globs (relative to .lore.json). Imported into the root knowledge base on startup. Supports literal paths and single-level globs (e.g. “packages/*”).

Include cross-project knowledge in compaction summaries and auto-promote knowledge that recurs across 3+ projects. Default: true.

AGENTS.md export/import configuration.

FieldTypeDefaultConstraintsDescription
enabledbooleantrueEnable AGENTS.md export/import behaviour. Set to false to disable. Default: true.
pathstring"AGENTS.md"Path to the agents file, relative to the project root. Default: ‘AGENTS.md’.

.lore.md export/import configuration.

FieldTypeDefaultConstraintsDescription
enabledbooleantrueSet to false to disable .lore.md export/import. When disabled, .lore.md is not written, startup skips the .lore.md import branch, the recall tool omits the .lore.md commit reminder, and the file watcher ignores .lore.md. Knowledge stays in the database and is still injected into the system prompt via LTM. Pair with agentsFile.enabled=true to keep sharing knowledge via an inline section in AGENTS.md. Default: true.

User identity for the self-entity. Falls back to git config user.name / user.email if omitted.

FieldTypeDefaultConstraintsDescription
namestringDisplay name. Overrides git config user.name.
emailstringEmail address. Overrides git config user.email.
aliasesarray<{ type, value }>[]Additional aliases for the self entity.
metadataRecord<string, unknown>Metadata for the self entity (description, role, notes, etc.).