Skip to main content
Second Brain reads its configuration from a .env file at the project root. Create this file before starting the app. All variables are read once at startup; restart the app after making changes.

Variables

Required

GEMINI_PROXY_URL
string
required
The full endpoint URL of your Gemini Proxy Balancer instance. The proxy handles API key rotation and quota management across multiple Gemini keys.Example: https://your-proxy.up.railway.app/v1/chat/completions
OBSIDIAN_VAULT_PATH
string
required
Absolute path to the Obsidian vault folder that Second Brain should read from and write to. Use a forward-slash path on all platforms.On Railway deployments, use /app/obsidian-vaults.Example: /Users/you/Documents/MyVault

Optional

GEMINI_MODELS
string
Comma-separated list of Gemini model IDs to use, in priority order. Second Brain tries each model in order and falls back to the next if a request fails.Default: gemini-2.5-flash,gemini-3-flash-preview,gemini-3.1-flash-lite-preview,gemini-2.0-flash-lite,gemini-3.1-flash-live-preview,gemini-flash-latestExample: gemini-2.5-flash,gemini-2.0-flash-lite
GEMINI_MAX_ROUNDS
integer
Maximum number of agent reasoning rounds per task. Increase this for complex multi-step tasks; decrease it to reduce latency and token usage.Default: 3
LOG_LEVEL
string
Logging verbosity for the application. Use DEBUG to see detailed agent output in the server logs.Options: DEBUG, INFO, WARNING, ERRORDefault: INFO

Example .env file

.env
# Required
GEMINI_PROXY_URL="https://your-proxy.up.railway.app/v1/chat/completions"
OBSIDIAN_VAULT_PATH="/Users/you/Documents/MyVault"

# Optional
GEMINI_MODELS="gemini-2.5-flash,gemini-2.0-flash-lite"
GEMINI_MAX_ROUNDS=3
LOG_LEVEL="INFO"
You can also set and persist the vault path from inside the app. Open the Vault Launcher, select or browse to a vault, and click Open. Second Brain writes the resolved path back to your .env file automatically.