Configuration¶
All tuneable parameters live in particles/config.py as a Pydantic
model. The canonical sample is config.yaml.sample in the repo
root; copy it to ~/.particles/config.yaml, or to any path you name with
PARTICLES_CONFIG, to override defaults.
Which sections apply to your install¶
Every section is tagged [client] or [engine] in config.yaml.sample.
Both are always loaded and both are valid to set; the tag says
which distribution acts on the section:
| Tag | Read by | Effective in |
|---|---|---|
[client] |
the Client layer, shipped in linkedparticles-core |
every install |
[engine] |
the Engine layer and the surfaces, shipped in linkedparticles |
the full install only |
If you installed linkedparticles (the ordinary case, and what every guide
here assumes), all 64 sections apply and the tags are informational. They
matter only for a linkedparticles-core-only install, which is the store-free
Client substrate: there an [engine] section still validates and still loads,
but nothing present reads it. That is a deliberate trade (the two
distributions share one import package, so they share one config model), and
the tag is how the inert surface is made visible rather than carved away.
The declaration lives in CLIENT_SECTIONS in particles/config.py; tests keep
it, the sample's tags, and the modules that actually read config in agreement.
Which config file loads¶
Particles reads one config file, chosen in this order:
PARTICLES_CONFIG, if set: absolute authority. A path that does not exist resolves to no config file rather than falling through to the user file, and every command says so once on stderr. A quoted~is the usual cause: the shell does not expand it inside double quotes, so writePARTICLES_CONFIG="$HOME/...". A relative path is read against the working directory: theparticlescommand line reads it and warns once that it should be absolute, while the stdio MCP servers, the Claude Code hooks andparticles init claude-coderefuse one.- The user file,
~/.particles/config.yaml, if it exists. - Otherwise: compiled-in defaults plus env-var overrides.
Apart from a relative PARTICLES_CONFIG you set, no config file is read from
the working directory or its parents. A cloned
repository that ships a config.yaml therefore cannot configure Particles:
it cannot point the engine, model-provider or telemetry endpoints your
secrets are sent to at a host of its choosing, and it cannot turn on the MCP
write tools.
A Particles config.yaml that sits in the working directory, or in a parent
up to the repository root, is reported instead of read. Each command prints
one warning naming it and the two ways to use it: set
PARTICLES_CONFIG=<path>, or move it to ~/.particles/config.yaml. A
config.yaml that belongs to another tool (one that names no Particles
section) is not mentioned. cli.warn_unused_config: false turns the warning
off, and only a file Particles reads can set it.
If you kept a config.yaml at a project root, as earlier releases read it,
choose one of the two remedies. A config pinned with PARTICLES_CONFIG in your
shell profile applies to every command you run, in every directory, so keep
its paths absolute and pair an absolute storage.blob_dir with the store it
belongs to.
Keep the path settings inside the file absolute too: a relative path setting can
resolve against the directory a command runs in, and a relative
api.keys_file is refused. SECURITY.md lists the settings this
covers and the ones that resolve beside the config file instead.
particles config validate and particles hook doctor both print where the
config came from (PARTICLES_CONFIG, the user file, or none) and any nearby
file they ignored; when "which config am I loading?" matters, ask them rather
than guess.
The Claude Code hooks, the MCP server registration and the scheduled
consolidation job each carry their own absolute PARTICLES_CONFIG, which
particles init claude-code writes (see Claude Code integration),
so they never depend on the directory they start in. Each hook command and
the MCP server registration also pin PARTICLES_ENGINE_BASE_URL empty, which
overrides nothing, so the environment a session starts with cannot point them
at another engine; particles hook doctor warns about one with no pin or an
inherited one, and a re-run of particles init claude-code gives it the
empty pin. SECURITY.md states each pin and what it guards.
Precedence¶
Env-var overrides are registered in _ENV_OVERRIDES in
particles/config.py. The common ones:
| Env var | Config field | Purpose |
|---|---|---|
DATABASE_URL |
database_url |
SQLite path |
PARTICLES_BLOB_DIR |
blob_dir |
Where deposited blobs are stored |
PARTICLES_CONFIG |
none (bootstrap) | Path to the config file, ahead of ~/.particles/config.yaml |
TRUST_DIFFERENTIAL_THRESHOLD |
trust.differential_threshold |
When trust differences flag inconsistencies |
RECONCILIATION_STORE_MODE |
reconciliation.store_mode |
single (default) or multi, the consensus-store reconciliation regime |
For the full env-var list and field-by-field tuning options, see
config.yaml.sample.
Secrets¶
Secrets never live in config.yaml. Application code calls helpers
in particles/secrets.py:
| Secret | Env var | Used by |
|---|---|---|
| Anthropic API key | ANTHROPIC_API_KEY |
Extractor, semantic lint, wiki synthesis |
| Numista API key | NUMISTA_API_KEY (optional) |
Numista extractor |
| GitHub API key | GITHUB_API_KEY (optional) |
GitHub extractor (gist / repo / pages) |
| Engine key | PARTICLES_API_KEY (optional) |
particles engine serve: the operator's key. Unset, empty or dev-key, and with no per-client key minted, the engine serves reads only: every write route answers 503, from loopback too, and since 1.220.9 a report it serves records nothing in the store. Give other clients keys of their own with particles engine keys create; they live, as digests only, in api.keys_file |
| Engine token | PARTICLES_ENGINE_TOKEN (optional) |
The CLI, hooks and MCP server with engine.base_url set: the bearer they send, ideally a per-client key of their own |
The GitHub and Numista keys are spent only on a fetch whose target the
operator chose. A deposit made by an agent key (a harvester's included), a
link a deposited post names and the deposit follows, and the refresh of an
entry any of those made are all fetched without them: a GitHub URL is read anonymously, so a private
repository the operator's key can read stays out of reach, and a Numista coin
URL is refused with 403, because the Numista API has no anonymous mode.
Migrating to a secrets manager (1Password, AWS, sops, …) only
requires editing particles/secrets.py.
LLM provider selection¶
Every chat/completion call routes through a CompletionProvider port.
The llm section picks the (provider, model) pairing per
purpose: a default plus optional overrides for extraction,
semantic_lint, query_response, synthesis, benchmark,
benchmark_answer, abstraction, verification (the memory audit's
second reading of each contradiction the semantic_lint probe flags; routing
semantic_lint to a small model for cost leaves that reading on the
default), and subject_resolution (the judge that picks among an ambiguous
name's Wikidata candidates during extraction):
llm:
default:
provider: anthropic
model: claude-sonnet-5-5
# Route a single purpose to a different model, e.g. a cheaper model for
# high-volume extraction while synthesis stays on the default.
# extraction:
# model: claude-haiku-4-5
The compiled default is claude-sonnet-5-5 (since 1.189.0; it was
claude-sonnet-4-6 before). It applies to every purpose your configuration
does not set, on an install whose config.yaml has no llm.default block,
a zero-configuration install included. A config.yaml copied from the sample
writes llm.default out and keeps its model when the compiled default changes.
To stay on the previous model, set llm.default.model: claude-sonnet-4-6.
particles config validate prints the default in force, where it came from,
and each purpose routed elsewhere, and particles hook doctor names the model
the hooks extract with and whether a calibration applies to it.
provider is anthropic (the native adapter) or the name of any entry in
llm.providers (see the next section). max_tokens is not
set here; it is per-call and lives with each call site
(extraction.max_tokens, query.answer_max_tokens,
wiki.max_tokens).
Those per-call budgets are total output allowances on the wire, not
response-length caps: an extended-thinking model spends its thinking tokens
from the same number. A budget sized to the expected prose therefore returns a
reply with no text in it at all: extraction reports a truncated JSON array,
and query degrades to its deterministic belief listing with
answer_generation_error_cause: BUDGET. query retries that case once at
query.answer_retry_max_tokens before degrading; the others do not.
Named providers (any OpenAI-compatible endpoint)¶
Every non-Anthropic vendor, hosted (OpenAI, DeepSeek, Kimi, gateways) or
local (Ollama, llama.cpp's server, vLLM, LM Studio), speaks the OpenAI
chat/completions dialect, so all of them are named entries in
llm.providers: adding a vendor is a config block, never code.
The endpoint, resilience, and dialect policy are per-entry; only the
per-purpose model string lives in the purpose override. The local entry
(an Ollama endpoint) is compiled in, so provider: local works
with zero configuration.
llm:
default:
provider: anthropic
model: claude-sonnet-5-5
extraction: # send only extraction to a cheaper vendor
provider: openai
model: gpt-5.6-luna
providers:
openai:
base_url: https://api.openai.com/v1 # adapter appends /chat/completions
max_tokens_param: max_completion_tokens # reasoning models reject max_tokens
send_temperature: false # …and non-default temperatures
structured_output: strict # strict-dialect JSON schemas
local: # override the compiled-in Ollama entry if needed
base_url: http://localhost:11434/v1
timeout_seconds: 120
The API key is a secret named after the entry:
PARTICLES_LLM_API_KEY_<NAME> (PARTICLES_LLM_API_KEY_OPENAI, …), set in
the environment, never in config.yaml. The local entry also honours the
legacy PARTICLES_LOCAL_LLM_API_KEY. Endpoints that enforce no auth (bare
Ollama / llama.cpp) need no key and the adapter omits the Authorization
header.
A key is never sent over http:// to a host that is not loopback: the call is
refused before any request, naming the entry. Use https://, or reach the
endpoint through an SSH or Tailscale forward to http://127.0.0.1. For an
endpoint on a network you trust end to end, allow_plaintext_key: true on the
entry sends the key anyway, with a warning.
The two dialect knobs are declarative statements about a known endpoint,
not runtime negotiation: max_tokens_param picks which body member carries
the length cap, and send_temperature: false drops temperature from
requests entirely. A wrong knob fails loudly with the endpoint's own
HTTP 400. structured_output: strict transforms JSON schemas to the
OpenAI-strict dialect (every key required, optionality as union-with-null).
It is required for api.openai.com; leave the default auto for tolerant
endpoints like Ollama.
Deprecation: the pre-0227
llm.localblock is honoured asllm.providers.localwith a warning for one release cycle; move it underproviderswhen convenient.
Reasoning models need a bigger token budget¶
A reasoning model (claude-sonnet-5, DeepSeek-V4, Kimi K3, the GPT-5.6
family) spends its thinking tokens from the same completion budget as the
answer, so a prompt that fits comfortably in 8192 tokens on a
non-reasoning model can exhaust that budget before the answer is finished,
or before it starts. The answer grows with the source as well, at 2 to 3.5
tokens per source character, so a long Claude Code memory file needs more
than 16384 tokens of reply on its own. The default extraction.max_tokens is
32000 for these reasons, and a reply that still comes back empty, cut short,
or unparseable is retried once at extraction.retry_max_tokens (default
64000). The Anthropic adapter streams any call whose budget is above the
Anthropic SDK's non-streaming ceiling of about 21333 tokens, which is what
lets the budgets go that high. An OpenAI-compatible provider has no such
ceiling, but its vendor may cap output below these defaults and reject the
request, and a long reply still has to finish within the entry's
timeout_seconds. Lower extraction.max_tokens for such a provider. The endpoint returns HTTP 200 with finish_reason:
length and text that stops mid-token, which the extractor's JSON parser
then reports as Failed to parse extraction response: Unterminated string.
The adapter logs a WARNING naming the pairing and the budget whenever a
reply comes back truncated, so the two are not confused; a truncated reply
with no text at all fails with a budget-shaped error rather than a
generic empty-response one.
Give these models headroom (extraction.max_tokens: 16384 cleared the
parse failures in the 2026-08 trial with DeepSeek-V4 flash/pro and Kimi K3), and
consider raising the entry's timeout_seconds for large models, since a long
thinking pass takes wall-clock time the default 120 s may not cover:
llm:
providers:
fireworks:
base_url: https://api.fireworks.ai/inference/v1
timeout_seconds: 300 # reasoning passes are slow as well as long
extraction:
max_tokens: 16384 # thinking + answer share this budget; at or under the vendor's output cap
Confidence calibration is per (extractor, model) pairing:
each particles extractor calibrate run stores a record keyed by the
extraction model it ran under, and the pipeline applies the one matching the
configured model. A newly pointed model, including any
<provider>:<model>, is therefore uncalibrated until you benchmark it (queries fall
back to the EXTRACTOR_DIRECT disclosure meanwhile), but switching back
to a model you calibrated before restores its calibration with no re-fit.
A record also applies only under the extractor version it was fitted under:
an extractor upgrade leaves it stored but not applied until you
re-fit. List the stored pairings, and which of them apply, with particles
extractor calibrations <extractor-id>.
Pick provider names before you benchmark. The calibration key is
<name>:<model>(the operator-chosen entry name, not the vendor), so renaming a provider entry orphans every calibration record made under the old name. Treat a rename as a recalibration event.Deprecation:
extraction.modelandwiki.modelmoved into this section. The old keys are migrated automatically (tollm.default.modelandllm.synthesis.model) with a warning for one release cycle; move them tollmwhen convenient.Note the scope change:
llm.default.modelis the fallback for every purpose, including semantic lint and the benchmark judge, which were previously hard-wired toclaude-sonnet-4-6. That means a non-defaultextraction.model(nowllm.default.model) will also drive lint and benchmark. To keep those on a cheaper model, setllm.semantic_lint.model/llm.benchmark.modelexplicitly.
Common knobs¶
A few config fields you'll likely want to set early:
llm.default.model(and per-purposellm.<purpose>.model): the completion model each purpose uses. See LLM provider selection above.subjects.wikidata_candidate_selection: how an extracted name with several Wikidata candidates is linked. The default,llm_judge, sends an ambiguous name to thellm.subject_resolutionmodel once, with the claim and each candidate's description, and links the candidate it names or none of them; the answer is recorded and reused for the same name, claim and candidates. A name with one well-matched candidate, or none, never reaches the model. Measured on two gold sets it linked more names correctly and lost no correct link, at about US$0.20 per 100 names on prose about well-known entities (the measurement).top_hittakes Wikidata's first search result with no model call, which is also whatllm_judgefalls back to when no LLM is reachable.exporter_common.min_particle_confidence: the cross-exporter quality threshold. Particles below thiseffective_confidenceare dropped from every export. Per-run override and the per-exporter flag lists: User guide → exporting.wiki.min_particles: minimum particles per subject for the wiki exporter to render. Default 3. See User guide → exporting → wiki articles.query.top_k: top-k truncation for the semantic search. What it does to a result list: User guide → ranking.embeddings.progress_bars: whether the embedding stack prints its tqdm progress bars (Loading weights …on model load,Batches …on each encode) to stderr. Defaultfalse(they are noise for a CLI verb likequery); settrue(orPARTICLES_EMBEDDINGS_PROGRESS_BARS=1) to restore them.obsidian.default_output_path: soparticles export obsidianworks without an argument.inbox.file_path: the iCloud-synced file theparticles inboxcommands read URLs from (inbox.poll_interval_secondstunes theinbox watchcadence). Setup walkthrough: User Guide → Depositing from your phone.-
reconciliation.store_mode:single(default) for a solo store, ormultifor a multi-contributor / consensus store. Inmultimode a confirmed cross-source contradiction is surfaced as an INCONSISTENCY (both claims stay ACTIVE, ranked per-viewer at query time) rather than one claim auto-superseding the other on trust; a contributor's claim is never dropped by another contributor's trust. A source's newer claim still replaces its own older one inmulti, when the pair is attributed: the same recorded author or contributor set, or two captures by the owner's harvesters (claude-code-hook,audit), which count as the operator. -
extraction.append_only_delta: whether a snapshot of anAPPEND_ONLYsource (a session transcript, an append-only archive) is read as a delta, only the text it adds to the last snapshot the store extracted. Defaulttrue. Withfalse, every snapshot is read whole, and the earlier text is read again each time. Two knobs size the delta:extraction.append_context_chars(default 4000) is how much of the already-extracted text is shown before it, as context the model extracts nothing from, andextraction.append_chunk_chars(default 7500, minimum 1000) is the largest delta chunk sent in one call. When a new snapshot does not extend the previous one, the extraction reads it whole and says why in its quality notes.
With the delta on, a read of such a snapshot that fails partway keeps what
it already paid for. The chunks before the first failed call are
written, and so are later answered chunks the retry is certain to skip. The
snapshot stays pending, and its retry reads only the rest: from where the
kept chunks stop, or, for a snapshot read whole, the whole read again with
the written chunks skipped. While a whole read is held that way, the
entry's later snapshots wait for it, and particles extract and the
consolidation log name the wait. particles reindex <entry> releases it.
Changing append_chunk_chars, append_context_chars or
html_chunk_size while a snapshot is held partway makes its retry read
some kept chunks again, and the extraction log says so.
See Tuning for the trust / calibration / age-decay
knobs that drive effective_confidence.
Observer scope¶
Whether a Claude Code session is shown the whole store or its own project's view of it; see User Guide → Claude Code for what the view contains. Three switches, deliberately in three places:
claude_code.observer_scope(defaultprojectsince;storeis the whole store):projectreads the session-start digest, theMEMORY.mdregion and the freshness check through the session's project. It takes effect only on a store thatparticles memory rescopehas run on; until then the surfaces stay store-wide and say so, andparticles hook doctorreports "NOT in effect".particles mcp serve --project-observer cwd: binds one MCP server process to the project of its working directory, for reads and writes. On a rescoped store itslink_addrefuses aCO_EVIDENTIALlink between beliefs whose observer scopes differ, since the link would change both scopes; cross-scope links stay an operator act (particles links add,POST /linkswithout aproject_key, a curate merge). It also refuses to retract, supersede, tag, untag or link a belief that is not in view for its project. A launch flag, not config, becauseconfig.yamlis shared by every MCP client on the machine and a client started from your home directory should not be bound to it.particles init claude-codewrites it into the Claude Code registration only.observer_scope.harness_tags(default["claude-code"]): the corpus-entry tags that mark a harness deposit. A harvested source with no project key is unattributed: in view store-wide and for no project, never global. Add your adapter's tag here when you wire a second harness, or its keyless deposits will read as global.
Hygiene. particles memory rescope --dry-run is safe to run any time and
is the census: sources per project, sources left unattributed, and sources
whose only project no longer exists on this machine. It only ever adds tags.
Run it after deleting or moving a repository, and after importing a store from
another machine (project keys are local path names, and an import arrives with
none, so imported beliefs read as global).
What it costs. One batched join per scoped read. On a 28,000-belief store
the join took 0.2–0.4 s and the scoped digest rendered in about 1.9 s against
1.6 s store-wide, inside the 10 s claude_code.hook_deadline_seconds.
Agent-memory projection¶
The agent_memory.projection block governs the MEMORY.md projection for
the Claude Code integration; see User Guide → Claude
Code for the
walkthrough. The load-bearing knobs:
agent_memory.projection.enabled(defaulttrue): render + splice thememory-indexregion and run the session-start freshness check.falsefalls back to a plain digest push with no region writes.agent_memory.projection.fold_authored_lines(defaulttrue): move a memory-index pointer below the projected region into the append-only archive while the region shows a belief its file currently states, and bring it back once it does not. The file must be extracted first; other lines are never moved.falseturns both halves off.agent_memory.projection.never_fold_types(default[feedback, user]): memory types whose pointers never fold. A pointer whose topic file's frontmattermetadata.typeis listed stays inMEMORY.mdwhatever the region shows, and one already in the archive comes back. A file with no type follows the rule above;[]lets every typed pointer fold.agent_memory.projection.exclude_source_tags(default[rule-file]): source tags the region never selects from. A belief whose current sources all carry one of these tags is dropped before the region's cut; one that no source states any more is judged by the sources that ever stated it, and one with no source at all is kept. The default keeps the rule filesparticles rules synctracks out of the region. Unlike the other knobs in this block it is read at render time rather than baked intomemory.yaml, so changing it takes effect on the next render, and the next session start sees the region as stale until then. Aselect.allowpin in the manifest still wins.[]restores the unfiltered region.
Git-versioned projection history¶
Off by default. When enabled and the memory directory is inside a git repo, each render that changes files under it is committed with a structured message (run id + ranking-delta summary), giving you a diffable, rollback-able history of the view while the store stays the source of truth. Every git failure degrades silently (logged at debug, never raised): the commit is a bonus, the projection is the product.
agent_memory.projection.git.enabled(defaultfalse): master switch. Committing into your repo is opt-in; turning it on without the memory directory being a git repo is harmless (the step is simply inert).agent_memory.projection.git.sign(defaultfalse):falsepasses--no-gpg-signso an unattended session-end commit never blocks on a signing agent;truedrops the override and respects your owncommit.gpgsign. This SDK's own GPG requirement is never imposed on your memory repo, and a signing failure never fails the projection.agent_memory.projection.git.author_name/.author_email(defaultnull): passed per-commit via-c user.name/-c user.email(never written into your git config).nulluses your repo's own identity; when that is absent, the commit degrades silently.agent_memory.projection.git.max_delta_excerpts(default6): cap on the added/removed excerpt lines in the commit message. The count line always states the true totals, so a large delta is never silently truncated.
Only files under the memory directory are staged (never git add -A), and
the internal backup / snapshot / archive live outside it, so they never enter
your history.