Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agtos.ai/llms.txt

Use this file to discover all available pages before exploring further.

agtOS reads configuration from environment variables, with optional file-based config as a fallback. Environment variables always take precedence over config file values.

Configuration Loading Order

1

Load .env.local

Secrets and local overrides. Never committed to git.
2

Load .env

Shared defaults. Can be committed to git.
3

Load JSON config file

~/.agtos/config.json (desktop/user default) or /etc/agtos/config.json (system default), or the path in AGTOS_CONFIG_PATH. Only fills gaps not covered by env vars.
Environment variables set in .env.local or .env override the JSON config file. The JSON file is useful for Docker deployments and for storing model slot configuration.
~/.agtos/config.json
{
  "REDIS_URL": "redis://redis:6379",
  "LOG_LEVEL": "info",
  "slots": {
    "chat": { "provider": "claude", "model": "claude-sonnet-4-20250514" }
  }
}

Server Ports

VariableDefaultDescription
VOICE_PORT3000Voice pipeline WebSocket server (audio streaming, signaling)
PORT3000Alias for VOICE_PORT
MCP_PORT4100MCP server (Streamable HTTP)
HEALTH_PORT4102Health endpoints, REST API, metrics, and dashboard
The Tauri desktop app and web dashboard connect to the same ports via localhost. The health port serves the REST API, Prometheus metrics, static dashboard files, and health checks.

Authentication

Claude / Anthropic

VariableDefaultDescription
ANTHROPIC_API_KEYAPI key (sk-ant-api03- prefix). Pay-per-token billing from console.anthropic.com.
CLAUDE_API_KEYLegacy alias for ANTHROPIC_API_KEY
ANTHROPIC_BASE_URLhttps://api.anthropic.comCustom API endpoint (for proxies or CLI transport)

OpenAI

VariableDefaultDescription
OPENAI_API_KEYOpenAI API key (sk- prefix). Pay-per-token billing from platform.openai.com.
OPENAI_BASE_URLhttps://api.openai.com/v1Custom OpenAI API endpoint (for proxies or compatible APIs)
OPENAI_MODELgpt-4oDefault OpenAI model for chat completions
OPENAI_MAX_TOKENS4096Maximum output tokens for OpenAI responses
OPENAI_TEMPERATURE0.7Sampling temperature for OpenAI (0.0—2.0)

Claude Transport

VariableDefaultDescription
AGTOS_CLAUDE_TRANSPORTsdkClaude transport mode: sdk (direct API) or cli (spawn claude CLI binary)
Cloud provider selection (Claude vs OpenAI) is no longer configured via environment variable. It is now set per slot in ~/.agtos/config.json via the Model Slot Registry (ADR-020). Run agtos setup to configure slots interactively.
See Authentication and Providers for detailed setup instructions.

API Security

