Interaction modes
RavenClaws offers 17 distinct ways to interact — from one-shot CLI commands to long-running servers, autonomous agents, and library embedding. This guide covers every mode with examples.
1. CLI flags overview
All modes are accessed via the ravenclaws binary. Every flag can also be set via environment variable (see §15).
| Flag | Env var | Default | Description |
|---|---|---|---|
-c, --config | RAVENCLAWS_CONFIG | — | Config file path |
-v, --verbose | RAVENCLAWS_VERBOSE | false | Enable debug logging |
--mode | — | single | Agent mode: single, swarm, supervisor, orchestrate, debate, review-loop, research-synthesize, voting |
-e, --exec | — | — | One-shot command prompt |
-R, --repl | — | false | Interactive REPL |
--provider | RAVENCLAWS_PROVIDER | — | Override LLM provider |
--endpoint | RAVENCLAWS_ENDPOINT | — | Override LLM endpoint |
--model | RAVENCLAWS_MODEL | — | Override model name |
--system-prompt | RAVENCLAWS_SYSTEM_PROMPT | — | Override system prompt |
--require-approval | RAVENCLAWS_REQUIRE_APPROVAL | false | Human-in-the-loop for sensitive tools |
--max-iterations | RAVENCLAWS_MAX_ITERATIONS | 10 | Max agent loop iterations |
--token-budget | RAVENCLAWS_TOKEN_BUDGET | — | Max tokens per run |
--retry-max | RAVENCLAWS_RETRY_MAX | 3 | Max retry attempts |
--retry-base-delay-ms | RAVENCLAWS_RETRY_BASE_DELAY | 100 | Retry base delay (ms) |
--fallback-chain | RAVENCLAWS_FALLBACK_CHAIN | — | Comma-separated provider fallback chain |
--mcp-command | RAVENCLAWS_MCP_COMMAND | — | MCP server command (stdio) |
--mcp-args | RAVENCLAWS_MCP_ARGS | — | MCP server arguments |
--mcp-env | RAVENCLAWS_MCP_ENV | — | MCP server env vars (KEY=VALUE,...) |
--mcp-server | RAVENCLAWS_MCP_SERVER | false | Run as MCP server (stdio) |
--mcp-sse-server | RAVENCLAWS_MCP_SSE_SERVER | false | Run as MCP SSE server |
--mcp-sse-host | RAVENCLAWS_MCP_SSE_HOST | 0.0.0.0 | MCP SSE server host |
--mcp-sse-port | RAVENCLAWS_MCP_SSE_PORT | 8081 | MCP SSE server port |
--serve | RAVENCLAWS_SERVE | false | Run as HTTP server |
--server-host | RAVENCLAWS_SERVER_HOST | — | HTTP server host override |
--server-port | RAVENCLAWS_SERVER_PORT | — | HTTP server port override |
--otel-endpoint | RAVENCLAWS_OTEL_ENDPOINT | — | OTLP gRPC endpoint |
--otel-service-name | RAVENCLAWS_OTEL_SERVICE_NAME | — | OTel service name |
--otel-disabled | RAVENCLAWS_OTEL_DISABLED | false | Disable OTel tracing |
--background | RAVENCLAWS_BACKGROUND | false | Submit background task |
--task-status | RAVENCLAWS_TASK_STATUS | — | Check background task status |
--task-list | RAVENCLAWS_TASK_LIST | false | List all background tasks |
--task-cancel | RAVENCLAWS_TASK_CANCEL | — | Cancel a background task |
--task-resume | RAVENCLAWS_TASK_RESUME | false | Resume incomplete tasks |
--scheduler | RAVENCLAWS_SCHEDULER | false | Run scheduler with triggers |
--webhook-port | RAVENCLAWS_WEBHOOK_PORT | 9090 | Webhook server port |
--eval | RAVENCLAWS_EVAL | — | Run eval suite from config |
--eval-json | RAVENCLAWS_EVAL_JSON | false | Output eval results as JSON |
--heartbeat | RAVENCLAWS_HEARTBEAT | false | Autonomous heartbeat mode |
--heartbeat-goal | RAVENCLAWS_HEARTBEAT_GOAL | — | Heartbeat goal prompt |
--heartbeat-tick-interval | RAVENCLAWS_HEARTBEAT_TICK_INTERVAL | 300 | Heartbeat tick interval (s) |
--heartbeat-max-ticks | RAVENCLAWS_HEARTBEAT_MAX_TICKS | 0 | Max heartbeat ticks (0=unlimited) |
--heartbeat-session | RAVENCLAWS_HEARTBEAT_SESSION | — | Resume heartbeat session ID |
--swarm-topology | RAVENCLAWS_SWARM_TOPOLOGY | star | Swarm topology |
--swarm-max-depth | RAVENCLAWS_SWARM_MAX_DEPTH | 3 | Max swarm recursion depth |
--swarm-max-workers | RAVENCLAWS_SWARM_MAX_WORKERS | 100 | Max swarm workers |
--swarm-dynamic-roles | RAVENCLAWS_SWARM_DYNAMIC_ROLES | false | Enable dynamic role assignment |
--swarm-profiles | RAVENCLAWS_SWARM_PROFILES | — | Worker profiles JSON file |
--swarm-communication | RAVENCLAWS_SWARM_COMMUNICATION | false | Enable inter-agent communication |
--swarm-health-monitoring | RAVENCLAWS_SWARM_HEALTH_MONITORING | false | Enable swarm health monitoring |
--no-final-required | RAVENCLAWS_NO_FINAL_REQUIRED | false | Don't require FINAL: marker |
--require-final | RAVENCLAWS_REQUIRE_FINAL | false | Require FINAL: marker |
-I, --image | RAVENCLAWS_IMAGE | — | Attach image(s) to message |
--pattern-max-rounds | RAVENCLAWS_PATTERN_MAX_ROUNDS | 3 | Max debate rounds |
--pattern-max-review | RAVENCLAWS_PATTERN_MAX_REVIEW | 3 | Max review-loop iterations |
--pattern-research-agents | RAVENCLAWS_PATTERN_RESEARCH_AGENTS | 3 | Number of research agents |
--pattern-voters | RAVENCLAWS_PATTERN_VOTERS | 3 | Number of voters |
--pattern-verbose | RAVENCLAWS_PATTERN_VERBOSE | false | Show verbose pattern results |
2. Agent modes (--mode)
2a. Single agent (default)
One agent, one conversation. Reads a prompt from stdin, sends it to the LLM, prints the response.
ravenclaws
ravenclaws --mode single2b. Swarm mode
Multiple parallel agents with different personas working on the same task. Supports 4 topologies: star, mesh, hierarchical, hybrid.
ravenclaws --mode swarm
ravenclaws --mode swarm --swarm-topology mesh --swarm-max-workers 502c. Supervisor mode
A supervisor agent decomposes a task, spawns sub-agents, and aggregates results.
ravenclaws --mode supervisor2d. Orchestrate mode
Full swarm orchestration with self-provisioning sub-agents, dynamic role assignment, and recursive supervision.
ravenclaws --mode orchestrate
ravenclaws --mode orchestrate --swarm-dynamic-roles --swarm-communication3. Multi-agent patterns (--mode)
Four built-in collaboration strategies, available in both single-provider and multi-model variants.
3a. Debate
Multiple agents debate a topic over several rounds, refining their positions.
ravenclaws --mode debate
ravenclaws --mode debate --pattern-max-rounds 5 --pattern-verbose3b. Review loop
An agent produces output, a reviewer critiques it, and the agent iterates.
ravenclaws --mode review-loop
ravenclaws --mode review-loop --pattern-max-review 53c. Research & synthesize
Multiple research agents gather information, then a synthesizer combines findings.
ravenclaws --mode research-synthesize
ravenclaws --mode research-synthesize --pattern-research-agents 53d. Voting
Multiple agents vote on the best answer, with configurable voter count.
ravenclaws --mode voting
ravenclaws --mode voting --pattern-voters 54. One-shot execution (--exec)
Run a single prompt and print the response to stdout. Ideal for scripting and piping. The agent loop runs with tool-use enabled — the agent can call tools, browse the web, execute shell commands, etc.
ravenclaws --exec "What is the capital of France?"
echo "Summarize this text" | ravenclaws --exec
ravenclaws --exec "Analyze this image" --image photo.jpg5. Interactive REPL (--repl)
Full interactive conversation with streaming token-by-token output. Type messages line by line. Ctrl+C or Ctrl+D to exit.
ravenclaws --repl
ravenclaws --repl --image diagram.png6. HTTP server (--serve)
Long-running HTTP server with REST API endpoints for chat, background tasks, tools, health checks, and Prometheus metrics.
ravenclaws --serve
ravenclaws --serve --server-host 0.0.0.0 --server-port 8080Endpoints
| Method | Path | Description |
|---|---|---|
GET | /health | Liveness probe — always 200 when server is running |
GET | /ready | Readiness probe — 200 when initialized, 503 during startup |
GET | /metrics | Prometheus-style metrics (requests, tokens, tool calls, errors, load) |
GET | /health/deep | Deep health check — verifies LLM connectivity |
POST | /chat | Send a message, get an agent response (JSON or SSE streaming) |
POST | /execute | Submit a background task, returns task ID immediately |
GET | /tasks/{id} | Poll background task status and result |
GET | /tools | List available tools with JSON schemas |
GET | /tools/{name} | Get details of a specific tool |
POST | /tools/{name} | Execute a specific tool by name |
POST | /reload | Reload configuration (distroless-friendly SIGHUP alternative) |
Example usage
# Chat
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello!"}'
# Background task
curl -X POST http://localhost:8080/execute \
-H "Content-Type: application/json" \
-d '{"prompt": "Analyze this data"}'
# List tools
curl http://localhost:8080/tools
# Execute a tool
curl -X POST http://localhost:8080/tools/web_fetch \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'
# Health & metrics
curl http://localhost:8080/health
curl http://localhost:8080/ready
curl http://localhost:8080/metrics
# Reload config
curl -X POST http://localhost:8080/reload7. MCP server (--mcp-server)
Expose RavenClaws' built-in tools over stdio via the Model Context Protocol (MCP). Any MCP client (Claude Desktop, VS Code, etc.) can discover and call RavenClaws tools.
ravenclaws --mcp-serverThe server speaks JSON-RPC 2.0 over stdio, supporting initialize, tools/list, and tools/call. All tool calls are policy-checked and audited.
8. MCP SSE server (--mcp-sse-server)
Same as MCP server but over HTTP with Server-Sent Events (SSE) transport.
ravenclaws --mcp-sse-server
ravenclaws --mcp-sse-server --mcp-sse-host 0.0.0.0 --mcp-sse-port 80819. MCP client (--mcp-command)
Connect to external MCP servers and register their tools into the agent's tool registry. The agent can then call those tools alongside built-in tools.
ravenclaws --mcp-command "npx -y @modelcontextprotocol/server-filesystem /tmp"
ravenclaws --mcp-command "python mcp-server.py" --mcp-args "--port 9000"
ravenclaws --mcp-command "my-server" --mcp-env "API_KEY=sk-..."Multiple MCP servers can also be configured in the TOML config file (see §14).
10. Background tasks (--background)
Submit a task and get an ID immediately. The task runs asynchronously and can be polled later. Tasks persist to disk and survive process restarts.
# Submit a task
TASK_ID=$(ravenclaws --background --exec "Analyze this data")
echo "Task ID: $TASK_ID"
# Check status
ravenclaws --task-status "$TASK_ID"
# List all tasks
ravenclaws --task-list
# Cancel a task
ravenclaws --task-cancel "$TASK_ID"
# Resume incomplete tasks on restart
ravenclaws --task-resume11. Scheduler (--scheduler)
Run configured triggers (cron, webhook, file-watch) for proactive 24/7 agents.
ravenclaws --scheduler
ravenclaws --scheduler --webhook-port 9090Configure triggers in ravenclaws.toml:
[scheduler]
triggers = [
{ type = "cron", schedule = "0 */6 * * *", prompt = "Daily system health check" },
{ type = "webhook", endpoint = "/webhook/github", prompt = "Process GitHub event" },
{ type = "file_watch", path = "/data/incoming", prompt = "Process new file" },
]12. Heartbeat mode (--heartbeat)
Autonomous long-running agent that runs a persistent assess → plan → act → persist → sleep loop. The agent works independently over hours, days, or weeks. State is persisted to disk and survives restarts.
ravenclaws --heartbeat --heartbeat-goal "Monitor system health and report anomalies"
ravenclaws --heartbeat \
--heartbeat-goal "Watch for security threats" \
--heartbeat-tick-interval 60 \
--heartbeat-max-ticks 100
# Resume a previous session
ravenclaws --heartbeat --heartbeat-session "session-uuid"13. Eval mode (--eval)
Run evaluation suites to test agent quality and behavior. Eval configs define assertions, run traces, and produce text or JSON reports.
ravenclaws --eval tests/eval/basic-suite.toml
ravenclaws --eval tests/eval/security-suite.toml --eval-json14. Configuration file
RavenClaws uses TOML configuration files. By default it looks for ravenclaws.toml in the current directory, or you can specify a path with -c.
ravenclaws -c /etc/ravenclaws/config.tomlSee the full configuration reference for every section, key, and default.
15. Environment variables
Every config field can be overridden via environment variables using the RAVENCLAWS__ prefix (double underscore for nested fields):
export RAVENCLAWS__LLM__PROVIDER=openai
export RAVENCLAWS__LLM__ENDPOINT=https://api.openai.com
export RAVENCLAWS__LLM__API_KEY=sk-...
export RAVENCLAWS__LLM__MODEL=gpt-4o
export RAVENCLAWS__SECURITY__REQUIRE_TLS=false
export RAVENCLAWS__RUNTIME__HOST=0.0.0.0
export RAVENCLAWS__RUNTIME__PORT=8080CLI-specific env vars use a flat naming convention like RAVENCLAWS_PROVIDER, RAVENCLAWS_ENDPOINT, etc. (see the table in §1).
16. Docker
Production (distroless)
docker build -t ravenclaws:latest .
docker run --rm ravenclaws:latest --version
docker run --rm -p 8080:8080 ravenclaws:latest --serveThe production image uses gcr.io/distroless/cc-debian12:nonroot — no shell, no package manager, runs as UID 65532.
Development (with LiteLLM)
docker compose up
# RavenClaws at http://localhost:8080
# LiteLLM at http://localhost:4000Slim (with MCP client support)
docker build -f Dockerfile.slim -t ravenclaws:slim .
docker run --rm ravenclaws:slim --mcp-command "npx -y @modelcontextprotocol/server-filesystem /tmp"The slim image is Debian-based and includes nodejs, npm, and curl.
17. Kubernetes
Quick deploy
kubectl apply -f k8s/deployment.yamlHelm chart
helm install ravenclaws charts/ravenclaws/The Helm chart supports 11 configurable resources including ConfigMap, Secrets, Service, Ingress, NetworkPolicy, PDB, PVC, ServiceMonitor, and RBAC.
18. Library usage
RavenClaws is available as a library crate on crates.io:
[dependencies]
ravenclaws = "1.1"Basic chat
use ravenclaws::config::Config;
use ravenclaws::llm::{create_client, ChatMessage, LLMProviderTrait};
let config = Config::load(None)?;
let llm = create_client(&config.llm)?;
let response = llm.chat(vec![
ChatMessage::new("user", "Hello!"),
]).await?;
println!("{}", response.choices[0].message.content);Agent loop with tools
use ravenclaws::config::Config;
use ravenclaws::llm::create_client;
use ravenclaws::agent::{run_agent_loop, AgentLoopConfig};
use ravenclaws::tools::ToolRegistry;
let config = Config::load(None)?;
let llm = create_client(&config.llm)?;
let tool_registry = ToolRegistry::with_config(&config);
let loop_config = AgentLoopConfig::default();
let response = run_agent_loop(
llm,
"Analyze this data",
&config.llm.system_prompt,
loop_config,
None,
Some(tool_registry),
).await?;
println!("{}", response);Full examples
See the examples/ directory in the repository for runnable programs:
cargo run --example basic_chat
cargo run --example agent_loop
cargo run --example swarm
cargo run --example mcp_client -- "npx @modelcontextprotocol/server-filesystem /tmp"
cargo run --example heartbeat19. Multi-model mode
When multiple [[llms]] sections are defined in config, RavenClaws enters multi-model mode. All agent modes have multi-model variants that round-robin across providers. Fallback chains are automatically built — if one provider fails, the next is tried.
# Uses all configured providers in rotation
ravenclaws --mode single
ravenclaws --mode debate20. Multi-modal input (--image)
Attach images to your message (supported formats: PNG, JPEG, GIF, WebP). Works in --exec, --repl, and HTTP server modes.
ravenclaws --exec "Describe this image" --image photo.jpg
ravenclaws --repl --image diagram.png --image chart.png
ravenclaws --exec "Compare these images" -I img1.jpg -I img2.jpg21. Graceful shutdown
All long-running modes (server, heartbeat, scheduler, REPL) support graceful shutdown via SIGTERM or SIGINT (Ctrl+C). The shutdown sequence:
- Signal received → shutdown flag set
- In-progress operations complete (with configurable timeout)
- State is persisted (checkpoints, heartbeat state, background tasks)
- Clean shutdown logged
Quick reference
# One-shot
ravenclaws --exec "Hello"
# Interactive
ravenclaws --repl
# HTTP server
ravenclaws --serve
# MCP server
ravenclaws --mcp-server
# Background task
ravenclaws --background --exec "Long task"
# Autonomous agent
ravenclaws --heartbeat --heartbeat-goal "Monitor system"
# Swarm
ravenclaws --mode swarm
# Multi-agent patterns
ravenclaws --mode debate
ravenclaws --mode review-loop
ravenclaws --mode research-synthesize
ravenclaws --mode voting
# Eval
ravenclaws --eval tests/eval/basic-suite.toml
# Scheduler
ravenclaws --scheduler
# With images
ravenclaws --exec "Describe" --image photo.jpg
# Docker
docker run --rm ravenclaws:latest --exec "Hello"
# Kubernetes
kubectl apply -f k8s/deployment.yaml