Configuration
Status: Ready
Truth label: Current
Audience: Fleet operator
Reader outcome: Set every environment variable and worker flag with its default, its reader, and the reason it exists.
Last verified: 2026-09-13
AGENTASIAN reads configuration from environment variables and a repository-root
.env file. Start from:
cp .env.example .env
Do not commit .env, provider keys, API tokens, worker credentials, or raw
trace artifacts.
Ownership and precedence
Different processes read different settings:
| Owner | Main variables |
|---|---|
| Launchers | AA_BIND_HOST |
| Brain | Unprefixed chat, embedding, memory, and voice variables |
| Forge Central | SE_MANAGER_* variables |
| Worker | FORGE_*, BRAIN_API_URL, AA_API_TOKEN, and engine-specific variables |
| Cortex | Page hostname plus a bearer token stored in browser local storage |
Command-line worker flags override their matching environment variables.
Exported shell values win over .env.
Minimal local configuration
LLM_PROVIDER=ollama
LLM_MODEL=llama3.1:8b
OLLAMA_BASE_URL=http://localhost:11434
EMBEDDING_PROVIDER=ollama
EMBEDDING_MODEL=nomic-embed-text
DATA_DIR=~/.agent_asian
SE_MANAGER_DATA_DIR=~/.agent_asian
AA_BIND_HOST=127.0.0.1
AA_API_TOKEN=
AA_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
FORGE_WORKER_ENGINE=claude-code
FORGE_WORKER_PERMISSION=write
FORGE_WORKER_MAX_PERMISSION=write
Brain chat and provider settings
| Variable | Default | Meaning |
|---|---|---|
LLM_PROVIDER | ollama | ollama, openai, anthropic, or google |
LLM_MODEL | llama3.1:8b | Default chat model |
OLLAMA_BASE_URL | http://localhost:11434 | Ollama service |
OLLAMA_NUM_CTX | 32768 | Ollama context window |
OPENAI_API_KEY | empty | OpenAI chat and optional embeddings |
OPENAI_BASE_URL | empty | Optional OpenAI-compatible base URL used by legacy worker paths and key distribution |
ANTHROPIC_API_KEY | empty | Anthropic chat |
GOOGLE_API_KEY | empty | Google chat |
GROQ_API_KEY | empty | Legacy worker key-distribution value; not a current Brain chat provider |
TOGETHER_API_KEY | empty | Legacy worker key-distribution value; not a current Brain chat provider |
Cloud keys are not needed for claude-code, codex, or antigravity
task execution. Those CLIs use their own logins.
Generation defaults
Unset controls delegate to the provider or adapter:
| Variable | Default | Meaning |
|---|---|---|
TEMPERATURE | unset | Sampling temperature |
TOP_P | unset | Nucleus sampling. Do not combine with temperature |
FREQUENCY_PENALTY | unset | Provider-supported repetition penalty |
GENERATION_SEED | unset | Provider-supported deterministic seed |
STOP_SEQUENCES | empty | JSON list of stop strings |
REASONING_EFFORT | unset | Reasoning depth where the model exposes it |
Provider capability validation happens before the request is sent, and it is
model-aware: the current Claude models reject temperature and top-p outright,
and accepted reasoning-effort levels differ per model (OpenAI none-xhigh,
Anthropic low-max, Gemini minimal-high, Ollama none). Where the
installed LangChain profile data knows the model, its list wins; a model newer
than that data falls back to this repo's own table in brain/llm/model_profiles.py,
and then to the provider-level list.
Reasoning effort is offered only where the installed provider package can carry
it: langchain-anthropic below 1.6 has no reasoning_effort field, and
langchain-google-genai 4.2.x calls it thinking_level. Brain asks the
installed class and reports the control unsupported rather than sending a kwarg
the adapter would mishandle, so an older environment loses the control but never
breaks. The pyproject.toml floors name the versions that carry the full
feature.
Embeddings and memory
| Variable | Default | Meaning |
|---|---|---|
EMBEDDING_PROVIDER | ollama | ollama or openai |
EMBEDDING_MODEL | nomic-embed-text | Persisted collection embedding identity |
KNOWLEDGE_DIR | ~/Documents/brain | Source documents for ingestion |
DATA_DIR | ~/.agent_asian | Brain, Chroma, CPMI, conversations, and trace data |
Keep the embedding provider and model stable after indexing. To change them, use a new data root or rebuild the affected collections.
Content directories
These four name the content Brain runs on. Nothing is discovered by scanning, so a directory does nothing until one of these settings names it.
| Variable | Default | Meaning |
|---|---|---|
INFLUENCE_LIBRARY_DIR | none, required | Your books, notes, and rule documents. Brain refuses to start without it, rather than degrading to zero retrieval results. |
VOICE_PACK_DIR | none, required | Your voice pack: the lenses, registers, and exemplars that shadow the built-in ones. agent voice-pack init scaffolds a valid minimal pack. |
INFLUENCE_PACK | <INFLUENCE_LIBRARY_DIR>/influence_pack.toml | The manifest declaring how library files are tagged. A tag is what lets a lens retrieve from a source. |
VOICE_PACKS | empty | Extra packs loaded after VOICE_PACK_DIR, in order. A later pack shadows an earlier one by id. |
"Required" means required by the preflight, which run-all.bat and
run-all.sh run before starting Brain, Central, and Cortex. Set both before
pulling on a machine that runs those services, or the stack stops at startup
with a named configuration error.
A Forge worker is different and the distinction matters for rollout. A worker
never runs the preflight; it reaches brain.config transitively through
brain.memory.cpmi, which binds packs with load_registry_safe
(brain/voice_pack.py:634) rather than load_packs_or_die. So a worker with
neither setting starts normally and silently uses the built-in lens and
register definitions, with the reason recorded only on registry.load_errors.
That is deliberate, because a fatal import here would stop every worker over a
voice-pack problem, but it means a worker will not tell you the settings are
missing. If a worker should reason from your library, set both on the worker
too and confirm through GET /chat/influences that your ids are present.
See Voice Pipeline sections 11 and 12 for the file formats.
Agent and voice settings
| Variable | Default | Meaning |
|---|---|---|
USER_NAME | User | User name supplied to Brain |
USER_PROFILE | empty | Optional private system-prompt context |
AGENT_NAME | Asian | Assistant name |
REASONING_LENS | empty | Independent default lens |
VOICE_REGISTER | empty | Independent default delivery register |
INFLUENCE_PROFILE | none | Legacy paired default |
VOICE_LINT_ENABLED | true | Conservative protected-span normalization |
VOICE_EXAMPLE_RETRIEVAL_ENABLED | true | Retrieve approved style examples |
VOICE_EXAMPLE_LIMIT | 3 | Retrieval cap, validated from 0 to 3 |
VOICE_REVISION_MODE | off | off, auto, or always |
VOICE_REVISION_MODEL | qwen3-coder | Local Ollama revision model |
VOICE_REVISION_MIN_SCORE | 85 | Deterministic auto-mode threshold |
VOICE_REVISION_TEMPERATURE | 0.2 | Revision-only temperature |
DEBUG | false | Brain debug logging |
Leave REASONING_LENS and VOICE_REGISTER blank to preserve the legacy
INFLUENCE_PROFILE migration behavior.
The four VOICE_REVISION_* settings were renamed once, and the old spellings
are no longer read. extra="ignore" accepts a stale key and the field keeps its
default, so a surviving old name would silently stop applying; the preflight
warns on stderr and names it. That warning is the whole safety net.
API access
| Variable | Default | Meaning |
|---|---|---|
AA_BIND_HOST | 127.0.0.1 | Bind address used by standard launchers |
AA_API_TOKEN | empty | Shared bearer token for non-loopback access |
AA_OPERATOR_TOKEN | empty | Additional token required only for HTTP retrieval with scope=all |
AA_ALLOWED_ORIGINS | local Cortex origins | Comma-separated browser origins |
AA_ALLOW_KEY_DISTRIBUTION | false | Allow Brain to return provider keys to legacy workers |
With no bearer token, Brain and Forge reject non-loopback clients even if they are accidentally bound to a LAN address.
For LAN use:
AA_BIND_HOST=0.0.0.0
AA_API_TOKEN=<long-random-token>
AA_OPERATOR_TOKEN=<different-long-random-token>
AA_ALLOWED_ORIGINS=http://192.168.1.10:3000
SE_MANAGER_ALLOWED_PROJECT_ROOTS=%USERPROFILE%\Documents\github,/srv/projects
Paste the same bearer token into Cortex and configure it on each worker. Restrict ports 3000, 8080, and 8081 to the trusted LAN. Do not expose them to the public internet.
AA_OPERATOR_TOKEN currently protects only explicit scope=all
retrieval. It does not authorize other operator routes separately. The worker
loads the repository .env, and _dispatch_env copies that full environment
into CLI and verification children. A shared .env therefore puts the
operator token on the worker. Until process-specific secrets and child
environment filtering exist, provide this token only to the Brain process or
leave all-scope search disabled. Do not run untrusted repositories with
unrelated provider or control-plane keys in the worker environment.
Forge Central settings
shared.config.SEManagerConfig uses the SE_MANAGER_ prefix.
DATA_DIR does not configure Forge.
| Variable | Default | Meaning |
|---|---|---|
SE_MANAGER_DATA_DIR | ~/.agent_asian | Forge database and operational files |
SE_MANAGER_PROJECTS_DIR | ~/projects | Default project root and authenticated fallback allowlist |
SE_MANAGER_ALLOWED_PROJECT_ROOTS | empty | Comma-separated roots remote clients may register |
SE_MANAGER_WORKER_TIMEOUT | 120 | Seconds without heartbeat before offline |
SE_MANAGER_LEASE_TTL_SECONDS | 60 | Server-owned task lease TTL |
SE_MANAGER_RUN_MAX_WALLCLOCK_SECONDS | 7200 | Absolute run lease cap |
SE_MANAGER_CLI_RUN_TIMEOUT_SECONDS | 1800 | Per-run CLI agent timeout, read by the worker |
How long a run may take
Three ceilings bound a single run and the smallest one ends it.
- The CLI timeout.
agywaits--print-timeoutand defaults to five minutes. The antigravity adapter sets that flag from the worker ceiling below, so it is not a separate number to configure. SE_MANAGER_CLI_RUN_TIMEOUT_SECONDS, enforced by the worker running the CLI. Set it on the worker, not on Central.SE_MANAGER_RUN_MAX_WALLCLOCK_SECONDS, enforced by Central, which expires the lease past the cap. The worker treats lease loss as a cancel and stops the run.
For runs measured in hours, raise 2 on every worker and 3 on Central, then restart both. Raising one alone has no effect past the other. Antigravity streams agent and tool progress. Its final result still determines CLI success.
When a bearer token is set and SE_MANAGER_ALLOWED_PROJECT_ROOTS is blank,
Forge permits only SE_MANAGER_PROJECTS_DIR.
SE_MANAGER_HOST and SE_MANAGER_PORT exist on the settings object, but
the standard launchers pass host and ports directly to Uvicorn. Use
AA_BIND_HOST with the provided launchers.
Worker settings
| CLI flag | Environment variable | Default | Meaning |
|---|---|---|---|
--central-url | FORGE_CENTRAL_URL | http://localhost:8080 | Forge API |
--brain-url | BRAIN_API_URL | http://localhost:8081 | Brain rules and learnings API |
--api-token | AA_API_TOKEN | empty | Shared API bearer token |
--name | FORGE_WORKER_NAME | engine name | Stable instance identity |
--capabilities | FORGE_WORKER_CAPABILITIES | python,javascript | Comma-separated routing tags |
--poll-interval | FORGE_WORKER_POLL_INTERVAL | 10 | Seconds between empty polls |
--engine | FORGE_WORKER_ENGINE | claude-code | Default execution backend |
--permission | FORGE_WORKER_PERMISSION | write | Default task authority |
--max-permission | FORGE_WORKER_MAX_PERMISSION | write | Machine authority ceiling |
--shared-path | FORGE_SHARED_PATH | empty | Legacy-engine shared root |
Usage collection runs on updated workers every 300 seconds. Set
SE_MANAGER_USAGE_CAPTURE_INTERVAL_SECONDS=0 to disable it, or configure
SE_MANAGER_USAGE_TRANSCRIPT_ROOTS as a JSON list of native Claude transcript
roots on that host. Workers default to ~/.claude/projects. Cortex Analytics
manages Central's host-specific roots, interval and operator price table with
revision history. See usage metrics.
Legacy worker switches:
| Variable | Default | Meaning |
|---|---|---|
FORGE_WORKER_AGENTIC | false | Select the legacy agentic engine when true |
FORGE_WORKER_DANGEROUS | false | Deprecated alias that sets default and maximum permission to yolo |
FORGE_LEGACY_ALLOW_SHELL | false | Enable the legacy ReAct shell tool on a trusted worker |
The legacy in-process knowledge tools also read BRAIN_URL. Prefer
BRAIN_API_URL for the current worker and set both only when a legacy engine
must target a non-default Brain host.
Registered backend names are claude-code, codex, codex-oss, and
antigravity. Legacy values agentic and legacy also remain.
FORGE_WORKER_DANGEROUS=true is deprecated. It is equivalent to setting both
permission values to yolo.
FORGE_WORKER_AGENTIC=true is a legacy alias for selecting agentic.
FORGE_LEGACY_ALLOW_SHELL=false keeps the legacy ReAct shell tool disabled.
WSL_DISTRO_NAME is supplied by WSL, not by the operator. AGENTASIAN reads it
to translate Windows-style paths and choose a compatible SQLite journal mode.
Worker credentials
Per-worker and per-run credentials are automatic. Do not add them to .env.
The first registration saves a token under:
<SE_MANAGER_DATA_DIR>/worker-credentials/<hostname>-<instance>.token
If the file is lost, remove the idle worker registration from Cortex or with
DELETE /workers/{id}, then restart the worker.
Engine-specific settings
Claude Code
Install and log in to the claude CLI on the worker. No provider key is
required in .env.
Codex
Install and log in to the codex CLI on the worker. No OPENAI_API_KEY is
required for CLI execution.
Codex OSS
CODEX_OSS_BASE_URL=http://localhost:11434/v1
The /v1 suffix is required. The adapter forwards only gpt-oss model
names and otherwise lets Codex use its own OSS default.
Antigravity
Install agy, log in once interactively, and ensure its credential store is
available to the worker process. No GOOGLE_API_KEY is required for task
execution.
Use AGY parity to compare host rules, skills, selected settings and model catalogues. Explicit AGY model IDs reach the CLI unchanged, including its Claude and GPT-OSS choices. Invalid IDs fail through native validation. An omitted model uses AGY's default when intake or retained task provenance identifies an unedited system default. Explicit and configured selections survive. New runs stream progress and retain reported configuration and resume identity.
Portable paths and WSL
Windows absolute paths in .env are translated to /mnt/<drive>/... when
the process runs in WSL. Foreign worker paths are validated as pure paths and
stored verbatim.
Do not run Central's live forge.sqlite3 through a WSL drvfs or 9P mount.
Run Central on the filesystem's native side. Workers may run on another OS and
connect over HTTP.
Scratch instances
Use SE_MANAGER_DATA_DIR, not DATA_DIR, for a scratch Forge Central:
SE_MANAGER_DATA_DIR=/tmp/agentasian-forge-test \
python -m uvicorn forge.central.api:app --host 127.0.0.1 --port 18080
A fresh Forge root can copy legacy files from ~/.se_manager before the
JSON-to-SQLite import. Inspect scratch state before treating it as empty.
See .env.example for a copyable file and Runbook for operational commands.