anna
Getting Started

Configuration

Config file: ~/.anna/config.yaml

The workspace root defaults to ~/.anna/workspace and can be changed by setting the ANNA_HOME environment variable. Session, memory, skills, cron data, and runtime state all live under the workspace root. The model cache lives in ~/.anna/cache/.

Full Reference

# Provider credentials and metadata
providers:
  anthropic:
    api_key: "sk-..."
    base_url: ""                   # Optional URL override
    models:                        # Optional model metadata
      - id: claude-sonnet-4-6
        name: "Claude Sonnet"
        reasoning: false           # Supports extended thinking
        input: ["text", "image"]   # Input modalities
        context_window: 200000
        max_tokens: 8192
        headers: {}                # Custom HTTP headers
        cost:
          input: 3.0               # Per-million-token pricing
          output: 15.0
          cache_read: 0.3
          cache_write: 3.75
  openai:
    api_key: "sk-..."
    base_url: "https://api.openai.com/v1"
  openai-response:                 # OpenAI-compatible APIs (e.g. Perplexity)
    api_key: "sk-..."
    base_url: "https://api.example.com/v1"

# Channel configuration
channels:
  telegram:
    enabled: true                  # Enable/disable this channel (default: true)
    enable_notify: false           # Allow notify tool to send to this channel (default: false)
    token: "BOT_TOKEN"
    notify_chat: "123456789"       # Chat ID for notifications (use /whoami)
    channel_id: "@my_channel"      # Optional broadcast channel
    group_mode: "mention"          # mention | always | disabled
    allowed_ids:                   # Restrict to these user IDs (use /whoami, empty = all)
      - 136345060
  qq:
    enabled: true                  # Enable/disable this channel (default: true)
    enable_notify: false           # Allow notify tool to send to this channel (default: false)
    app_id: "QQ_BOT_APP_ID"
    app_secret: "QQ_BOT_APP_SECRET"
    group_mode: "mention"          # mention | always | disabled
    allowed_ids: []                # User OpenIDs allowed (use /whoami, empty = all)
  feishu:
    enabled: true                  # Enable/disable this channel (default: true)
    enable_notify: false           # Allow notify tool to send to this channel (default: false)
    app_id: "FEISHU_APP_ID"
    app_secret: "FEISHU_APP_SECRET"
    encrypt_key: ""                # Event encrypt key (from developer console)
    verification_token: ""         # Event verification token (from developer console)
    notify_chat: "oc_xxx"          # Chat or open_id for notifications (use /whoami)
    group_mode: "mention"          # mention | always | disabled
    allowed_ids: []                # User open_ids allowed (use /whoami, empty = all)

# Default LLM provider
provider: anthropic
# Default model ID
model: claude-sonnet-4-6
# Tiered models (optional)
# Each tier falls back independently to model when not set
model_strong: claude-opus-4-6
model_fast: claude-haiku-4-5
# Workspace root (default: ANNA_HOME or ~/.anna/workspace)
workspace: "~/.anna/workspace"

# Runner settings
runner:
  type: go                       # Runner implementation (only "go" currently)
  system: ""                     # Custom system prompt (bypasses default builder)
  idle_timeout: 10               # Minutes before reaping idle runners
  compaction:
    max_tokens: 80000            # Auto-compact when history exceeds this
    keep_tail: 20                # Keep N recent messages after compaction

# Scheduled tasks
cron:
  enabled: true
  data_dir: "~/.anna/workspace/cron"  # Job persistence directory

# Heartbeat polling
heartbeat:
  enabled: false
  every: 10m
  file: "HEARTBEAT.md"                # Relative to workspace unless absolute

Heartbeat only runs in anna gateway. Each tick first uses the fast model to decide skip vs run, and only run decisions are sent into the main heartbeat session and then delivered through the notifier.

Directory Layout

PathPurposeCategory
~/.anna/config.yamlStatic configuration (user-edited)Config
~/.anna/workspace/state.yamlRuntime state: current provider/model (program-managed)State
~/.anna/cache/models.jsonCached model list (safe to delete)Cache
~/.anna/workspace/SOUL.mdAgent identity, personalityData
~/.anna/workspace/USER.mdUser preferences, contextData
~/.anna/workspace/memory.dbMemory database (message history, summaries)Data
~/.anna/workspace/skills/Installed skillsData
~/.anna/workspace/cron/Cron job persistenceData
~/.anna/workspace/HEARTBEAT.mdHeartbeat instructionsData
  • config.yaml is static and user-edited — safe to version control.
  • state.yaml is written by anna models set and the /model command. It overrides provider and model from config.yaml.
  • cache/ contains regenerable data. Run anna models update to rebuild.
  • workspace/ contains all persistent application data.

