Configuration

Athyr is configured via a YAML file. By default, it looks for athyr.yaml in the current directory or /etc/athyr/.

Minimal Configuration

Athyr works with sensible defaults. A minimal config just needs LLM backends:

llm:
  backends:
    - name: local
      type: ollama
      url: http://localhost:11434

Full Configuration Reference

# Server ports
server:
  grpc_port: 9090
  http_port: 8080

# Storage settings
storage:
  data_dir: ./data
  max_memory: 2GB
  max_storage: 50GB
  retention:
    sessions: 24h
    agents: 168h
    responses: 5m

# LLM provider configuration
llm:
  backends:
    - name: local
      type: ollama
      url: http://localhost:11434
    - name: cloud
      type: openrouter
      url: https://openrouter.ai/api/v1
      api_key: ${OPENROUTER_API_KEY}
  retry:
    max_attempts: 3
    backoff: exponential

# Memory session defaults
memory:
  default_profile: rolling_window
  max_tokens: 4096
  summarization_threshold: 3000

# Agent lifecycle settings
agents:
  heartbeat_interval: 30s
  disconnect_timeout: 60s

Configuration Sections

server

API server settings.

FieldDefaultDescription
grpc_port9090Port for gRPC API
http_port8080Port for HTTP API

storage

Data persistence settings.

FieldDefaultDescription
data_dir./dataDirectory for persistent data
max_memory2GBMaximum memory for caching
max_storage50GBMaximum disk storage

storage.retention

Automatic cleanup policies.

FieldDefaultDescription
sessions24hHow long to keep inactive sessions
agents168hHow long to keep disconnected agent records
responses5mHow long to keep streaming response data

Set to 0 to disable automatic cleanup.

llm

LLM gateway configuration.

llm.backends

List of LLM providers. Each backend has:

FieldRequiredDescription
nameYesUnique identifier
typeYesProvider type (matches Lua script filename, e.g. ollama, openrouter, or custom)
urlYesProvider API URL
api_keyNoAPI key (required for OpenRouter)
priorityNoRouting priority (lower = preferred)

llm.retry

Retry behavior for failed LLM requests.

FieldDefaultDescription
max_attempts3Maximum retry attempts
backoffexponentialStrategy: exponential, linear, fixed

memory

Default settings for memory sessions.

FieldDefaultDescription
default_profilerolling_windowMemory strategy
max_tokens4096Default max context tokens
summarization_threshold3000Token count to trigger summarization

agents

Agent lifecycle settings.

FieldDefaultDescription
heartbeat_interval30sHow often agents send heartbeats
disconnect_timeout60sTime without heartbeat before disconnect

Environment Variables

Use ${VAR_NAME} syntax to reference environment variables:

llm:
  backends:
    - name: cloud
      type: openrouter
      api_key: ${OPENROUTER_API_KEY}

Config File Locations

Athyr searches for configuration in order:

  1. Path specified by --config flag
  2. ./athyr.yaml (current directory)
  3. /etc/athyr/athyr.yaml

If no config file is found, Athyr uses defaults.

Size Values

Storage sizes support human-readable units:

Examples: 512MB, 2GB, 50GB

Duration Values

Time durations use Go duration format:

Examples: 30s, 5m, 24h, 168h

Next Steps