Skip to main content

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:

OwnerMain variables
LaunchersAA_BIND_HOST
BrainUnprefixed chat, embedding, memory, and voice variables
Forge CentralSE_MANAGER_* variables
WorkerFORGE_*, BRAIN_API_URL, AA_API_TOKEN, and engine-specific variables
CortexPage 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​

VariableDefaultMeaning
LLM_PROVIDERollamaollama, openai, anthropic, or google
LLM_MODELllama3.1:8bDefault chat model
OLLAMA_BASE_URLhttp://localhost:11434Ollama service
OLLAMA_NUM_CTX32768Ollama context window
OPENAI_API_KEYemptyOpenAI chat and optional embeddings
OPENAI_BASE_URLemptyOptional OpenAI-compatible base URL used by legacy worker paths and key distribution
ANTHROPIC_API_KEYemptyAnthropic chat
GOOGLE_API_KEYemptyGoogle chat
GROQ_API_KEYemptyLegacy worker key-distribution value; not a current Brain chat provider
TOGETHER_API_KEYemptyLegacy 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:

VariableDefaultMeaning
TEMPERATUREunsetSampling temperature
TOP_PunsetNucleus sampling. Do not combine with temperature
FREQUENCY_PENALTYunsetProvider-supported repetition penalty
GENERATION_SEEDunsetProvider-supported deterministic seed
STOP_SEQUENCESemptyJSON list of stop strings
REASONING_EFFORTunsetReasoning 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​

VariableDefaultMeaning
EMBEDDING_PROVIDERollamaollama or openai
EMBEDDING_MODELnomic-embed-textPersisted collection embedding identity
KNOWLEDGE_DIR~/Documents/brainSource documents for ingestion
DATA_DIR~/.agent_asianBrain, 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.

VariableDefaultMeaning
INFLUENCE_LIBRARY_DIRnone, requiredYour books, notes, and rule documents. Brain refuses to start without it, rather than degrading to zero retrieval results.
VOICE_PACK_DIRnone, requiredYour 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.tomlThe manifest declaring how library files are tagged. A tag is what lets a lens retrieve from a source.
VOICE_PACKSemptyExtra 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​

VariableDefaultMeaning
USER_NAMEUserUser name supplied to Brain
USER_PROFILEemptyOptional private system-prompt context
AGENT_NAMEAsianAssistant name
REASONING_LENSemptyIndependent default lens
VOICE_REGISTERemptyIndependent default delivery register
INFLUENCE_PROFILEnoneLegacy paired default
VOICE_LINT_ENABLEDtrueConservative protected-span normalization
VOICE_EXAMPLE_RETRIEVAL_ENABLEDtrueRetrieve approved style examples
VOICE_EXAMPLE_LIMIT3Retrieval cap, validated from 0 to 3
VOICE_REVISION_MODEoffoff, auto, or always
VOICE_REVISION_MODELqwen3-coderLocal Ollama revision model
VOICE_REVISION_MIN_SCORE85Deterministic auto-mode threshold
VOICE_REVISION_TEMPERATURE0.2Revision-only temperature
DEBUGfalseBrain 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​

VariableDefaultMeaning
AA_BIND_HOST127.0.0.1Bind address used by standard launchers
AA_API_TOKENemptyShared bearer token for non-loopback access
AA_OPERATOR_TOKENemptyAdditional token required only for HTTP retrieval with scope=all
AA_ALLOWED_ORIGINSlocal Cortex originsComma-separated browser origins
AA_ALLOW_KEY_DISTRIBUTIONfalseAllow 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.

VariableDefaultMeaning
SE_MANAGER_DATA_DIR~/.agent_asianForge database and operational files
SE_MANAGER_PROJECTS_DIR~/projectsDefault project root and authenticated fallback allowlist
SE_MANAGER_ALLOWED_PROJECT_ROOTSemptyComma-separated roots remote clients may register
SE_MANAGER_WORKER_TIMEOUT120Seconds without heartbeat before offline
SE_MANAGER_LEASE_TTL_SECONDS60Server-owned task lease TTL
SE_MANAGER_RUN_MAX_WALLCLOCK_SECONDS7200Absolute run lease cap
SE_MANAGER_CLI_RUN_TIMEOUT_SECONDS1800Per-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.

  1. The CLI timeout. agy waits --print-timeout and defaults to five minutes. The antigravity adapter sets that flag from the worker ceiling below, so it is not a separate number to configure.
  2. SE_MANAGER_CLI_RUN_TIMEOUT_SECONDS, enforced by the worker running the CLI. Set it on the worker, not on Central.
  3. 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 flagEnvironment variableDefaultMeaning
--central-urlFORGE_CENTRAL_URLhttp://localhost:8080Forge API
--brain-urlBRAIN_API_URLhttp://localhost:8081Brain rules and learnings API
--api-tokenAA_API_TOKENemptyShared API bearer token
--nameFORGE_WORKER_NAMEengine nameStable instance identity
--capabilitiesFORGE_WORKER_CAPABILITIESpython,javascriptComma-separated routing tags
--poll-intervalFORGE_WORKER_POLL_INTERVAL10Seconds between empty polls
--engineFORGE_WORKER_ENGINEclaude-codeDefault execution backend
--permissionFORGE_WORKER_PERMISSIONwriteDefault task authority
--max-permissionFORGE_WORKER_MAX_PERMISSIONwriteMachine authority ceiling
--shared-pathFORGE_SHARED_PATHemptyLegacy-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:

VariableDefaultMeaning
FORGE_WORKER_AGENTICfalseSelect the legacy agentic engine when true
FORGE_WORKER_DANGEROUSfalseDeprecated alias that sets default and maximum permission to yolo
FORGE_LEGACY_ALLOW_SHELLfalseEnable 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.