Environment Variable Overrides

All config fields support env var overrides using the ANNA_ prefix. Nested structs add their own prefix segment (e.g. runner.typeANNA_RUNNER_TYPE).

Priority order (highest wins): env vars → state.yaml → config.yaml → defaults.

VariableOverridesNotes
ANNA_HOMEanna home directoryDefault ~/.anna
ANNA_PROVIDERprovider
ANNA_MODELmodel
ANNA_MODEL_STRONGmodel_strong
ANNA_MODEL_FASTmodel_fast
ANNA_WORKSPACEworkspace
ANNA_RUNNER_TYPErunner.type
ANNA_RUNNER_IDLE_TIMEOUTrunner.idle_timeout
ANNA_CRON_ENABLEDcron.enabled
ANNA_CRON_DATA_DIRcron.data_dir
ANNA_HEARTBEAT_ENABLEDheartbeat.enabled
ANNA_HEARTBEAT_EVERYheartbeat.everyGo duration such as 10m
ANNA_HEARTBEAT_FILEheartbeat.fileRelative to workspace unless absolute
ANNA_TELEGRAM_ENABLEDchannels.telegram.enabled
ANNA_TELEGRAM_ENABLE_NOTIFYchannels.telegram.enable_notify
ANNA_TELEGRAM_TOKENchannels.telegram.token
ANNA_TELEGRAM_NOTIFY_CHATchannels.telegram.notify_chat
ANNA_TELEGRAM_CHANNEL_IDchannels.telegram.channel_id
ANNA_TELEGRAM_GROUP_MODEchannels.telegram.group_mode
ANNA_TELEGRAM_ALLOWED_IDSchannels.telegram.allowed_idsComma-separated
ANNA_QQ_ENABLEDchannels.qq.enabled
ANNA_QQ_ENABLE_NOTIFYchannels.qq.enable_notify
ANNA_QQ_APP_IDchannels.qq.app_id
ANNA_QQ_APP_SECRETchannels.qq.app_secret
ANNA_QQ_GROUP_MODEchannels.qq.group_mode
ANNA_QQ_ALLOWED_IDSchannels.qq.allowed_idsComma-separated
ANNA_FEISHU_ENABLEDchannels.feishu.enabled
ANNA_FEISHU_ENABLE_NOTIFYchannels.feishu.enable_notify
ANNA_FEISHU_APP_IDchannels.feishu.app_id
ANNA_FEISHU_APP_SECRETchannels.feishu.app_secret
ANNA_FEISHU_ENCRYPT_KEYchannels.feishu.encrypt_key
ANNA_FEISHU_VERIFICATION_TOKENchannels.feishu.verification_token
ANNA_FEISHU_NOTIFY_CHATchannels.feishu.notify_chat
ANNA_FEISHU_GROUP_MODEchannels.feishu.group_mode
ANNA_FEISHU_ALLOWED_IDSchannels.feishu.allowed_idsComma-separated
ANTHROPIC_API_KEYproviders.anthropic.api_keyStandard provider env
ANTHROPIC_BASE_URLproviders.anthropic.base_urlStandard provider env
OPENAI_API_KEYproviders.openai.api_keyAlso used by openai-response
OPENAI_BASE_URLproviders.openai.base_urlAlso used by openai-response

Defaults

FieldDefault
provideranthropic
modelclaude-sonnet-4-6
workspace~/.anna/workspace
runner.typego
runner.idle_timeout10 (minutes)
runner.compaction.max_tokens80000
runner.compaction.keep_tail20
cron.enabledtrue
cron.data_dir~/.anna/workspace/cron
heartbeat.enabledfalse
heartbeat.every10m
heartbeat.file~/.anna/workspace/HEARTBEAT.md
channels.telegram.enabledtrue
channels.telegram.enable_notifyfalse
channels.telegram.group_modemention
channels.qq.enabledtrue
channels.qq.enable_notifyfalse
channels.qq.group_modemention
channels.feishu.enabledtrue
channels.feishu.enable_notifyfalse
channels.feishu.group_modemention

Memory Defaults

Lossless Context Management settings are currently hardcoded defaults. They will become configurable in a future release.

SettingDefaultDescription
Database path{workspace}/memory.dbSQLite database for the message DAG
Fresh tail count20Number of recent messages kept verbatim in context
Context threshold0.75Fraction of context window that triggers compaction
Leaf chunk size10Number of messages grouped per leaf summary

On this page