VariableDefaultDescription
AGTOS_API_KEY— (disabled)When set, all /api/* routes require Authorization: Bearer <key>. When unset, endpoints are open.
API_RATE_LIMIT100Max API requests per minute per client IP
CHAT_RATE_LIMIT20Max chat/task requests per minute per client IP
In production, always set AGTOS_API_KEY to protect the REST API. Without it, all endpoints are unauthenticated.

Claude Options

VariableDefaultDescription
CLAUDE_MODELclaude-sonnet-4-20250514Model for cloud inference via the model router
CLAUDE_THINKING— (SDK default)Adaptive thinking mode: adaptive, enabled, disabled
CLAUDE_EFFORT— (SDK default)Effort level: low, medium, high, max (max = Opus 4.6 only)
CLAUDE_SERVICE_TIER— (SDK default)Service tier: auto (priority if available), standard_only
CLAUDE_AGENT_MODELclaude-haiku-4-5-20251001Model for Agent SDK credential validation
CLAUDE_CLI_PATH— (auto-detect)Explicit path to claude CLI binary

Ollama Options

VariableDefaultDescription
OLLAMA_HOSThttp://localhost:11434Ollama API server URL
OLLAMA_DEFAULT_MODELqwen3:4bModel for local query execution (Tier 2)
OLLAMA_INTENT_MODELqwen3:1.7bSmall model for intent classification (Tier 1)
OLLAMA_URLhttp://localhost:11434Alias used by credential validation

STT / TTS

VariableDefaultDescription
SPEACHES_URLhttp://localhost:8000speaches server base URL (shared by STT and TTS)
STT_PROVIDERsherpa-onnxSTT provider name
SPEACHES_STT_MODELSystran/faster-whisper-smallFaster Whisper model for transcription
TTS_PROVIDERsherpa-onnxTTS provider name
SPEACHES_TTS_MODELspeaches-ai/Kokoro-82M-v1.0-ONNXKokoro model for speech synthesis
SPEACHES_TTS_VOICEaf_heartDefault TTS voice ID

sherpa-onnx (In-Process Speech Engine)

sherpa-onnx is the default provider. These variables tune its behavior. Set STT_PROVIDER=speaches or TTS_PROVIDER=speaches to use the external server instead.

STT Configuration

VariableDefaultDescription
STT_PROVIDERsherpa-onnxDefault in-process engine. Set to speaches for external server
SHERPA_STT_MODELmoonshine-tiny-en-int8STT model ID
SHERPA_STT_STREAMING_MODELzipformer-streaming-en-20mStreaming STT model ID
SHERPA_STT_NUM_THREADS4ONNX Runtime inference threads
SHERPA_STT_PROVIDERcpuExecution provider (cpu, cuda, coreml)
SHERPA_STT_LANGUAGEenDefault language
SHERPA_STT_TIMEOUT_MS30000Inference timeout in milliseconds
SHERPA_STT_TIMESTAMPStrueEnable word-level timestamps in transcription
SHERPA_STT_ENDPOINTtrueEnable endpoint detection (auto-detect end of speech in streaming)

TTS Configuration

VariableDefaultDescription
TTS_PROVIDERsherpa-onnxDefault in-process engine. Set to speaches for external server
SHERPA_TTS_MODELkokoro-int8-multi-v1TTS model ID
SHERPA_TTS_VOICEaf_heartDefault voice
SHERPA_TTS_SPEED1.0Speech speed (0.5-2.0)
SHERPA_TTS_NUM_THREADS2ONNX Runtime threads per TTS instance
SHERPA_TTS_POOL_SIZE3Concurrent TTS instances
SHERPA_TTS_POOL_TIMEOUT_MS30000Timeout for acquiring a TTS instance from the pool
SHERPA_TTS_TIMEOUT_MS30000Per-request TTS inference timeout
SHERPA_TTS_MAX_SENTENCES99Maximum sentences per synthesis batch

VAD Configuration

VariableDefaultDescription
SHERPA_VAD_MODELsilero-vadVAD model ID
SHERPA_VAD_THRESHOLD0.3Speech detection threshold (0.0-1.0)
SHERPA_VAD_MIN_SPEECH0.25Minimum speech duration (seconds)
SHERPA_VAD_MIN_SILENCE0.5Silence gap to end segment (seconds)
SHERPA_VAD_MAX_SPEECH20Maximum segment before split (seconds)
SHERPA_VAD_WINDOW_SIZE512Audio frame size for VAD processing
SHERPA_VAD_NUM_THREADS1CPU threads for VAD inference
SHERPA_VAD_BUFFER_SECONDS60Audio history buffer size (seconds)

Model Storage

VariableDefaultDescription
AGTOS_MODEL_DIR~/.agtos/modelsLocal directory for ONNX model files
AGTOS_ORT_RUNTIME_DIR— (dev: unused)Absolute path to bundled ONNX Runtime binaries. Set automatically by the Tauri sidecar in desktop builds. In development, leave unset — onnxruntime-node resolves from node_modules.

Voice Pipeline

VariableDefaultDescription
COMMAND_PROVIDERmodel-routerLLM provider for the voice pipeline: model-router, claude, or ollama

Cognitive Task Providers

These variables configure independent provider selection for specialized AI tasks (ADR-018). Each task can use a different provider (ollama, claude, or openrouter), allowing you to optimize cost, quality, and privacy per task.
VariableDefaultDescription
AGTOS_EMBEDDING_PROVIDERollamaEmbedding provider (ollama for local, openrouter for cloud)
AGTOS_EMBEDDING_MODELnomic-embed-textEmbedding model
AGTOS_CLASSIFIER_PROVIDERollamaIntent classification provider
AGTOS_CLASSIFIER_MODEL— (uses Ollama default)Intent classification model
AGTOS_CONSOLIDATION_PROVIDERMemory consolidation (Dreamer) provider
AGTOS_CONSOLIDATION_MODELMemory consolidation model
AGTOS_REASONING_PROVIDERUser reasoning (Dialectic) provider
AGTOS_REASONING_MODELUser reasoning model
AGTOS_SUMMARIZATION_PROVIDERConversation summarization provider
AGTOS_SUMMARIZATION_MODELConversation summarization model
OPENROUTER_API_KEYOpenRouter API key (required when using openrouter provider for any task)
OPENROUTER_HTTP_REFERERAttribution header for the OpenRouter leaderboard. Optional.
OPENROUTER_X_TITLEagtOSApp name header sent to OpenRouter for attribution.
These settings are also configurable at runtime via PUT /api/settings. Changes to provider settings require a provider restart to take effect.

Memory Maintenance

These variables control the periodic memory lint sweep and its background-work gating (ADR-021, ADR-027). See Memory System for the user-facing description.
VariableDefaultDescription
AGTOS_MAINTENANCE_ENABLEDtrueKill switch for memory maintenance. Set to false to disable both auto-registered and manually-created schedules, plus any direct event publishes on memory.maintenance.
AGTOS_MAINTENANCE_SCHEDULE0 3 * * *Cron expression for the auto-registered memory-maintenance task.
AGTOS_MAINTENANCE_TIMEZONEUTCIANA timezone (e.g., America/New_York) used to evaluate the maintenance cron expression. Validated via Intl.DateTimeFormat at startup.
AGTOS_BACKGROUND_WORK_POLICYautoResourceGuard policy: auto (default — runs all checks), always (skip all checks; dedicated GPU hosts), idle-only (stricter 0.3×CPU load threshold; POSIX only).
AGTOS_NLI_ENABLEDtrueKill switch for the NLI cross-encoder (Stage 2) in the 3-stage contradiction pipeline. When false, Stage 2 is skipped and Stage 3 (LLM judge) receives the full candidate list from Stage 1 directly.
AGTOS_NLI_MODEL_SIZEbaseDeBERTa-v3 model variant for the Stage 2 cross-encoder: xsmall, small, base, or disabled. Requires server restart.
AGTOS_NLI_CONTRADICTION_THRESHOLD0.7Softmax confidence floor for the NLI contradiction verdict (0.0–1.0). Higher values = fewer false positives. Takes effect immediately.
AGTOS_PAIR_CACHE_TTL_SECONDS604800Redis TTL for NLI pair classification cache (default 7 days). Takes effect immediately.
AGTOS_MCP_SERVERSJSON string describing external MCP servers to connect at startup. Malformed JSON logs a warning and proceeds with no servers.

Provider Catalog

These variables control model discovery and caching for the ProviderCatalog system (ADR-026).
VariableDefaultDescription
AGTOS_PROVIDER_CATALOG_CACHE_TTL_SECONDS3600Catalog model-list cache expiry in seconds (default 1 hour). Lower values give fresher model lists but increase upstream API calls. Takes effect immediately.
AGTOS_PROVIDER_CATALOG_AUTO_REFRESHtrueEnable background refresh of cached provider catalogs. Set to false to only fetch catalogs on demand. Requires provider restart.

Redis

VariableDefaultDescription
REDIS_URLredis://localhost:6379Redis connection URL. Used for sessions, memory, scheduler, events, devices, and preferences.
REDIS_HOSTAlternative to REDIS_URL (host component)
REDIS_PORTAlternative to REDIS_URL (port component)
REDIS_PASSWORDRedis auth password (if using authenticated Redis)
Redis is optional but recommended. Without it, the scheduler, episodic/semantic memory, device registry, and user preferences are disabled. Session management falls back to in-memory storage.

Networking

VariableDefaultDescription
CORS_ORIGINhttp://localhost:5173Allowed CORS origins (comma-separated). Tauri origins are auto-added.
Tauri 2 desktop app origins (tauri://localhost, https://tauri.localhost) are always included regardless of CORS_ORIGIN.

Logging

VariableDefaultDescription
LOG_LEVELinfo (production), debug (development)Log level: trace, debug, info, warn, error, fatal
NODE_ENVSet to production for JSON structured logging

Feature Flags

VariableDefaultDescription
AGTOS_MDNS_ENABLEDfalseEnable mDNS UDP multicast for ESP32 zero-config discovery

Runtime Configuration (Hot-Reload)

These variables are managed by the Settings API (PUT /api/settings) and the legacy config API (PUT /api/config). They can be changed at runtime without restarting the server.
VariableDefaultReload TypeDescription
AGTOS_TTS_VOICEaf_heartimmediateTTS voice name
AGTOS_TTS_SPEED1.0immediateTTS speech speed (0.5—2.0)
AGTOS_STT_LANGUAGEenprovider-restartSTT language code
AGTOS_STT_MODELmoonshine-tiny-en-int8provider-restartSTT model ID
AGTOS_STT_STREAMING_MODELzipformer-streaming-en-20mprovider-restartStreaming STT model ID
AGTOS_LLM_PROVIDERprovider-restartPrimary LLM provider (claude, ollama, auto)
AGTOS_LLM_MODELprovider-restartLLM model name
AGTOS_API_RATE_LIMITimmediateAPI rate limit per minute (1—1000)
AGTOS_CHAT_RATE_LIMITimmediateChat rate limit per minute (1—100)
AGTOS_MEMORY_SEARCH_MODEhybridimmediateMemory search strategy (hybrid, vector, bm25)
AGTOS_MEMORY_QUERY_EXPANSIONfalseimmediateEnable Ollama-powered query expansion
AGTOS_VAD_THRESHOLD0.3immediateVAD speech detection threshold (0.0—1.0)
AGTOS_VAD_SENSITIVITYimmediateVAD sensitivity preset (low, medium, high)
AGTOS_AUDIO_INPUT_DEVICEprovider-restartAudio input device ID
AGTOS_MEMORY_RETENTION_DAYS30immediateMemory retention in days (1—365)
AGTOS_NOTIFICATIONS_ENABLEDimmediateEnable desktop notifications
AGTOS_PTT_HOTKEYimmediatePush-to-talk hotkey (e.g., Alt+Space)
The API_RATE_LIMIT and CHAT_RATE_LIMIT variables (without the AGTOS_ prefix) are used at server startup. The AGTOS_ prefixed versions are used by the runtime config system for hot-reload. Both control the same behavior — set the non-prefixed versions in .env.local for startup defaults, and use the Settings API to adjust at runtime.

Credentials / Encryption

VariableDefaultDescription
AGTOS_CREDENTIAL_SECRET— (auto-generated)Overrides the machine secret for AES-256-GCM encryption. By default, a 32-byte secret is auto-generated at ~/.agtos/.secret. Set this env var for Docker/CI where filesystem persistence isn’t available.
AGTOS_CREDENTIAL_SALT— (auto-generated)Hex-encoded salt for scrypt key derivation. By default, a 32-byte salt is auto-generated at ~/.agtos/.salt. Set this env var for Docker/CI deployments.
AGTOS_CREDENTIAL_PATH~/.agtos/credentials.jsonPath to the AES-256-GCM encrypted credential file.
Credentials are stored encrypted at ~/.agtos/credentials.json with 0o600 permissions. Key derivation uses scrypt (N=16384, r=8, p=1) with AAD binding per provider. The machine secret (~/.agtos/.secret) and salt (~/.agtos/.salt) are auto-generated on first use. For Docker deployments, set AGTOS_CREDENTIAL_SECRET and AGTOS_CREDENTIAL_SALT as environment variables so credentials persist across container restarts.
Generate values for Docker:
# Generate a credential secret (32 random bytes, hex-encoded)
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

# Generate a salt (32 random bytes, hex-encoded)
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Config File

VariableDefaultDescription
AGTOS_CONFIG_PATH~/.agtos/config.jsonPath to JSON config file. Defaults to ~/.agtos/config.json (desktop) or /etc/agtos/config.json (system). File values fill gaps not covered by env vars.

CLI

VariableDefaultDescription
AGTOS_API_URLhttp://localhost:4102API base URL for the npx agtos CLI tool

Complete .env.local Example

# === Claude Authentication ===
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here

# === OpenAI Authentication (optional) ===
# OPENAI_API_KEY=sk-your-key-here

# === Claude Transport ===
# AGTOS_CLAUDE_TRANSPORT=sdk           # 'sdk' (default) or 'cli'
# Note: Cloud provider selection is now per-slot in ~/.agtos/config.json

# === Claude Options ===
CLAUDE_MODEL=claude-sonnet-4-20250514
CLAUDE_THINKING=adaptive
CLAUDE_EFFORT=medium
CLAUDE_SERVICE_TIER=auto

# === Ollama ===
OLLAMA_HOST=http://localhost:11434
OLLAMA_DEFAULT_MODEL=qwen3:4b
OLLAMA_INTENT_MODEL=qwen3:1.7b

# === sherpa-onnx (in-process, default) ===
STT_PROVIDER=sherpa-onnx
TTS_PROVIDER=sherpa-onnx
SHERPA_STT_MODEL=moonshine-tiny-en-int8
SHERPA_TTS_MODEL=kokoro-int8-multi-v1
SHERPA_TTS_VOICE=af_heart
AGTOS_MODEL_DIR=~/.agtos/models

# === speaches STT/TTS (external server fallback) ===
# STT_PROVIDER=speaches
# TTS_PROVIDER=speaches
# SPEACHES_URL=http://localhost:8000
# SPEACHES_STT_MODEL=Systran/faster-whisper-small
# SPEACHES_TTS_MODEL=speaches-ai/Kokoro-82M-v1.0-ONNX
# SPEACHES_TTS_VOICE=af_heart

# === Voice Pipeline ===
COMMAND_PROVIDER=model-router

# === Redis ===
REDIS_URL=redis://localhost:6379

# === Ports ===
VOICE_PORT=3000
MCP_PORT=4100
HEALTH_PORT=4102

# === Security ===
AGTOS_API_KEY=your-secret-api-key
API_RATE_LIMIT=100
CHAT_RATE_LIMIT=20
AGTOS_CREDENTIAL_SALT=a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6

# === Networking ===
CORS_ORIGIN=http://localhost:5173

# === Logging ===
LOG_LEVEL=info
NODE_ENV=production

# === Features ===
AGTOS_MDNS_ENABLED=false

# === Cognitive Task Providers (optional) ===
# AGTOS_EMBEDDING_PROVIDER=ollama
# AGTOS_EMBEDDING_MODEL=nomic-embed-text
# AGTOS_CLASSIFIER_PROVIDER=ollama
# AGTOS_CONSOLIDATION_PROVIDER=ollama
# AGTOS_REASONING_PROVIDER=ollama
# AGTOS_SUMMARIZATION_PROVIDER=ollama
# OPENROUTER_API_KEY=sk-or-your-key  # Only needed for openrouter provider

Docker Environment

When running with Docker, set variables via docker-compose.yml or docker run -e:
# docker-compose.yml (excerpt)
services:
  agtos:
    environment:
      - REDIS_URL=redis://redis:6379
      - VOICE_PORT=3000
      - MCP_PORT=4100
      - HEALTH_PORT=4102
      - OLLAMA_HOST=http://host.docker.internal:11434
      - SPEACHES_URL=http://host.docker.internal:8000
      - NODE_ENV=production
    env_file:
      - .env.local  # secrets
Use host.docker.internal to reach services running on the Docker host (like Ollama or speaches). On Linux, you may need --network=host or extra Docker config instead.