# Configuration

Every environment variable AgenticMind reads, grouped by feature, with defaults.

Source: https://glamorous-boar.cloudvent.net/configuration/

---

The API loads a `.env` file from the directory it starts in (the repository root for `npm run dev`), or from `AGENTICMIND_ENV_FILE`. Real environment variables take precedence. **Restart the API after editing.** Copy `.env.example` to start; `.env` is git-ignored.

## Core

| Variable | Default | Purpose |
|---|---|---|
| `AGENTICMIND_DATABASE_URL` | `sqlite:///./.agenticmind/agenticmind.db` | Database. PostgreSQL: `postgresql+psycopg://user:pass@host:5432/db`. |
| `AGENTICMIND_DATA_DIR` | `.agenticmind` | Files, embedded vector stores, keyword indexes, model caches, plugins, secrets key. |
| `AGENTICMIND_ENV_FILE` | `.env` | Which env file to load. |
| `AGENTICMIND_MAX_CONCURRENCY` | `8` | Nodes run in parallel per run, and runs per worker. |
| `AGENTICMIND_MAX_UPLOAD_MB` | `50` | Upload size limit. |
| `AGENTICMIND_CORS_ORIGINS` | `http://localhost:5173,http://127.0.0.1:5173` | Origins allowed to call the API directly and pass the cross-site write guard. |
| `AGENTICMIND_WEB_DIST` | unset | Serve a built IDE from this folder (set in the Docker image). |
| `AGENTICMIND_BIND` | `127.0.0.1` | (compose) Interface the container port is published on. |
| `AGENTICMIND_API_PORT`, `AGENTICMIND_WEB_PORT` | `8000`, `5173` | (`npm run dev`) Ports; also `--api-port` / `--web-port`. |

## Secrets and model keys

