Skip to content

Configuration ​

Cortex is configured in four places: the server's infra/.env, the hub's settings in the dashboard, each project's .cortex/ folder, and environment variables on the machines that run agents and workers.

Server: infra/.env ​

Copy infra/.env.example to infra/.env and fill it in. docker compose reads it. See Self-host for the whole setup.

Required ​

VariableMeaning
MANAGEMENT_PASSWORDThe key for the LLM proxy's management API. No default

Optional ​

VariableDefaultMeaning
GITNEXUS_AUTH_TOKENgeneratedBearer token for the code-graph service. Left empty, it is generated once and shared with the API through a volume
DEFAULT_REPOnoneA repo to index on first start
GEMINI_API_KEYnoneFor Gemini embeddings or chat models
PORT4000Port of cortex-api
DATABASE_PATH/app/data/cortex.dbSQLite file inside the container
EXTERNAL_MCP_URLnoneThe public address agents connect to (/mcp is appended). Empty: the dashboard shows the address the first agent came through, else the local one
EXTERNAL_API_URL, EXTERNAL_LLM_PROXY_URLnoneThe same, for the links on Settings
BRANCH_RETENTION_DAYS14Drop a branch's vectors after this many days without an index, or once it is merged or deleted. Never the default branch. 0 keeps all
SESSION_IDLE_HOURS72Mark an active session expired after this many hours without a tool call. 0 = never
CORTEX_LLMfollow Settingsoff: never call a chat model. on: ignore the Settings switch
MEMORY_LLMfollow Settingsoff: store memories as written, without fact extraction
RECIPE_CAPTUREfollow Settingsoff: no recipes from finished tasks and sessions
OLLAMA_MEMORY_LIMIT, OLLAMA_CPUS, OLLAMA_THREADS, QDRANT_MEMORY_LIMIT4G, 4, OLLAMA_CPUS, 2GResource limits
CORTEX_IMAGE_NAMESPACEghcr.io/lktiepWhere the Cortex images are pulled from

Embeddings never need a chat model. Three features do: memory fact extraction, recipe capture and knowledge self-repair. Without a routed chat model they are off.

Access to the API ​

VariableMeaning
API_AUTHrequired: /api answers only loopback, the MCP gateway, API keys and, with both CF_ACCESS_* set, browsers that passed Cloudflare Access. Unset or off: it answers anyone
INTERNAL_API_SECRETShared by cortex-api and cortex-mcp. Generate one with openssl rand -hex 32
CF_ACCESS_TEAM_DOMAIN, CF_ACCESS_AUDYour Cloudflare Access team domain and the application's audience tag
API_BINDAddress the API ports are published on. 127.0.0.1 keeps them on the host

WARNING

The dashboard has no login of its own. Set API_AUTH=required and put the dashboard behind an access proxy before it is reachable from outside. See Self-host.

Hub settings ​

Settings on the dashboard holds the hub's own configuration: endpoints, LLM routing, the MCP config to copy, notification preferences and how to run a worker. LLM providers and the models used for chat and embeddings are set under LLM Providers.

Conductor reads these keys from the hub's hub_config table:

KeyDefaultMeaning
conductor.defaultFallback[{executor: "claude", model: "opus"}]Routes tried after a task's own
conductor.branchTemplatecx/{key}-{slug}Branch name for a task without branch
conductor.offlineReclaimMinutes30Minutes a worker may be offline before its task is taken back
conductor.leaseHours24Hours a task may run before it is taken back
conductor.baseBranchthe project's default branch, else mainWhere task branches start

Only conductor.defaultFallback is created when the hub first starts. The Settings route updates keys that already exist, so the others keep their defaults unless a row is added to the table.

Project: .cortex/ ​

FileWritten byMeaning
project-profile.jsoninstaller, onceDetected stacks and package manager (fingerprint), the checks to run (verify), and an optional worker section
agent-identity.jsoninstallerThe agent's role and capabilities
.hooks-versioninstallerThe version of the hooks; a newer installer regenerates them
.session-state/hooksThe markers the gates read. Ignored by git

project-profile.json has schema_version 2.0. Its verify section has pre_commit, full, auto_fix and max_retries. The installer leaves an existing profile alone; edit it by hand.

Agent machines ​

VariableUsed byMeaning
HUB_MCP_URL, HUB_API_KEYinstaller, hooksThe hub's MCP endpoint and the key. See Installer
CORTEX_MCP_URLhooksTakes precedence over HUB_MCP_URL
CORTEX_NUDGE=off, CORTEX_NOTES=offhooksTurn off the lookup nudge or file notes. See Hooks

Worker machines ​

See the full list under cw environment variables. The ones most often set:

VariableMeaning
CORTEX_HUB_URL, CORTEX_API_KEY, CORTEX_AGENT_IDHub, key and identity of the worker
CORTEX_SETUP_CMD, CORTEX_TEST_CMDOverride the project's setup and test commands on this machine
CORTEX_WORKER_HOMEReplaces ~/.cortex/worker

MIT License