Modes

JiuwenSwarm supports multiple runtime modes, each with its own tool set, permission policy, and memory behavior. Users can switch modes during a conversation using the /mode command.


Mode Overview

Mode Code Description
Agent (Plan) agent.plan Default mode. Full tools + proactive memory, focused on reasoning and planning
Agent (Fast) agent.fast Full tools + passive memory, focused on quick responses
Code (Plan) code.plan Code mode + coding memory, focused on code generation planning
Code (Normal) code.normal Code mode + coding memory, focused on code execution
Team team Multi-agent collaboration mode, based on the team definition in config

Switching Modes

Use the following commands during a channel conversation:

/mode agent          # Switch to Agent mode (defaults to agent.plan)
/mode code           # Switch to Code mode (defaults to code.normal)
/mode team           # Switch to Team mode
/mode agent.plan     # Switch directly to Agent Plan sub-mode
/mode agent.fast     # Switch directly to Agent Fast sub-mode
/mode code.plan      # Switch directly to Code Plan sub-mode
/mode code.normal    # Switch directly to Code Normal sub-mode

You can also use /switch to change sub-modes within the same category:

/switch plan         # Under Agent → plan; under Code → plan
/switch fast         # Under Agent → fast
/switch normal       # Under Code → normal

Configuration

Define mode tools and constraints in the modes section of config/config.yaml:

modes:
  agent:
    fast:
      memory:
        enabled: true
        is_proactive: false     # Passive memory
      rails: []
      tools: []
    plan:
      memory:
        enabled: true
        is_proactive: true      # Proactive memory
      rails: []
      tools: []

  code:
    rails:
      - FileSystemRail           # File system safety rails
      - SkillUseRail             # Skill invocation rails
      - LspRail                  # LSP assistance rails
    tools:
      - web_free_search
      - web_fetch_webpage
      - web_paid_search
      - user_todos
    embedding_config:
      model_name: null
      base_url: null
      api_key: null

  team:
    jiuwen_team:
      team_name: jiuwen_team
      lifecycle: persistent
      teammate_mode: build_mode
      spawn_mode: inprocess
      leader:
        member_name: team_leader
        display_name: Team Leader
        persona: "Expert project manager, skilled at task decomposition and team coordination"
      agents:
        leader:
          workspace:
            stable_base: true
          max_iterations: 200
          completion_timeout: 600.0
      workspace:
        enabled: true
      transport:
        type: inprocess
      storage:
        type: sqlite

Section Reference

Path Description
modes.agent.fast Agent Fast mode: passive memory, no extra rails
modes.agent.plan Agent Plan mode: proactive memory, no extra rails
modes.code.rails Dynamic safety rails for Code mode (fixed rails are hardcoded)
modes.code.tools Dynamic tool whitelist for Code mode (coding_memory_* and send_file_to_user are registered at runtime)
modes.code.embedding_config Code-mode-specific embedding config (empty = use global)
modes.team.<name> Team mode definition: team name, lifecycle, leader/agents config

Channel Default Mode

Each channel can specify a default mode via channels.<channel>.default_mode in config.yaml:

channels:
  web:
    enabled: true
    default_mode: agent.plan    # This channel defaults to Agent Plan mode

Mode Behavior Differences

Behavior Agent (plan) Agent (fast) Code Team
Tool set All tools All tools Whitelisted + coding memory Per-team config
Memory strategy Proactive (auto read/write) Passive (on-demand) Coding memory Per-team config
Safety rails None extra None extra FileSystemRail + SkillUseRail + LspRail Per-team config
Iteration limit react.max_iterations react.max_iterations react.max_iterations Leader can set max_iterations

See Also