This repository has no description
1# ── Primary model (OpenAI-compatible) ────────────────────────────────────────
2OPENAI_BASE_URL=https://api.openai.com/v1
3OPENAI_API_KEY=
4MODEL=
5# Optional User-Agent override for all OpenAI-compatible clients.
6# Provider-specific *_OPENAI_USER_AGENT values override this default.
7OPENAI_USER_AGENT=
8# Enable/disable model reasoning traces (thinking) across requests + stream output.
9ENABLE_THINKING=true
10
11# ── Primary model (Anthropic Messages API) ───────────────────────────────────
12# Set USE_ANTHROPIC=true to route primary requests through Anthropic's Messages API
13# instead of an OpenAI-compatible endpoint. When enabled, OPENAI_API_KEY and MODEL
14# are not required for the primary provider.
15USE_ANTHROPIC=false
16ANTHROPIC_BASE_URL=https://api.anthropic.com/v1
17ANTHROPIC_API_KEY=
18ANTHROPIC_MODEL=
19ANTHROPIC_MAX_TOKENS=8192
20ANTHROPIC_VERSION=2024-10-22
21# Budget tokens for Anthropic extended thinking (≥1024, < max_tokens). Only used when ENABLE_THINKING=true.
22ANTHROPIC_THINKING_BUDGET=4096
23
24# ── Memory embeddings ────────────────────────────────────────────────────────
25# Used for semantic memory reranking and low-information chatter suppression.
26# The sqlite-vec table is fixed at 3072 dimensions; changing dimensions requires
27# deleting/rebuilding memory_chunk_vec, memory_prototype_vec, and embedding meta.
28EMBEDDING_API_KEY=
29EMBEDDING_BASE_URL=https://openrouter.ai/api/v1
30EMBEDDING_MODEL=google/gemini-embedding-2-preview
31EMBEDDING_DIMENSIONS=3072
32EMBEDDING_OPENAI_USER_AGENT=
33
34# Used when the primary endpoint is unreachable or rate-limited (429/5xx).
35# Supports any OpenAI-compatible provider (OpenRouter, LM Studio, etc.).
36FALLBACK_OPENAI_BASE_URL=http://localhost:1234/v1
37FALLBACK_OPENAI_API_KEY=
38FALLBACK_MODEL=
39# Tool call policy for fallback requests: required, auto, none
40FALLBACK_TOOL_CHOICE=required
41# Optional headers
42FALLBACK_OPENAI_REFERER=
43FALLBACK_OPENAI_TITLE=
44FALLBACK_OPENAI_USER_AGENT=
45# Optional summary provider User-Agent override when SUMMARY_* provider is configured.
46SUMMARY_OPENAI_USER_AGENT=
47# Context window enforcement for fallback. Defaults to true for localhost, false otherwise.
48FALLBACK_ENFORCE_CONTEXT_LIMIT=
49FALLBACK_N_CTX=4096
50FALLBACK_CONTEXT_MARGIN=256
51FALLBACK_HARD_OVERFLOW_TOKENS=1024
52
53# Set to "local" to skip the primary model and route all requests to the fallback.
54NIRI_ENV=default
55
56# Display name for the agent, used in the summarizer prompt and grounding context.
57# Defaults to "niri" when unset.
58# AGENT_NAME=niri
59# Stable worker id reported to the control panel.
60# NIRI_AGENT_ID=niri
61
62# Leave unset for raw local shell access. Set both values to route shell tools
63# through docker exec instead; NIRI_USER must match the Dockerfile user.
64# NIRI_USER=niri
65# NIRI_CONTAINER=niri
66# UID/GID the container process runs as — match your host user to avoid permission issues.
67# On Linux this is usually `id -u` / `id -g` (often 1000:1000).
68AGENT_UID=1000
69AGENT_GID=1000
70
71PORT=3000
72# Used by the chat CLI to connect. Include the scheme, exclude the port.
73NIRI_HOST=http://localhost
74
75# ── Context & token limits ────────────────────────────────────────────────────
76TOKEN_NUDGE_THRESHOLD=120000
77FALLBACK_TOKEN_NUDGE_THRESHOLD=50000
78CONTEXT_COMPACT_TARGET_TOKENS=65000
79CONTEXT_COMPACT_TRIGGER_TOKENS=90000
80CONTEXT_COMPACT_RECENT_MESSAGES=80
81CONTEXT_COMPACT_CHUNK_MESSAGES=32
82CONTEXT_COMPACT_SUMMARY_MAX_CHARS=16000
83
84# ── Runner safety guardrails ──────────────────────────────────────────────────
85# Hard cap on assistant turns in a single wake cycle.
86RUNNER_MAX_TURNS=120
87# Stop if the same assistant tool call + result pattern repeats.
88RUNNER_MAX_IDENTICAL_TOOL_TURNS=6
89
90# ── Tools ─────────────────────────────────────────────────────────────────────
91# Max bytes accepted by image_tool before rejecting the file.
92IMAGE_TOOL_MAX_BYTES=150000
93# Override the image directory exposed to the agent.
94# Default: /home/$NIRI_USER/images with Docker, ./home/images with local shell.
95IMAGE_ROOT=
96
97# ── Discord ───────────────────────────────────────────────────────────────────
98DISCORD_BOT_TOKEN=
99# Optional — auto-detected from the gateway on first connect if left blank.
100DISCORD_BOT_USER_ID=
101# Enable the built-in gateway listener (messageCreate → ingest pipeline).
102DISCORD_GATEWAY_ENABLED=true
103# Log every ingest decision (verbose, for debugging).
104DISCORD_GATEWAY_TRACE=false
105# Also ingest raw MESSAGE_CREATE packets — recommended for DM reliability.
106DISCORD_GATEWAY_RAW_FALLBACK=true
107# Comma-separated channel IDs scanned by discord_scan when no channel_ids arg is passed.
108DISCORD_SCAN_CHANNEL_IDS=
109# Wake the agent immediately on any new Discord event (leave false to avoid spam).
110DISCORD_WAKE_ON_EVENT=false
111# Wake immediately on DMs even when DISCORD_WAKE_ON_EVENT is false.
112DISCORD_WAKE_ON_DM=true
113# How often to batch pending Discord events into a single harness message.
114DISCORD_BATCH_INTERVAL_MS=60000
115# Restrict batch digests to configured scan channels + DMs (recommended).
116DISCORD_BATCH_ONLY_CONFIGURED=true
117# Auto-demote pending inbox items to seen after N minutes (0 = disabled).
118DISCORD_PENDING_AUTO_SEEN_MINUTES=10
119# Include a channel scan snapshot in each batch payload.
120DISCORD_BATCH_SCAN=true
121# Max messages included in a single batch digest.
122DISCORD_BATCH_MAX_MESSAGES=40