Environment Variables
This page lists the environment variables read by each Breign service. Values in the "Default" column apply when the variable is not set. Values marked "example" must be adapted to your setup.
Breign APIβ
Breign API reads its configuration with the config module: each variable below overrides a key in config/default.json. The Docker image sets NODE_ENV=production, which also applies config/production.json. This is why a few defaults differ in the image.
Variables whose value is written as JSON (true, false, lists) are parsed as JSON: write true, not "true". A configuration key with no dedicated variable can be overridden with NODE_. It holds a JSON object that is merged into the configuration (for example NODE_CONFIG='{"services":{"mails":{"from":"breign@example.com"}}}').
Secrets have public default values, meant for local development (AUTHENTICATION__, AUTHENTICATION__, AUTHENTICATION__, ENCRYPTION__, SERVICES__β¦). Replace all of them in a deployment.
Server and logsβ
| Variable | Description | Default |
|---|---|---|
PORT | Port the HTTP server listens on. | 8080 |
SERVER__ | Full public URL of the API. Used to build callback URLs (OAuth, webhooks, file links, MCP) and the OAuth audience. | http://localhost:8080 |
SERVER__ | Address the server listens on. With the default value, the API can only be reached from its own machine. In a container, set 0.0.0.0. | localhost |
SERVER__ | Public URL of Breign APP. Used for the OAuth sign-in and consent pages, for browser sign-in from the CLI and Mate, and for links sent by email. If it stays local while SERVER__ is not, a warning is logged at startup. | http://localhost:3000 |
LOGGER__ | Minimum log level (error, warn, info, http, verbose, debug, silly). Logs are written as JSON to standard output. At debug level, logs also contain fragments of the responses streamed while the agent uses its tools, whatever the value of LOGGER__. Use info if your logs must not contain conversation content. | debug in the Docker image (info outside the image) |
LOGGER__ | Allows content (conversation messages, prompts, tool arguments) to be written to the logs. JSON value true or false. Only has an effect with LOGGER__LEVEL=debug. Keep it false on any environment that handles real data. | false in the Docker image (true outside the image) |
Databaseβ
| Variable | Description | Default |
|---|---|---|
SERVICES__ | Database to use: mongodb or pg (PostgreSQL). With pg, migrations (npm run migrate) must run before startup. | mongodb |
SERVICES__ | PostgreSQL connection URI (if SERVICES__PERSISTENCE__TYPE=pg). | postgresql://admin:password@localhost:5432/postgres |
SERVICES__ | MongoDB connection URI (if SERVICES__PERSISTENCE__TYPE=mongodb). | mongodb://127.0.0.1:27017/ai-brain-dev |
SERVICES__ | MongoDB database name. Replaces the old SERVICES__ variable, which is no longer read. | ai-brain-dev |
File storageβ
| Variable | Description | Default |
|---|---|---|
SERVICES__ | File storage: MINIO (any S3-compatible storage), GOOGLE (Google Cloud Storage, using the environment's service account credentials) or AZURE (Azure Blob Storage). | GOOGLE in the Docker image (MINIO outside the image) |
SERVICES__ | Bucket (or Azure container) for private files: knowledge, attachments, workspaces. | Required |
SERVICES__ | Bucket (or Azure container) for public files: avatars, logos, agent images. | Required |
SERVICES__ | S3 storage host, without protocol (MINIO). | localhost |
SERVICES__ | S3 storage port (MINIO). | 9000 |
SERVICES__ | Connect to the S3 storage over HTTPS (MINIO). | false |
SERVICES__ | S3 storage region (MINIO). | eu-west-1 |
SERVICES__ | S3 access key ID (MINIO). | Development key, must be replaced |
SERVICES__ | S3 secret access key (MINIO). | Development key, must be replaced |
SERVICES__ | Azure storage account name (AZURE). | β |
SERVICES__ | Azure storage account key (AZURE). | β |
SERVICES__ | Base URL of the tool preset logos (tool library). Only read by the migration that creates these presets. | Breign CDN URL |
SERVICES__ | Not read in the current version. | β |
Knowledge bases (vector databases)β
| Variable | Description | Default |
|---|---|---|
SERVICES__ | Full Qdrant URL, including protocol and port (for example https://qdrant.example.com:6333), for Qdrant knowledge bases. The protocol decides whether TLS is used. | http://localhost:6333 |
SERVICES__ | Qdrant API key. Empty: no authentication. | β |
SERVICES__, SERVICES__ | Not read in the current version: the port and TLS come from SERVICES__. | β |
SERVICES__ | Weaviate host, without protocol (for example weaviate.example.com), for Weaviate knowledge bases. | localhost:8090 |
SERVICES__ | Protocol used to connect to Weaviate: https or http. | http |
SERVICES__ | Weaviate authentication: API_ or NONE. | NONE |
SERVICES__ | Weaviate API key (if API_). | β |
SERVICES__ | Weaviate vectorizer module for knowledge bases that do not use a Breign embedding model: text2vec-ollama or text2vec-openai. | β |
SERVICES__ | Key that Weaviate sends to the vectorizer service (x-api-key and X-OpenAI-Api-Key headers), with text2vec-ollama. | β |
SERVICES__ | Ollama URL that Weaviate uses to vectorize (with text2vec-ollama). | β |
SERVICES__ | Default embedding model for Weaviate knowledge bases. With Ollama, the model must be downloaded on the instance. | text-embedding-3-large |
SERVICES__ | Vector dimension of this model. Replaces the old SERVICES__ variable, which is no longer read. | 3072 |
SERVICES__ | Number of texts sent per request to the embedding model when indexing into a Qdrant knowledge base. Batches are sent one after the other: a transient error (for example a 429) only retries its own batch. Weaviate knowledge bases vectorize on their own and are not affected. | 96 |
SERVICES__ | Number of attempts for an embedding batch before indexing of the document fails. The document is then retried according to SERVICES__. | 4 |
SERVICES__ | Delay, in milliseconds, before the second attempt of an embedding batch. It doubles on each following attempt. | 1000 |
KNOWLEDGE__ | Maximum number of images, extracted from documents by Breign Document API, sent to the model for a single knowledge search result. 0 = no images. Images are only sent to models that accept images, and never when anonymization is on. | 5 |
CONVERSATION_ | Size, in tokens, above which documents attached to a conversation are indexed and searched instead of being placed whole in the context, when the agent does not set its own threshold. | 100000 |
UPLOAD__ | Maximum size, in bytes, of a conversation attachment. | 15728640 (15 MB) |
Document parsingβ
Breign API and Breign Document API share a work queue in the database. Breign API does not call Breign Document API.
| Variable | Description | Default |
|---|---|---|
SERVICES__ | Key that Breign Document API sends to Breign API in its parsing callbacks (x-api-key header). It must equal the API_ of Breign Document API. Only used for documents submitted through POST /parsing with a callback_url. Replace it with a secret value in every deployment: the default value is accepted as is. | TO_ |
SERVICES__ | Maximum number of parsed documents being indexed at the same time by Breign API, across all instances (knowledge files and conversation attachments). | 8 |
SERVICES__ | Same limit, per organization. Documents without an organization are not subject to it. | 4 |
SERVICES__ | Time, in milliseconds, after which a document being processed by an instance that stopped responding is put back in the queue, or marked as failed if it has no attempts left. Also applies to documents held by Breign Document API: keep it consistent with its PARSING_. | 300000 |
SERVICES__ | Interval, in milliseconds, at which an instance indexing a document reports that it is still active. Must stay well below SERVICES__. | 60000 |
SERVICES__ | Number of indexing attempts for a document before it is marked as failed. | 3 |
SERVICES__ | Delays, in milliseconds, before each new indexing attempt (JSON list; the last delay is repeated). | [60000, 300000, 900000] |
SERVICES__ | Maximum number of documents put back in the queue on each maintenance pass (every 5 minutes, on each instance). | 100 |
External servicesβ
| Variable | Description | Default |
|---|---|---|
SERVICES__ | URL of Breign Scrapping API (internal network), used to import web pages into knowledge. | http://localhost:8001 |
SERVICES__ | Key sent as x-api-key to Breign Scrapping API. | TO_ |
SERVICES__ | Email sending: resend (Resend) or in-memory (no email is sent). Any other value prevents startup. | resend |
SERVICES__ | Resend API key. | β |
SERVICES__ | Server-wide OpenAI key. Used by default for OpenAI text-to-speech in applications when the application does not provide its own key. Agents use the AI engines configured in each organization, not this key. | β |
SERVICES__ | OpenAI organization associated with SERVICES__. | β |
SERVICES__ | Server-wide ElevenLabs key. Used by default for ElevenLabs text-to-speech in applications. | β |
Authentication and securityβ
| Variable | Description | Default |
|---|---|---|
AUTHENTICATION__ | System (super administrator) API key of Breign API, sent as x-api-key. Breign APP uses it (BRAIN_). | Required |
AUTHENTICATION__ | Authentication secret (sessions, encryption of the JWKS keys stored in the database). Generate it for example with openssl rand -base64 32. | Required |
AUTHENTICATION__ | JSON list (as text) of the origins allowed to call the authentication endpoints, for example ["https://app.example.com"]. | ["https://api.breign.eu"] |
AUTHENTICATION__ | Issuer and audience of the JWTs signed by the API (application instance tokens and JWT sign-in). | localhost |
AUTHENTICATION__ | Ed25519 private key (PEM, PKCS#8) that signs these JWTs. | Development key, must be replaced |
AUTHENTICATION__ | Matching Ed25519 public key (PEM) that verifies them. | Development key, must be replaced |
AUTHENTICATION__ | Makes Breign an OAuth 2 / OpenID Connect provider for third-party applications (JSON value true or false). Migrations must run before you enable it. | false |
AUTHENTICATION__ | Identifier (audience) of the API that OAuth applications pass as resource. Empty: SERVER__. | β |
ENCRYPTION__ | Secret used to encrypt AI engine API keys and secrets stored in the database. Breign Document API must have exactly the same value to read the organizations' OCR configuration. Changing it makes the secrets already stored unreadable. | SUPER_ |
MATE__ | Secret that signs the session tokens given to execution nodes (CLI, Breign Mate) so that an agent turn can call back the API. Empty: key derived from ENCRYPTION__. | β |
MATE__ | Above this disk usage of its working disk (JSON number), an execution node gets no new environment; turns resuming an existing environment still run. | 90 |
GIT__ | Breign APP page where GitLab or GitHub sends members back when they connect their Git account: https://<app>/git/oauth/callback. Empty: members can't connect an account. | β |
Featuresβ
JSON values true or false.
| Variable | Description | Default |
|---|---|---|
FEATURES__ | Projects, tickets and inbox. When disabled, their routes return 404. | true |
FEATURES__ | Agents working on their tickets on their own (wake-ups, work sessions). Requires FEATURES__. | true |
FEATURES__ | Execution nodes (Breign CLI, Breign Mate) that run agents on user or organization machines. | true |
FEATURES__ | Automations triggered from outside: GitLab mentions and webhooks. | true |
FEATURES__ | Agent fleet installation wizard. | false |
Agent toolsβ
| Variable | Description | Default |
|---|---|---|
SERVICES__ | Enables the agents' long-term memory tool on the whole server (JSON value). Each agent must also enable it. | true |
SERVICES__ | Maximum size, in characters, of a memory file. | 8000 |
SERVICES__ | Maximum number of memory files per memory space. | 20 |
SERVICES__ | Maximum duration of a sandbox command (bash tool), in milliseconds. | 10000 |
SERVICES__ | Maximum number of output characters of a command returned to the model. | 20000 |
SERVICES__ | Idle time, in milliseconds, after which a bash session is freed from memory. | 600000 |
SERVICES__ | Maximum number of bash sessions kept in memory per process. | 50 |
SERVICES__ | Maximum size, in bytes, of a workspace file. | 1048576 |
SERVICES__ | Maximum total size, in bytes, of a saved workspace. | 20971520 |
SERVICES__ | Maximum number of files saved per workspace. | 200 |
SERVICES__ | Maximum size, in bytes, of the in-memory file system of a bash session. | 33554432 |
SERVICES__ | Allows Python in the sandbox (JSON value). Each agent must also enable it, and the user approves each command. | false |
SERVICES__ | Allows JavaScript (js-exec) in the sandbox, under the same conditions. | false |
SERVICES__ | Allows network access (curl) from the sandbox (JSON value). Each agent must also enable it, and the user approves the addresses. | false |
SERVICES__ | Allows code mode on the server (JSON value true or false). Without it, an agent's "Code mode" option has no effect. | false |
SERVICES__ | Maximum number of code mode programs running at the same time per API process, across all conversations. Beyond that, the program fails. | 4 |
SERVICES__ | Maximum duration of a code mode program, in milliseconds. | 30000 |
SERVICES__ | Maximum memory of a program, in bytes. | 67108864 |
SERVICES__ | Maximum size of a program's code, in bytes. | 262144 |
SERVICES__ | Maximum size of a program's result, in bytes. | 262144 |
SERVICES__ | Maximum size of a program's console output, in bytes. | 65536 |
SERVICES__ | Maximum size of the parameters of a tool call made by a program, in bytes. | 262144 |
SERVICES__ | Maximum size of a tool response received by a program, in bytes. | 1048576 |
SERVICES__ | Maximum number of tool calls per program. | 256 |
SERVICES__ | Maximum number of concurrent tool calls in a program. Beyond that, the program fails. | 32 |
SERVICES__ | Allows OpenAPI tools to call private network addresses (JSON value). When disabled, an address entered in an organization cannot reach your internal services. | false |
SERVICES__ | Maximum time, in milliseconds, to download an OpenAPI definition. | 10000 |
SERVICES__ | Maximum time, in milliseconds, of an OpenAPI tool call. | 30000 |
SERVICES__ | Maximum size, in bytes, of an OpenAPI definition. | 2097152 |
SERVICES__ | Maximum size, in bytes, of an OpenAPI tool call response. | 1048576 |
SERVICES__ | MCP protocol version requested from MCP servers: auto (negotiation), legacy, or a specific version to enforce (for example 2025-06-18). | auto |
SERVICES__ | Retention period, in days, of MCP tool call logs. | 7 |
SERVICES__ | Enables the MCP server through which local agents (Claude Code, etc.) query Breign agents (JSON value). | true |
SERVICES__ | Time, in seconds, that a call to this MCP server waits for the agent's answer before returning (the local agent fetches the answer later). | 25 |
SERVICES__ | Maximum wait, in seconds, that a caller can request. | 50 |
SERVICES__ | Validity, in hours, of a question an agent asks a human, when the agent does not set its own (between 1 and 168). | 24 |
SERVICES__ | Command (JSON array) published in the organization's OpenCode manifest. OpenCode runs it to get the Breign API key. By default, it reads the BREIGN_ variable on the user's machine. | Command that reads BREIGN_ |
Automations, scheduled tasks and ticketsβ
| Variable | Description | Default |
|---|---|---|
SERVICES__ | How scheduled tasks run: disabled (none), local (run by Breign API itself), redis or pubsub (published to a queue read by the task service). | disabled |
SERVICES__ | Queue name (Redis key or Pub/Sub topic) with redis or pubsub. | scheduled-task-triggers-dev |
SERVICES__ | Number of tasks run at the same time per instance with local. | 4 |
SERVICES__ | Interval, in milliseconds, at which an instance reports that a running task is still active (local). | 30000 |
SERVICES__ | Allows callback URLs of scheduled tasks and automation webhooks to point to private networks (JSON value). | false |
SERVICES__ | Redis URL, with SERVICES__SCHEDULED_TASKS_QUEUE__DRIVER=redis. | redis://127.0.0.1:6379 |
SERVICES__ | Google Pub/Sub credentials: instance (the environment's service account) or local (gcp-service-account.json file). | instance |
SERVICES__ | Pub/Sub API endpoint. | europe-west1-pubsub.googleapis.com:443 |
SERVICES__ | Public API address used in the webhook URLs to register in GitLab or an external system. Empty: SERVER__. | β |
SERVICES__ | GitLab webhooks accepted per integration per minute. Beyond that, they are ignored. | 600 |
SERVICES__ | Concurrent automation runs per API instance. | 4 |
SERVICES__ | Concurrent runs per agent. | 1 |
SERVICES__ | Concurrent runs per organization. | 3 |
SERVICES__ | Time, in milliseconds, after which a run whose instance stopped responding is put back in the queue. | 600000 |
SERVICES__ | Interval, in milliseconds, at which an instance reports that a run is still active. | 30000 |
SERVICES__ | Number of attempts for a run. | 3 |
SERVICES__ | Delays, in milliseconds, before each new attempt (JSON list). | [30000, 120000, 600000] |
SERVICES__ | Maximum age, in milliseconds, of a queued trigger. Beyond that, it is dropped with a short "request expired" reply. | 7200000 |
SERVICES__ | Runs per hour per GitLab bot account. | 60 |
SERVICES__ | Runs per hour in a single discussion thread (protects against loops). | 5 |
SERVICES__ | Maximum time, in milliseconds, of a GitLab API call. | 10000 |
SERVICES__ | Retention period, in days, of the trigger history. | 30 |
SERVICES__ | Allows a GitLab instance on a private network (JSON value). | false |
SERVICES__ | Maximum size, in bytes, of an automation webhook body. Beyond that, the response is 413. | 1048576 |
SERVICES__ | Size, in bytes, of the body kept and passed to the agent. Beyond that, only the beginning is kept. | 65536 |
SERVICES__ | Calls accepted per webhook per minute. Beyond that, the response is 429. | 120 |
SERVICES__ | Runs per hour per webhook. | 120 |
SERVICES__ | Maximum difference, in milliseconds, between the X-Breign-Timestamp header of a signed webhook and the server clock. | 300000 |
SERVICES__ | Delay, in milliseconds, that groups close events on a ticket into a single agent wake-up. | 15000 |
SERVICES__ | Time, in milliseconds, after which a wake-up whose instance stopped responding is put back in the queue. | 600000 |
SERVICES__ | Interval, in milliseconds, at which an instance reports that a wake-up is still running. | 60000 |
SERVICES__ | Number of attempts for a wake-up. | 3 |
SERVICES__ | Delays, in milliseconds, before each new attempt (JSON list). | [60000, 300000, 900000] |
SERVICES__ | Delay, in milliseconds, before retrying when the agent is still working or waiting for an answer. | 60000 |
SERVICES__ | Runs per hour, per ticket and per agent (protects against runaway loops). | 12 |
SERVICES__ | Maximum number of wake-ups put back in the queue on each maintenance pass. | 50 |
WebSocketsβ
| Variable | Description | Default |
|---|---|---|
SOCKETS__ | Number of WebSocket messages kept per device, to be replayed after a reconnection. | 500 |
SOCKETS__ | Number of devices whose messages are kept in memory. The least recent ones are dropped first. | 500 |
SOCKETS__ | Time, in milliseconds, after which the messages of an idle device are dropped. | 1800000 |
Proxy configurationβ
If your infrastructure requires a proxy, Node.js must use it. Set NODE_USE_ENV_PROXY=1: Node.js then uses the following variables for all HTTP and HTTPS requests made by Breign API (Breign APP works the same way).
| Variable | Description | Example |
|---|---|---|
NODE_ | Tells Node.js to use HTTP_, HTTPS_ and NO_ to configure the global proxy. | 1 |
HTTP_ or http_proxy | Proxy URL for HTTP requests. If both are set, http_proxy wins. | http://proxy.example.com:3128 |
HTTPS_ or https_proxy | Proxy URL for HTTPS requests. If both are set, https_proxy wins. | http://proxy.example.com:3128 |
NO_ or no_proxy | Comma-separated hosts reached without going through the proxy. If both are set, no_proxy wins. | localhost,127.0.0.1,.example.com |
The Breign API Docker image also sets NODE_OPTIONS=--use-system-ca: Node.js trusts the system certificate authorities, so you can add an internal authority to the image.
Breign APPβ
In the Docker image, four NEXT_PUBLIC_* variables (NEXT_, NEXT_, NEXT_, NEXT_) are replaced when the container starts, so you can set them at launch. If one of them is not set at launch, it becomes an empty string and the default value from the code no longer applies: set all of them. Outside Docker (next build, Vercel), all NEXT_PUBLIC_* variables must be present at build time.
| Variable | Description | Required | Default / example |
|---|---|---|---|
BETTER_ | Authentication secret: signs sessions, cookies and tokens. Generate it for example with openssl rand -base64 32. | Yes | β |
BETTER_ | Public URL of the application: base of the authentication callbacks, passkey domain, links and logo in emails. | Yes | https://app.example.com |
AUTHENTICATION__ | Origins allowed by the authentication in addition to BETTER_ (JSON array). | No | ["https://admin.example.com"] |
PERSISTENCE_ | Database for authentication and application-specific data: pg or mongodb. Must be the same database as Breign API. Any other value makes startup fail. | Yes | pg |
PG_ | PostgreSQL connection URI. | If PERSISTENCE_TYPE=pg | postgresql://user:password@db.example.com:5432/breign |
MONGODB_ | MongoDB connection URI. The database used is the one given in the URI. | If PERSISTENCE_TYPE=mongodb | mongodb://user:password@mongo.example.com:27017/breign |
BRAIN_ | Breign API URL for calls made by the application server. | Yes | https://api.example.com |
NEXT_ | Public Breign API URL, used by the browser and, in priority, by the application server. Also used to display the URLs of the MCP servers and the AI Gateway. | Yes | https://api.example.com |
NEXT_ | Breign API WebSocket URL, used by an agent's application simulator. | Yes | wss://api.example.com |
BRAIN_ | System API key of Breign API (the value of its AUTHENTICATION__). The application does not start without it. | Yes | β |
NEXT_ | SSO provider ID. When set, the sign-in page redirects straight to this SSO and passkeys are disabled by default. Empty (or false): no SSO. | No | my-idp |
PASSKEYS_ | Enables (true) or disables (false) passkey sign-in. Without a value: enabled, unless NEXT_ is set. | No | β |
RESEND_ | Resend API key for emails (sign-in code, adding a passkey). CONSOLE writes the emails to the logs instead of sending them. | Yes | CONSOLE (development) |
NEXT_ | Interface theme and brand: BREIGN or SKAI. Dark mode only exists with BREIGN. | Yes (Docker) | BREIGN |
FEATURE_ | Shows projects, tickets and the inbox. false hides them. Must match FEATURES__ in Breign API. | No | enabled |
FEATURE_ | Shows agents working on tickets on their own (only if projects are shown). false hides it. Must match FEATURES__ in Breign API. | No | enabled |
FEATURE_ | Shows the fleet installation wizard (true). Must match FEATURES__ in Breign API. | No | disabled |
MCP_ | MCP protocol version requested when the application calls an MCP server: auto, legacy or a specific version (for example 2025-06-18). | No | auto |
IMAGES_ | Docker image only: hostname of the image storage allowed for optimized image display (avatars, logos). | If images come from your own storage | storage.example.com |
IMAGES_ | Docker image only: path allowed on this host. | With IMAGES_ | /my-bucket/** |
IMAGES_ | Docker image only: true allows loading images from a private IP address (for example a storage behind a private endpoint). | No | false |
PORT / HOSTNAME | Port and interface the server listens on. | No | 3000 / 0.0.0.0 |
The MONGODB_, WEAVIATE_, WEAVIATE_, WEAVIATE_ and WEAVIATE_ variables are no longer read. You can remove them.
Breign Document APIβ
Breign Document API no longer receives documents from Breign API through an HTTP call. Breign API puts each document to parse in a queue shared in the database (document_parsing table or document-api-parsing collection), and Breign Document API polls this queue continuously. Both services must therefore point to the same database. POST /parsing is still available: it puts a document in the same queue. If the call provides a callback_url, Breign Document API calls that URL once the document is parsed or has failed for good, with the API_KEY_NAME: API_KEY header. A document dropped by queue maintenance (instance gone and no attempts left) does not trigger a callback.
Conversion to Markdown runs in a pool of worker processes (MAX_ processes). Downloading, OCR, writing the result and callbacks stay in the main process. Images in PDF, Word and PowerPoint files are extracted and stored next to the Markdown, which references them.
Files are stored either in S3-compatible storage (MinIO, S3β¦) or in Azure Blob Storage through its native API, depending on FILE_.
| Variable | Description | Required | Value |
|---|---|---|---|
API_ | API key required in the API_ header of calls to Breign Document API. It is also sent in parsing callbacks: for Breign API to accept them, it must equal SERVICES__ in Breign API. | Yes | breign-document-api-key |
API_ | Name of the HTTP header used to send the API key, in both directions. Breign API reads the callback key from x-api-key (case-insensitive). | Yes | x-api-Key |
ENCRYPTION__ | Secret that decrypts the AI engine keys stored by Breign API, read to apply each organization's OCR configuration. Must equal exactly the ENCRYPTION__ of Breign API. Without it, the service refuses to start. | Yes | value of ENCRYPTION__ in Breign API |
MODE | Environment marker (prod or dev): it is only validated and shown at startup. No behavior depends on it. | No | prod (default) |
LOG_ | Minimum log level (DEBUG, INFO, WARNING, ERRORβ¦), also applied to worker processes. | No | INFO (default) |
FILE_ | File storage: minio (any S3 API: MinIO, S3β¦) or azure_blob (native Azure Blob Storage API). Any other value prevents startup. | No | minio (default) |
MINIO_ | S3/MinIO storage host, without protocol or port: the URL is built as MINIO_PROTOCOL://MINIO_ENDPOINT[:MINIO_PORT]. | If FILE_STORAGE__ADAPTER=minio | files.company.eu |
MINIO_ | Storage port. Left out of the URL if empty. | No | 443 |
MINIO_ | Protocol of the storage URL (http or https). | No | https (default: http) |
MINIO_ | use_ssl option of the S3 client (true or false). The URL protocol is still the one from MINIO_. | No | false (default) |
S3_ | TLS verification of the storage: empty = system certificate authorities, false = verification disabled, otherwise path to a CA bundle. | No | empty (default) |
MINIO_ | Single bucket (or, with FILE_STORAGE__ADAPTER=azure_blob, Azure container) of the service: it reads the original documents from it and writes the Markdown (.md, _ocr.md) and extracted images to it. | Yes | breign-files |
MINIO_ | MinIO access key. | If FILE_STORAGE__ADAPTER=minio | breign-minio-user |
MINIO_ | MinIO secret key. | If FILE_STORAGE__ADAPTER=minio | minio-secret-key |
FILE_ | Azure storage account name. | If FILE_STORAGE__ADAPTER=azure_blob | breignstorage |
FILE_ | Azure storage account access key. Also used to sign the read-only SAS URLs of the MISTRAL_ OCR mode. | If FILE_STORAGE__ADAPTER=azure_blob | azure-account-key |
FILE_ | Blob service URL. Only set it for Azurite or another Azure cloud. | No | empty (default: https://<account>.blob.core.windows.net) |
SERVICES__ | Database that holds the parsing queue (mongodb or pg). Must be the same database as Breign API: the two services exchange documents to parse through it, and the service reads the organizations' OCR configuration from it. Any other value prevents startup. | No | mongodb (default) |
MONGODB_ | Connection URI of the Breign API MongoDB database. | If SERVICES__PERSISTENCE__TYPE=mongodb | mongodb://user:password@localhost:27017/breign |
MONGO_ | Name of the Breign API MongoDB database (parsing queue and organizations' OCR configuration). | If SERVICES__PERSISTENCE__TYPE=mongodb | breign |
MONGO_ | Name of the MongoDB collection of the parsing queue, shared with Breign API. Must be document-api-parsing, the name used by Breign API. | If SERVICES__PERSISTENCE__TYPE=mongodb | document-api-parsing |
PG_ | PostgreSQL connection URI (document_parsing table, shared with Breign API). The pool opens up to 2 Γ MAX_ + 5 connections: the service refuses to start if this number exceeds PostgreSQL's max_connections. | If SERVICES__PERSISTENCE__TYPE=pg | postgresql://user:password@localhost:5432/breign |
MAX_ | Number of documents processed at the same time by one instance, and number of worker processes that convert them. An instance never takes more documents from the queue than it has free slots. 0 = computed at startup: one process per CPU, within the memory limit (memory Γ· PARSE_ β 1, at least 1), container limits (cgroup v2) included. The chosen value is shown in the startup logs. | No | 0 (default) |
PARSE_ | Memory, in MB, counted for one worker process in the automatic computation of MAX_. This is not a limit enforced on the process. | No | 1600 (default) |
PARSE_ | Number of documents after which a worker process is replaced by a new one, to free memory fragmented by large documents. 0 = never replaced. | No | 50 (default) |
PARSE_ | Maximum conversion time of a document, in seconds. Beyond that, the worker process is killed and the document fails with no retry. A process that dies during conversion (usually from lack of memory) produces the same permanent error. | No | 300 (default) |
PARSE_ | false converts in threads of the main process, for debugging: no parallelism, and a document that exceeds PARSE_ is marked as failed but its conversion keeps running. Keep it true in production. | No | true (default) |
MAX_ | Maximum size of a document, in MB. A larger document fails as soon as it is downloaded, with no retry. 0 = no limit. | No | 100 (default) |
PARSING_ | Maximum number of documents being parsed, across all instances. Only useful below number of instances Γ MAX_. | No | 10 (default) |
PARSING_ | Same limit, per organization. | No | 5 (default) |
PARSING_ | Time, in seconds, after which a document whose instance stopped responding is put back in the queue, or marked as failed if it has no attempts left. At least 3 Γ PARSING_. Keep it consistent with SERVICES__ in Breign API. | No | 300 (default) |
PARSING_ | Interval, in seconds, at which an instance parsing a document reports that it is still active. | No | 60 (default) |
PARSING_ | Maximum number of parsing attempts for a document: a transient failure is retried up to this limit, then the document is marked as failed. Exceeding PARSE_, a dead worker process and a document that is too large are never retried. | No | 3 (default) |
PARSING_ | Delays, in seconds, before each new attempt (JSON list; the last delay is repeated). | No | [60, 300, 900] (default) |
PARSING_ | Maximum number of documents put back in the queue on each maintenance pass. | No | 100 (default) |
PARSING_ | Interval, in seconds, between two queue maintenance passes. | No | 60 (default) |
ENABLE_ | Runs the tables produced by the conversion through a header / value classification done by OpenAI. Excel and CSV files are then read directly through this path. Requires OPENAI_. | No | false (default) |
OPENAI_ | OpenAI key used only by table extraction. OCR does not use it: OCR is configured per organization in Breign API. | If ENABLE_TABLE_EXTRACTION=true | openai-api-key |
PDF_ | Number of pages per chunk when a long PDF is converted in chunks, to limit memory. 0 disables chunking. | No | 20 (default) |
PDF_ | A PDF is only split into chunks if it has more pages than this threshold. | No | 50 (default) |
PDF_ | Removes rotated text (margin banners, vertical labels) from mostly upright PDF pages. Otherwise this text comes out one character per line. | No | true (default) |
ENABLE_ | Rebuilds the heading hierarchy (#, ##β¦) of PDFs, which the conversion alone does not produce. | No | false (default) |
HEADING_ | Deepest heading level produced (1 to 6). | No | 3 (default) |
HEADING_ | Infers a heading's level from its numbering (3.2.1 Title). | No | true (default) |
HEADING_ | Otherwise, infers a heading's level from its font size. | No | true (default) |
IMAGE_ | Maximum number of distinct images extracted and stored per document (1 to 500). Images are stored in <document>_images/ and referenced in the Markdown. Beyond the limit, an image only keeps an empty reference. | No | 100 (default) |
OCR_ | Rendering resolution of pages sent to OCR (72 to 400). | No | 150 (default) |
OCR_ | Format of page images sent to OCR (JPEG or PNG). | No | JPEG (default) |
OCR_ | JPEG quality of page images (1 to 100), ignored for PNG. | No | 80 (default) |
OCR_ | Longest side of a page image, in pixels (at least 256): the image is scaled down to fit. | No | 2000 (default) |
OCR_ | Maximum number of pages of a document sent to OCR. Beyond that, the document fails. 0 = no limit. | No | 0 (default) |
OCR_ | Number of pages of a single document sent at the same time to the OCR provider. | No | 4 (default) |
OCR_ | Timeout of an OCR request for one page, in seconds. | No | 120 (default) |
OCR_ | Extra attempts for a page after a first failure. | No | 2 (default) |
OCR_ | Maximum OCR time for a document, in seconds. Beyond that, OCR is retried within the limit of PARSING_. | No | 1800 (default) |
OCR_ | true makes the document fail as soon as a page cannot be read. false marks the page as failed and continues. | No | false (default) |
OCR_ | MISTRAL_ OCR mode only: validity, in seconds (at least 60), of the presigned URL (SAS URL with Azure) sent to the provider. The provider must be able to reach the storage from the Internet. | No | 900 (default) |
The OCR mode, model and provider key are not environment variables. They are configured per organization in Breign API and read from the database for each document. An organization with no configuration has no OCR.
A numeric or boolean variable that is set but empty (for example MINIO_USE_SSL=) prevents the service from starting.
Breign Scrapping APIβ
The service does not authenticate the calls it receives (POST /scrape, GET /status/{knowledge_id}). It must only be reachable by Breign API, on the internal network. In the other direction, the spider calls Breign API with BRAIN_ and BRAIN_.
| Variable | Description | Required | Value |
|---|---|---|---|
BRAIN_ | Base URL of Breign API, without a trailing /. The spider calls it to index each scraped page. At the end of a crawl, it calls it again to set the site's date and to delete pages that disappeared during a resync. | Yes | https://api.example.com |
BRAIN_ | Key the spider sends as x-api-key to Breign API. The end-of-crawl sync requires organization administrator rights: use a key that grants them, for example the value of AUTHENTICATION__ in Breign API. Without these rights, the last-update date and the deletion of missing pages are not applied. | Yes | breign-.... |
BRAIN_ | Only used for an end-of-job notification (POST {BRAIN_API_URL}scrape/notify) that has no matching route in Breign API. | No | http://localhost:8000/ (default) |
FILESTORAGE_ | MinIO/S3 storage host, with the port if needed and without protocol: the connection always uses http://. The value is also saved in the upload URL (postUrl) of sites and pages. | Yes | files.company.eu:9000 |
BUCKET_ | Name of the bucket where scraped pages are stored. The bucket is created if it does not exist. | Yes | breign-files |
MINIO_ | MinIO access key. Without it, no page is uploaded to the storage. | Yes | breign-minio-user |
MINIO_ | MinIO secret key. | Yes | minio-secret-key |
PERSISTENCE_ | Breign API database where the service reads knowledge bases and writes sites and pages: pg, or mongodb (any value other than pg selects MongoDB). Must be the same database as Breign API. | No | pg (default) |
PG_ | PostgreSQL connection URI, with the async driver postgresql+asyncpg:// (a postgresql:// URI fails). | If PERSISTENCE_TYPE=pg | postgresql+asyncpg://user:password@localhost:5432/breign |
MONGO_ | MongoDB connection URI. The database used is the one in MONGO_, not the one in the URI. Replaces MONGODB_, which this service never read. | If PERSISTENCE_TYPE=mongodb | mongodb://user:password@localhost:27017 |
MONGO_ | Name of the Breign API MongoDB database. | If PERSISTENCE_TYPE=mongodb | breign (default: ai-brain-local) |