Loading...
Loading...
All configuration is handled through environment variables. Copy .env.example to .env and fill in the values.
| Variable | Required | Default | Description |
|---|---|---|---|
| DATABASE_URL | Required | PostgreSQL connection string with pgvector extension | |
| NEXTAUTH_SECRET | Required | Session encryption key (min 32 chars, generate with openssl rand -base64 32) | |
| NEXTAUTH_URL | Required | Public URL of your app (e.g. http://localhost:7392) | |
| OPENROUTER_API_KEY | Required | OpenRouter API key for LLM access | |
| NODE_ENV | Optional | development | development, production, or test |
| PORT | Optional | 3000 | HTTP server port |
| LOG_LEVEL | Optional | info | Logging verbosity: debug, info, warn, error |
The embedding model determines how documents are converted to vectors. The default (Google Gemini) produces 768-dimensional vectors which match the database schema. If you change the provider, you must also run a migration to update the vector column dimension.
| Variable | Required | Default | Description |
|---|---|---|---|
| EMBEDDING_PROVIDER | Optional | google, openai, or ollama | |
| EMBEDDING_MODEL | Optional | Specific model name (auto-detected if omitted) | |
| EMBEDDING_DIMENSIONS | Optional | 768 | Vector dimensions (must match DB schema) |
| GOOGLE_GENERATIVE_AI_API_KEY | Optional | Required if EMBEDDING_PROVIDER=google | |
| OPENAI_API_KEY | Optional | Required if EMBEDDING_PROVIDER=openai | |
| OLLAMA_BASE_URL | Optional | http://localhost:11434 | Ollama server URL (if EMBEDDING_PROVIDER=ollama) |
Required in production. In development, an in-memory fallback is used automatically.
| Variable | Required | Description |
|---|---|---|
| UPSTASH_REDIS_REST_URL | Optional | Upstash Redis REST URL (required in production) |
| UPSTASH_REDIS_REST_TOKEN | Optional | Upstash Redis REST token (required in production) |
In development, files are stored locally. In production, Cloudinary is used for cloud storage.
| Variable | Required | Description |
|---|---|---|
| CLOUDINARY_URL | Optional | Cloudinary connection URL |
| CLOUDINARY_CLOUD_NAME | Optional | Cloudinary cloud name |
| CLOUDINARY_API_KEY | Optional | Cloudinary API key |
| CLOUDINARY_API_SECRET | Optional | Cloudinary API secret |
| CLOUDINARY_UPLOAD_FOLDER | Optional | Folder prefix for uploaded files |
| Variable | Required | Default | Description |
|---|---|---|---|
| ENCRYPTION_MASTER_KEY | Optional | Encryption key for SAML keys and webhook secrets (min 32 chars, required in production) | |
| CSRF_SECRET | Optional | NEXTAUTH_SECRET | CSRF token signing key (falls back to NEXTAUTH_SECRET) |
| ALLOWED_ORIGINS | Optional | Comma-separated CORS origins | |
| CSP_CONNECT_SRC | Optional | Additional domains for CSP connect-src directive |