This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

niri / .env.example
4.7 kB 94 lines
1# ── Primary model (OpenAI-compatible) ──────────────────────────────────────── 2OPENAI_BASE_URL=https://api.openai.com/v1 3OPENAI_API_KEY= 4MODEL= 5# Enable/disable model reasoning traces (thinking) across requests + stream output. 6ENABLE_THINKING=true 7 8# ── Memory embeddings ──────────────────────────────────────────────────────── 9# Used for semantic memory reranking and low-information chatter suppression. 10# The sqlite-vec table is fixed at 3072 dimensions; changing dimensions requires 11# deleting/rebuilding memory_chunk_vec, memory_prototype_vec, and embedding meta. 12EMBEDDING_API_KEY= 13EMBEDDING_BASE_URL=https://openrouter.ai/api/v1 14EMBEDDING_MODEL=google/gemini-embedding-2-preview 15EMBEDDING_DIMENSIONS=3072 16 17# Used when the primary endpoint is unreachable or rate-limited (429/5xx). 18# Supports any OpenAI-compatible provider (OpenRouter, LM Studio, etc.). 19FALLBACK_OPENAI_BASE_URL=http://localhost:1234/v1 20FALLBACK_OPENAI_API_KEY= 21FALLBACK_MODEL= 22# Tool call policy for fallback requests: required, auto, none 23FALLBACK_TOOL_CHOICE=required 24# Optional headers 25FALLBACK_OPENAI_REFERER= 26FALLBACK_OPENAI_TITLE= 27# Context window enforcement for fallback. Defaults to true for localhost, false otherwise. 28FALLBACK_ENFORCE_CONTEXT_LIMIT= 29FALLBACK_N_CTX=4096 30FALLBACK_CONTEXT_MARGIN=256 31FALLBACK_HARD_OVERFLOW_TOKENS=1024 32 33# Set to "local" to skip the primary model and route all requests to the fallback. 34NIRI_ENV=default 35 36# Must match the user created in the Dockerfile and the volume mount in docker-compose.yml. 37NIRI_USER=niri 38NIRI_CONTAINER=niri 39# UID/GID the container process runs as — match your host user to avoid permission issues. 40# On Linux this is usually `id -u` / `id -g` (often 1000:1000). 41AGENT_UID=1000 42AGENT_GID=1000 43 44PORT=3000 45# Used by the chat CLI to connect. Include the scheme, exclude the port. 46NIRI_HOST=http://localhost 47 48# ── Context & token limits ──────────────────────────────────────────────────── 49TOKEN_NUDGE_THRESHOLD=120000 50FALLBACK_TOKEN_NUDGE_THRESHOLD=50000 51CONTEXT_COMPACT_TARGET_TOKENS=65000 52CONTEXT_COMPACT_TRIGGER_TOKENS=90000 53CONTEXT_COMPACT_RECENT_MESSAGES=80 54CONTEXT_COMPACT_CHUNK_MESSAGES=32 55CONTEXT_COMPACT_SUMMARY_MAX_CHARS=16000 56 57# ── Runner safety guardrails ────────────────────────────────────────────────── 58# Hard cap on assistant turns in a single wake cycle. 59RUNNER_MAX_TURNS=120 60# Stop if the same assistant tool call + result pattern repeats. 61RUNNER_MAX_IDENTICAL_TOOL_TURNS=6 62 63# ── Tools ───────────────────────────────────────────────────────────────────── 64# Max bytes accepted by image_tool before rejecting the file. 65IMAGE_TOOL_MAX_BYTES=150000 66# Override the image directory exposed to the agent (default: /home/$NIRI_USER/images). 67IMAGE_ROOT= 68 69# ── Discord ─────────────────────────────────────────────────────────────────── 70DISCORD_BOT_TOKEN= 71# Optional — auto-detected from the gateway on first connect if left blank. 72DISCORD_BOT_USER_ID= 73# Enable the built-in gateway listener (messageCreate → ingest pipeline). 74DISCORD_GATEWAY_ENABLED=true 75# Log every ingest decision (verbose, for debugging). 76DISCORD_GATEWAY_TRACE=false 77# Also ingest raw MESSAGE_CREATE packets — recommended for DM reliability. 78DISCORD_GATEWAY_RAW_FALLBACK=true 79# Comma-separated channel IDs scanned by discord_scan when no channel_ids arg is passed. 80DISCORD_SCAN_CHANNEL_IDS= 81# Wake the agent immediately on any new Discord event (leave false to avoid spam). 82DISCORD_WAKE_ON_EVENT=false 83# Wake immediately on DMs even when DISCORD_WAKE_ON_EVENT is false. 84DISCORD_WAKE_ON_DM=true 85# How often to batch pending Discord events into a single harness message. 86DISCORD_BATCH_INTERVAL_MS=60000 87# Restrict batch digests to configured scan channels + DMs (recommended). 88DISCORD_BATCH_ONLY_CONFIGURED=true 89# Auto-demote pending inbox items to seen after N minutes (0 = disabled). 90DISCORD_PENDING_AUTO_SEEN_MINUTES=10 91# Include a channel scan snapshot in each batch payload. 92DISCORD_BATCH_SCAN=true 93# Max messages included in a single batch digest. 94DISCORD_BATCH_MAX_MESSAGES=40