| Variable | Purpose |
|---|---|
| `AGENTICMIND_SECRET_PREFIX` | Secrets `{"$secret": "NAME"}` resolve from env var `<prefix>NAME` (default: no prefix). |
| `AGENTICMIND_SECRET_KEY` | Key encrypting Settings → Secrets (32 bytes, URL-safe base64). If unset, generated into `<data>/secret.key`. **Back it up with the database.** |
| `OPENROUTER_API_KEY` | OpenRouter (default provider for templates and Wingman). |
| `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `AZURE_OPENAI_API_KEY`, `AWS_BEARER_TOKEN_BEDROCK`, `MISTRAL_API_KEY`, `GROQ_API_KEY`, `DEEPSEEK_API_KEY`, `TOGETHER_API_KEY`, `XAI_API_KEY`, `HF_TOKEN` | Native providers (only the ones you use). |
| `AGENTICMIND_ANTHROPIC_FALLBACKS` | `1` (default) sends Anthropic's server-side fallbacks beta on supporting models; `0` turns it off. |
| `PINECONE_API_KEY`, `PGVECTOR_DSN` | Examples of vector store secrets referenced from Vector Store nodes. |
| `GITHUB_TOKEN` | GitHub sync (fine-grained, Contents: read and write). |
| `AUTO_ONTOLOGY_API_KEY` | NVIDIA Auto Ontology API token. |
| `AGENTICMIND_HTTP_USER_AGENT` | User-Agent of the Web Fetch tool. Include contact details for sites like Wikipedia, e.g. `MyAgents/1.0 (https://example.org; you@example.org)`. |

Any other secret your nodes reference (`TELEGRAM_BOT_TOKEN`, `ANALYTICS_DB_DSN`, …) can live in `.env` or Settings → Secrets.

## Wingman

| Variable | Default |
|---|---|
| `AGENTICMIND_ASSISTANT_PROVIDER` | `openrouter` |
| `AGENTICMIND_ASSISTANT_MODEL` | `google/gemini-3.8-flash` |
| `AGENTICMIND_ASSISTANT_API_KEY_SECRET` | `OPENROUTER_API_KEY` |
| `AGENTICMIND_ASSISTANT_BASE_URL` | provider default |

Settings → Wingman overrides these.

## Sign-in

| Variable | Default | Purpose |
|---|---|---|
| `AGENTICMIND_AUTH` | `off` | `off` (single local user) or `required` (accounts). |
| `AGENTICMIND_COOKIE_SECURE` | `0` | `1` behind HTTPS. |
| `AGENTICMIND_SESSION_DAYS` | `14` | Sliding session lifetime. |

## Execution

| Variable | Default | Purpose |
|---|---|---|
| `AGENTICMIND_EMBEDDED_WORKER` | `1` | Run a worker inside the API. `0` when separate `agenticmind-worker` processes execute runs. |
| `AGENTICMIND_WORKER_ID` | host-pid | Worker identity in leases. |
| `AGENTICMIND_LEASE_SECONDS` | `30` | Job lease; renewed every third. |
| `AGENTICMIND_MAX_RUN_ATTEMPTS` | `3` | Recoveries per run before `RUN_RECOVERY_LIMIT`. |
| `AGENTICMIND_IN_PROCESS_TRUST` | `core` | Trust levels allowed to execute in-process. Adding `community` imports non-core packages from the Python environment (at your own risk). |

## Code sandbox

| Variable | Default | Purpose |
|---|---|---|
| `AGENTICMIND_SANDBOX` | `docker` | `docker`, `process` (trusted code only; not isolation) or `off`. |
| `AGENTICMIND_SANDBOX_ALLOW_NETWORK` | `0` | Allow network for nodes that ask for it. |
| `AGENTICMIND_SANDBOX_MAX_TIMEOUT` | `300` | Cap on node timeouts (seconds). |
| `AGENTICMIND_SANDBOX_MAX_MEMORY_MB` | `2048` | Cap on node memory. |
| `AGENTICMIND_SANDBOX_PYTHON_IMAGE` | `python:3.12-slim` | Image for Python. |
| `AGENTICMIND_SANDBOX_NODE_IMAGE` | `node:22-slim` | Image for JavaScript. |

## MCP server

| Variable | Default | Purpose |
|---|---|---|
| `AGENTICMIND_MCP_SERVER` | `1` | Serve `/api/mcp`. |
| `AGENTICMIND_MCP_TOKEN` | unset | Require this bearer token from MCP clients. |
| `AGENTICMIND_MCP_ALLOWED_HOSTS` | `localhost,localhost:*,127.0.0.1,127.0.0.1:*,[::1],[::1]:*` | Accepted Host headers (DNS-rebinding protection). |
| `AGENTICMIND_MCP_RUN_TIMEOUT` | `300` | Seconds a call waits for its run. |

## Observability

| Variable | Purpose |
|---|---|
| `OTEL_EXPORTER_OTLP_ENDPOINT` | Base OTLP/HTTP endpoint (`/v1/traces` appended). |
| `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | Full traces endpoint (used as-is). |
| `OTEL_EXPORTER_OTLP_HEADERS` / `OTEL_EXPORTER_OTLP_TRACES_HEADERS` | `k=v,k=v`, percent-decoded. |
| `OTEL_EXPORTER_OTLP_PROTOCOL` / `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` | `http/protobuf` (default) or `http/json`. gRPC is refused. |
| `OTEL_SERVICE_NAME` | Service name. |
| `AGENTICMIND_OTEL_INCLUDE_CONTENT` | `1` to include inputs/outputs in spans (may contain personal data). |
| `AGENTICMIND_METRICS_TOKEN` | Bearer token required by `/api/metrics`. |

## Deployment

| Variable | Purpose |
|---|---|
| `AGENTICMIND_LOCAL_DEPLOY` | `1` lets the Deployment Center run Docker on this machine (127.0.0.1 only). Off by default. |
| `APP_API_KEYS` | Comma-separated API keys for exported/deployed apps (clients send `X-API-Key`). |

## Opt-in live tests

`AGENTICMIND_TEST_POSTGRES_DSN`, `AGENTICMIND_TEST_PGVECTOR_DSN`, `AGENTICMIND_TEST_PINECONE_API_KEY`, `AGENTICMIND_TEST_WEAVIATE_URL`, `AGENTICMIND_TEST_ELASTICSEARCH_URL`, `AGENTICMIND_TEST_OPENSEARCH_URL`, `AGENTICMIND_TEST_MONGODB_URI`, `AGENTICMIND_TEST_REDIS_URL`, `AGENTICMIND_TEST_AUTO_ONTOLOGY_URL`, `AGENTICMIND_TEST_AUTO_ONTOLOGY_TOKEN`, `AGENTICMIND_TEST_LIVE_OCR`, `AGENTICMIND_TEST_FASTEMBED` enable tests against real services.
