Skip to main content
AllCodex services are configured using environment variables. Below is the complete reference matrix of available configuration variables.

AllCodex Core (Database)

Core configurations govern the database paths, ports, and default startup credentials.
VariableDefaultDescription
PORT8080The port the Express HTTP server binds to on the host.
TRILIUM_DATA_DIR/srv/allcodex/core-dataDirectory where SQLite files, backups, and configurations are stored.
ALLCODEX_PASSWORD(none)Startup password for the database. Required for zero-login auto-provisioning.
USER_UID999UID to run the server process as inside the container.
USER_GID988GID to run the server process as inside the container.

AllKnower (AI Brain)

AllKnower handles database models, connections to PostgreSQL/LanceDB, OpenRouter keys, and model selections.

System Settings

VariableDefaultDescription
PORT3001The port the Elysia server binds to.
DATABASE_URL(none)PostgreSQL connection URI for Prisma (accounts, history, and budgets).
LANCE_DB_PATH/srv/allcodex/knower-data/lancedbDirectory where LanceDB vector and FTS tables are persisted.
OPENROUTER_API_KEY(none)Your OpenRouter API Key.
OPENROUTER_BASE_URLhttps://openrouter.ai/api/v1Custom OpenRouter API base endpoint.
PORTAL_INTERNAL_SECRET(none)A secure, random token shared with the Portal to verify auto-provisioning.
BETTER_AUTH_SECRET(none)Secret used by better-auth to sign cookies and tokens. Must be 16\ge 16 characters in production.
BETTER_AUTH_URLhttp://localhost:3001The canonical URL of the AllKnower auth server.
INTEGRATION_CREDENTIALS_KEY(none)Critical in production. A 32-byte key (represented as a 64-character hex string) used to encrypt database credentials at rest.

Web Push & Email Notifications

VariableDefaultDescription
VAPID_PUBLIC_KEY(none)VAPID public key for Web Push notifications.
VAPID_PRIVATE_KEY(none)VAPID private key for Web Push notifications.
VAPID_SUBJECTmailto:admin@example.comNotification sender contact email address.
RESEND_API_KEY(none)Resend email delivery API key.
RESEND_FROM_EMAILnoreply@allcodex.localThe email address from which budget alerts are sent.

Model Customizations

You can override the models used by the AI engine for specific tasks. For each task, you can configure a primary model plus up to three fallback models.
TaskVariableDefault Model
Brain DumpBRAIN_DUMP_MODELdeepseek/deepseek-v4-pro
Consistency CheckerCONSISTENCY_MODELdeepseek/deepseek-v4-pro
Relationship SuggesterSUGGEST_MODELgoogle/gemini-3.1-flash-lite
Gap DetectorGAP_DETECT_MODELdeepseek/deepseek-v4-pro
AutocompleteAUTOCOMPLETE_MODELopenai/gpt-5-nano
EmbeddingsEMBEDDING_CLOUDqwen/qwen3-embedding-8b
RerankRERANK_MODELcohere/rerank-4-pro
  • Fallback Syntax: Append _FALLBACK_1, _FALLBACK_2, or _FALLBACK_3 to any model key (e.g. BRAIN_DUMP_MODEL_FALLBACK_1=google/gemini-2.5-pro).
  • Auto Route: Set USE_OPENROUTER_AUTO=true to let OpenRouter automatically select the best model for all tasks.

AllCodex Portal (Frontend)

Portal variables configure connections to the backends and shared secret handshakes.
VariableDefaultDescription
PORT3000Port the Next.js production server runs on.
ALLCODEX_URLhttp://localhost:8080The private network URL of the running AllCodex Core container.
ALLKNOWER_URLhttp://localhost:3001The private network URL of the running AllKnower container.
PORTAL_INTERNAL_SECRET(none)Critical. Must match PORTAL_INTERNAL_SECRET in AllKnower to authorize session cookies.
NEXT_PUBLIC_PORTAL_URLhttp://localhost:3000The public URL of the portal, used to generate player-facing share links.
LORE_ROOT_NOTE_ID(none)System fallback default root lore note ID.
ALLCODEX_ETAPI_TOKEN(none)System fallback token for Core database connections.
ALLKNOWER_BEARER_TOKEN(none)System fallback token for AllKnower communication.
VAPID_PUBLIC_KEY(none)Public key for push notification client subscriptions.