swarms chat command provides an interactive chat agent with optimized defaults for conversational interactions. The agent runs with max_loops="auto" for continuous interaction, similar to Claude Code.
Features
- Interactive Loop: The CLI keeps prompting for the next task after each response, giving a continuous conversation
- Auto Loops: Runs with
max_loops="auto"for autonomous operation - Dynamic Context Window:
dynamic_context_window=True— adjusts context handling automatically - Dynamic Temperature: Adapts temperature based on conversation
- Optional Initial Task: Start with a task or begin with a prompt
Basic Usage
Start Chat Without Initial Task
Start Chat With Initial Task
Advanced Usage
Custom Agent Name
Custom System Prompt
Full Customization
Using Python Module Directly
You can also run the chat command directly with Python:How It Works
-
The chat agent initializes with optimized settings:
max_loops="auto"- Autonomous loop executiondynamic_context_window=True- Adaptive context managementdynamic_temperature_enabled=True- Adaptive response generation
interactive=Trueor an explicitcontext_length. -
If you provide a
--task, the agent processes it first - After processing, the agent continues to prompt for input
- You can continue the conversation interactively
- Exit by typing ‘exit’, ‘quit’, or pressing Ctrl+C
Examples
Quick Question
Extended Conversation
Code Review Session
Tips
- Use
--system-promptto customize the agent’s behavior and expertise - Provide a
--taskto start with context before interactive mode - The agent remembers conversation history within the session
- All standard agent parameters are available for customization
Troubleshooting
If you encounter the errorauto_chat_agent() got an unexpected keyword argument 'interactive', ensure you’re using the latest version of Swarms where this has been fixed.