This repository has no description
0

Configure Feed

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

niri / .env.example
4.8 kB 96 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# Leave unset for raw local shell access. Set both values to route shell tools 37# through docker exec instead; NIRI_USER must match the Dockerfile user. 38# NIRI_USER=niri 39# NIRI_CONTAINER=niri 40# UID/GID the container process runs as — match your host user to avoid permission issues. 41# On Linux this is usually `id -u` / `id -g` (often 1000:1000). 42AGENT_UID=1000 43AGENT_GID=1000 44 45PORT=3000 46# Used by the chat CLI to connect. Include the scheme, exclude the port. 47NIRI_HOST=http://localhost 48 49# ── Context & token limits ──────────────────────────────────────────────────── 50TOKEN_NUDGE_THRESHOLD=120000 51FALLBACK_TOKEN_NUDGE_THRESHOLD=50000 52CONTEXT_COMPACT_TARGET_TOKENS=65000 53CONTEXT_COMPACT_TRIGGER_TOKENS=90000 54CONTEXT_COMPACT_RECENT_MESSAGES=80 55CONTEXT_COMPACT_CHUNK_MESSAGES=32 56CONTEXT_COMPACT_SUMMARY_MAX_CHARS=16000 57 58# ── Runner safety guardrails ────────────────────────────────────────────────── 59# Hard cap on assistant turns in a single wake cycle. 60RUNNER_MAX_TURNS=120 61# Stop if the same assistant tool call + result pattern repeats. 62RUNNER_MAX_IDENTICAL_TOOL_TURNS=6 63 64# ── Tools ───────────────────────────────────────────────────────────────────── 65# Max bytes accepted by image_tool before rejecting the file. 66IMAGE_TOOL_MAX_BYTES=150000 67# Override the image directory exposed to the agent. 68# Default: /home/$NIRI_USER/images with Docker, ./home/images with local shell. 69IMAGE_ROOT= 70 71# ── Discord ─────────────────────────────────────────────────────────────────── 72DISCORD_BOT_TOKEN= 73# Optional — auto-detected from the gateway on first connect if left blank. 74DISCORD_BOT_USER_ID= 75# Enable the built-in gateway listener (messageCreate → ingest pipeline). 76DISCORD_GATEWAY_ENABLED=true 77# Log every ingest decision (verbose, for debugging). 78DISCORD_GATEWAY_TRACE=false 79# Also ingest raw MESSAGE_CREATE packets — recommended for DM reliability. 80DISCORD_GATEWAY_RAW_FALLBACK=true 81# Comma-separated channel IDs scanned by discord_scan when no channel_ids arg is passed. 82DISCORD_SCAN_CHANNEL_IDS= 83# Wake the agent immediately on any new Discord event (leave false to avoid spam). 84DISCORD_WAKE_ON_EVENT=false 85# Wake immediately on DMs even when DISCORD_WAKE_ON_EVENT is false. 86DISCORD_WAKE_ON_DM=true 87# How often to batch pending Discord events into a single harness message. 88DISCORD_BATCH_INTERVAL_MS=60000 89# Restrict batch digests to configured scan channels + DMs (recommended). 90DISCORD_BATCH_ONLY_CONFIGURED=true 91# Auto-demote pending inbox items to seen after N minutes (0 = disabled). 92DISCORD_PENDING_AUTO_SEEN_MINUTES=10 93# Include a channel scan snapshot in each batch payload. 94DISCORD_BATCH_SCAN=true 95# Max messages included in a single batch digest. 96DISCORD_BATCH_MAX_MESSAGES=40